sw/source/core/crsr/crsrsh.cxx         |    6 +++---
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |    3 ---
 vcl/source/gdi/pdfwriter_impl.cxx      |   10 ++++++++++
 3 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 601dfe1cc547c4ae4a8e87da6d268e04ba445555
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Sep 19 21:18:52 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Sep 21 08:29:30 2023 +0200

    tdf#157129 sw: fix wrong cursor position after paste
    
    This asserts in SwUndoInserts::UndoImpl():
    index.cxx:234: virtual SwContentIndexReg::~SwContentIndexReg(): Assertion 
`!m_pFirst && !m_pLast && "There are still indices registered"' failed.
    
    Because there is a bookmark still registered, because the content was
    inserted wrongly into a fly frame that contains a SwGrfNode, because
    earlier the cursor was in a hidden text node and
    SwCursorShell::UpdateCursorPos() moved it into an as-char anchored image.
    
    UpdateCursorPos() should put the cursor only onto a text node.
    
    (somehow regression from commit bb733957dd39e6f0b9d80bb59eb0177188794797)
    
    Change-Id: If00d1e09a612849a44bb3e2d3bd7bac6fa9ac05f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157071
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit b20ca8d951e8205c8b963c6b7407f984053b4094)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157111
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index f2b8ad05f738..49a6e7aaff4d 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1764,8 +1764,8 @@ void SwCursorShell::VisPortChgd( const SwRect & rRect )
 
 /** Set the cursor back into content.
 
-    This should only be called if the cursor was move somewhere else (e.g. when
-    deleting a border). The new position is calculated from its current 
position
+    This should only be called if the cursor was moved (e.g. when deleting a
+    text frame). The new position is calculated from its current position
     in the layout.
 */
 void SwCursorShell::UpdateCursorPos()
@@ -1777,7 +1777,7 @@ void SwCursorShell::UpdateCursorPos()
 
     if (isInHiddenTextFrame(pShellCursor) && !ExtendedSelectedAll())
     {
-        SwCursorMoveState aTmpState( CursorMoveState::NONE );
+        SwCursorMoveState aTmpState(CursorMoveState::SetOnlyText);
         aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable();
         GetLayout()->GetModelPositionForViewPoint( pShellCursor->GetPoint(), 
pShellCursor->GetPtPos(),
                                      &aTmpState );
commit 58b35faee869383974da0acfdf24577603634b7b
Author:     Patrick Luby <plub...@neooffice.org>
AuthorDate: Tue Sep 19 16:43:46 2023 -0400
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Sep 21 08:29:19 2023 +0200

    tdf#156842 increase scale for external PDF data
    
    For some unknown reason, the scale is 8 times larger than for
    non-external PDF XObjects.
    
    This fix also allows the CppunitTest_vcl_pdfexport to run
    successfully on macOS.
    
    Change-Id: I166914e6ac575c50985efba3fb7a38ec758dea1a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157090
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    (cherry picked from commit c2d7c8e5c616980d5fa77ac48babbf27342b2f0a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157114
    Reviewed-by: Patrick Luby <plub...@neooffice.org>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index d5d8408630aa..0f16c35038ee 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -4174,10 +4174,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, 
testPdfImageHyperlink)
     // - Expected: 0.0012626264
     // - Actual  : 0.00126
     // i.e. the rounded reciprocal was 794 points, not the original 792.
-    // FIXME macOS actual value is 0.0001578282, for unknown reasons.
-#if !defined MACOSX
     CPPUNIT_ASSERT_EQUAL(0.0012626264, rtl::math::round(aScale.getY(), 10));
-#endif
 }
 
 CPPUNIT_TEST_FIXTURE(PdfExportTest, testURIs)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index d9abb0885c22..28935f59a5a5 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -8984,6 +8984,16 @@ void PDFWriterImpl::writeReferenceXObject(const 
ReferenceXObjectEmit& rEmit)
     sal_Int32 nWrappedFormObject = 0;
     if (!m_aContext.UseReferenceXObject)
     {
+#ifdef MACOSX
+        // tdf#156842 increase scale for external PDF data
+        // For some unknown reason, the scale is 8 times larger than for
+        // non-external PDF XObjects.
+        // This fix also allows the CppunitTest_vcl_pdfexport to run
+        // successfully on macOS.
+        fScaleX = 8.0 / aSize.Width();
+        fScaleY = 8.0 / aSize.Height();
+#endif
+
         // Parse the PDF data, we need that to write the PDF dictionary of our
         // object.
         if (rEmit.m_nExternalPDFDataIndex < 0)

Reply via email to