diff options
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/cpdfsdk_widget.cpp | 3 | ||||
-rw-r--r-- | fpdfsdk/formfiller/cffl_formfiller.cpp | 25 |
2 files changed, 11 insertions, 17 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp index 7d9357adb9..bd586a999c 100644 --- a/fpdfsdk/cpdfsdk_widget.cpp +++ b/fpdfsdk/cpdfsdk_widget.cpp @@ -1723,9 +1723,8 @@ CFX_Matrix CPDFSDK_Widget::GetMatrix() const { float fHeight = rcAnnot.top - rcAnnot.bottom; switch (abs(pControl->GetRotation() % 360)) { - case 0: default: - mt = CFX_Matrix(1, 0, 0, 1, 0, 0); + case 0: break; case 90: mt = CFX_Matrix(0, 1, -1, 0, fWidth, 0); diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index 2bc240fc2e..98b914101d 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -386,29 +386,24 @@ void CFFL_FormFiller::DestroyPDFWindow(CPDFSDK_PageView* pPageView) { } CFX_Matrix CFFL_FormFiller::GetWindowMatrix(void* pAttachedData) { - if (CFFL_PrivateData* pPrivateData = (CFFL_PrivateData*)pAttachedData) { - if (pPrivateData->pPageView) { - CFX_Matrix mtPageView; - pPrivateData->pPageView->GetCurrentMatrix(mtPageView); - - CFX_Matrix mt = GetCurMatrix(); - mt.Concat(mtPageView); - - return mt; - } - } - return CFX_Matrix(1, 0, 0, 1, 0, 0); + CFX_Matrix mt; + auto* pPrivateData = reinterpret_cast<CFFL_PrivateData*>(pAttachedData); + if (!pAttachedData || !pPrivateData->pPageView) + return mt; + + CFX_Matrix mtPageView; + pPrivateData->pPageView->GetCurrentMatrix(mtPageView); + mt = GetCurMatrix(); + mt.Concat(mtPageView); + return mt; } CFX_Matrix CFFL_FormFiller::GetCurMatrix() { CFX_Matrix mt; - CFX_FloatRect rcDA = m_pWidget->GetPDFAnnot()->GetRect(); - switch (m_pWidget->GetRotate()) { default: case 0: - mt = CFX_Matrix(1, 0, 0, 1, 0, 0); break; case 90: mt = CFX_Matrix(0, 1, -1, 0, rcDA.right - rcDA.left, 0); |