Fix windows-specific usage of CFX_WideStr::operator LPCWSTR().
[pdfium.git] / fpdfsdk / src / fpdfdoc.cpp
index ab3dd2c..52d88b2 100644 (file)
@@ -11,7 +11,7 @@ static int THISMODULE = 0;
 
 static CPDF_Bookmark FindBookmark(const CPDF_BookmarkTree& tree, CPDF_Bookmark bookmark, const CFX_WideString& title)
 {
-       if (bookmark && bookmark.GetTitle().CompareNoCase(title) == 0) {
+       if (bookmark && bookmark.GetTitle().CompareNoCase(title.c_str()) == 0) {
                // First check this item
                return bookmark;
        }
@@ -173,21 +173,20 @@ DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, do
        CPDF_Document* pDoc = pPage->m_pDocument;
        CPDF_LinkList* pLinkList = (CPDF_LinkList*)pDoc->GetPrivateData(&THISMODULE);
        if (!pLinkList) {
-               pLinkList = FX_NEW CPDF_LinkList(pDoc);
+               pLinkList = new CPDF_LinkList(pDoc);
                pDoc->SetPrivateData(&THISMODULE, pLinkList, ReleaseLinkList);
        }
-       return pLinkList->GetLinkAtPoint(pPage, (FX_FLOAT)x, (FX_FLOAT)y);
+       return pLinkList->GetLinkAtPoint(pPage, (FX_FLOAT)x, (FX_FLOAT)y).GetDict();
 }
 
 DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK pDict)
 {
        if (!document)
                return NULL;
-       CPDF_Document* pDoc = (CPDF_Document*)document;
        if (!pDict)
                return NULL;
-       CPDF_Link link = (CPDF_Dictionary*)pDict;
-
+       CPDF_Document* pDoc = (CPDF_Document*)document;
+       CPDF_Link link((CPDF_Dictionary*)pDict);
        FPDF_DEST dest = link.GetDest(pDoc).GetObject();
        if (dest)
                return dest;
@@ -202,7 +201,7 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict)
 {
        if (!pDict)
                return NULL;
-       CPDF_Link link = (CPDF_Dictionary*)pDict;
+       CPDF_Link link((CPDF_Dictionary*)pDict);
        return link.GetAction().GetDict();
 }