summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-26 09:32:12 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-26 09:32:13 -0700
commit186a78eb0a821a2f1feef524cb590d0fea2009ba (patch)
tree8c22dcac7a3e8e9857031e357f3c120b5cea0cbb /xfa
parentba9ee0748ae03519e54e82c49c6aaa481a6fff21 (diff)
downloadpdfium-186a78eb0a821a2f1feef524cb590d0fea2009ba.tar.xz
Remove no-op ShowFileDialog(s).
Two different versions, one in xfa and one in fpdfsdk, both do nothing. Review URL: https://codereview.chromium.org/1915323002
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/app/xfa_ffimageedit.cpp63
-rw-r--r--xfa/fxfa/include/fxfa.h4
2 files changed, 6 insertions, 61 deletions
diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp
index b56f24d366..909f7e31f0 100644
--- a/xfa/fxfa/app/xfa_ffimageedit.cpp
+++ b/xfa/fxfa/app/xfa_ffimageedit.cpp
@@ -82,15 +82,16 @@ void CXFA_FFImageEdit::RenderWidget(CFX_Graphics* pGS,
iImageYDpi, iHorzAlign, iVertAlign);
}
}
+
FX_BOOL CXFA_FFImageEdit::OnLButtonDown(uint32_t dwFlags,
FX_FLOAT fx,
FX_FLOAT fy) {
- if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) {
+ if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open)
return FALSE;
- }
- if (!PtInActiveRect(fx, fy)) {
+
+ if (!PtInActiveRect(fx, fy))
return FALSE;
- }
+
SetButtonDown(TRUE);
CFWL_MsgMouse ms;
ms.m_dwCmd = FWL_MSGMOUSECMD_LButtonDown;
@@ -100,61 +101,9 @@ FX_BOOL CXFA_FFImageEdit::OnLButtonDown(uint32_t dwFlags,
ms.m_pDstTarget = m_pNormalWidget->m_pIface;
FWLToClient(ms.m_fx, ms.m_fy);
TranslateFWLMessage(&ms);
- IXFA_AppProvider* pAppProvider = GetAppProvider();
- if (!pAppProvider) {
- return TRUE;
- }
- CFX_WideString wsTitle;
- CFX_WideString wsFilter;
- pAppProvider->LoadString(XFA_IDS_ImageFilter, wsFilter);
- CFX_WideStringArray wsPathArray;
- pAppProvider->ShowFileDialog(wsTitle.AsStringC(), wsFilter.AsStringC(),
- wsPathArray);
- int32_t iSize = wsPathArray.GetSize();
- if (iSize < 1) {
- return TRUE;
- }
- CFX_WideString wsFilePath = wsPathArray[0];
- FX_STRSIZE nLen = wsFilePath.GetLength();
- FX_STRSIZE nIndex = nLen - 1;
- while (nIndex > 0 && wsFilePath[nIndex] != '.') {
- nIndex--;
- }
- if (nIndex <= 0) {
- return TRUE;
- }
- CFX_WideString wsContentType(L"image/");
- wsContentType += wsFilePath.Right(nLen - nIndex - 1);
- wsContentType.MakeLower();
- FXCODEC_IMAGE_TYPE eImageType = XFA_GetImageType(wsContentType);
- if (eImageType == FXCODEC_IMAGE_UNKNOWN) {
- return TRUE;
- }
- CFX_WideString wsImage;
- IFX_FileRead* pFileRead = FX_CreateFileRead(wsFilePath.c_str());
- if (pFileRead) {
- int32_t nDataSize = pFileRead->GetSize();
- if (nDataSize > 0) {
- CFX_ByteString bsBuf;
- FX_CHAR* pImageBuffer = bsBuf.GetBuffer(nDataSize);
- pFileRead->ReadBlock(pImageBuffer, 0, nDataSize);
- bsBuf.ReleaseBuffer();
- if (!bsBuf.IsEmpty()) {
- FX_CHAR* pData = XFA_Base64Encode(bsBuf.raw_str(), nDataSize);
- wsImage = CFX_WideString::FromLocal(pData);
- FX_Free(pData);
- }
- }
- m_pDataAcc->SetImageEditImage(NULL);
- pFileRead->Release();
- }
- m_pDataAcc->SetImageEdit(wsContentType.AsStringC(), CFX_WideStringC(),
- wsImage.AsStringC());
- m_pDataAcc->LoadImageEditImage();
- AddInvalidateRect();
- m_pDocView->SetChangeMark();
return TRUE;
}
+
void CXFA_FFImageEdit::SetFWLRect() {
if (!m_pNormalWidget) {
return;
diff --git a/xfa/fxfa/include/fxfa.h b/xfa/fxfa/include/fxfa.h
index 6c07370a29..e241139464 100644
--- a/xfa/fxfa/include/fxfa.h
+++ b/xfa/fxfa/include/fxfa.h
@@ -259,10 +259,6 @@ class IXFA_AppProvider {
const CFX_WideStringC& wsEncode) = 0;
virtual void LoadString(int32_t iStringID, CFX_WideString& wsString) = 0;
- virtual FX_BOOL ShowFileDialog(const CFX_WideStringC& wsTitle,
- const CFX_WideStringC& wsFilter,
- CFX_WideStringArray& wsPathArr,
- FX_BOOL bOpen = TRUE) = 0;
virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0;
};