vcl/inc/pdf/pdfwriter_impl.hxx    |    2 +-
 vcl/source/gdi/pdfwriter_impl.cxx |   26 +++++++++++++-------------
 2 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit f2762465eb8ccbad74acf07afca3358a5ab3e1c1
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Sep 3 15:31:14 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Sep 3 17:25:08 2022 +0200

    don't check that the shadow positions map back to source mapmode integers
    
    because they are fake positions created by the pdf export and not from
    the source application
    
    Change-Id: Ieeb1b835123a5302ebbb35902b29ebe77ef5fe27
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139326
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx
index 9af21e81baee..94a52bb07431 100644
--- a/vcl/inc/pdf/pdfwriter_impl.hxx
+++ b/vcl/inc/pdf/pdfwriter_impl.hxx
@@ -827,7 +827,7 @@ i12626
     /* TODO: remove rText as soon as SalLayout will change so that rText is 
not necessary anymore */
     void drawVerticalGlyphs( const std::vector<PDFGlyph>& rGlyphs, 
OStringBuffer& rLine, const Point& rAlignOffset, const Matrix3& rRotScale, 
double fAngle, double fXScale, double fSkew, sal_Int32 nFontHeight );
     void drawHorizontalGlyphs( const std::vector<PDFGlyph>& rGlyphs, 
OStringBuffer& rLine, const Point& rAlignOffset, bool bFirst, double fAngle, 
double fXScale, double fSkew, sal_Int32 nFontHeight, sal_Int32 nPixelFontHeight 
);
-    void drawLayout( SalLayout& rLayout, const OUString& rText, bool 
bTextLines );
+    void drawLayout( SalLayout& rLayout, const OUString& rText, bool 
bTextLines, bool bCheckSubPixelToLogic );
     void drawRelief( SalLayout& rLayout, const OUString& rText, bool 
bTextLines );
     void drawShadow( SalLayout& rLayout, const OUString& rText, bool 
bTextLines );
 
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 5e93cff34bb0..f1c01944a48f 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -5889,7 +5889,7 @@ void PDFWriterImpl::drawRelief( SalLayout& rLayout, const 
OUString& rText, bool
 
     rLayout.DrawOffset() += Point( nOff, nOff );
     updateGraphicsState();
-    drawLayout( rLayout, rText, bTextLines );
+    drawLayout( rLayout, rText, bTextLines, false );
 
     rLayout.DrawOffset() -= Point( nOff, nOff );
     setTextLineColor( aTextLineColor );
@@ -5897,7 +5897,7 @@ void PDFWriterImpl::drawRelief( SalLayout& rLayout, const 
OUString& rText, bool
     aSetFont.SetColor( aTextColor );
     setFont( aSetFont );
     updateGraphicsState();
-    drawLayout( rLayout, rText, bTextLines );
+    drawLayout( rLayout, rText, bTextLines, true );
 
     // clean up the mess
     pop();
@@ -5925,7 +5925,7 @@ void PDFWriterImpl::drawShadow( SalLayout& rLayout, const 
OUString& rText, bool
     if( rFont.IsOutline() )
         nOff++;
     rLayout.DrawBase() += DevicePoint(nOff, nOff);
-    drawLayout( rLayout, rText, bTextLines );
+    drawLayout( rLayout, rText, bTextLines, false );
     rLayout.DrawBase() -= DevicePoint(nOff, nOff);
 
     setFont( aSaveFont );
@@ -6106,7 +6106,7 @@ void PDFWriterImpl::drawHorizontalGlyphs(
     }
 }
 
-void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, 
bool bTextLines )
+void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, 
bool bTextLines, bool bCheckSubPixelToLogic )
 {
     // relief takes precedence over shadow (see outdev3.cxx)
     if(  m_aCurrentPDFState.m_aFont.GetRelief() != FontRelief::NONE )
@@ -6342,7 +6342,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const 
OUString& rText, bool
         // ascent / descent to match the on-screen rendering.
         // This is the top left of the text without ascent / descent.
         DevicePoint aDrawPosition(rLayout.GetDrawPosition());
-        tools::Rectangle aRectangle(SubPixelToLogic(aDrawPosition, true),
+        tools::Rectangle aRectangle(SubPixelToLogic(aDrawPosition, 
bCheckSubPixelToLogic),
                                     
Size(ImplDevicePixelToLogicWidth(rLayout.GetTextWidth()), 0));
         aRectangle.AdjustTop(-aRefDevFontMetric.GetAscent());
         // This includes ascent / descent.
@@ -6353,7 +6353,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const 
OUString& rText, bool
         {
             // Adapt rectangle for rotated text.
             tools::Polygon aPolygon(aRectangle);
-            aPolygon.Rotate(SubPixelToLogic(aDrawPosition, true), 
pFontInstance->mnOrientation);
+            aPolygon.Rotate(SubPixelToLogic(aDrawPosition, 
bCheckSubPixelToLogic), pFontInstance->mnOrientation);
             drawPolygon(aPolygon);
         }
         else
@@ -6456,7 +6456,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const 
OUString& rText, bool
                 }
                 else if( nWidth > 0 )
                 {
-                    drawTextLine( SubPixelToLogic(aStartPt, true),
+                    drawTextLine( SubPixelToLogic(aStartPt, 
bCheckSubPixelToLogic),
                                   ImplDevicePixelToLogicWidth( nWidth ),
                                   eStrikeout, eUnderline, eOverline, 
bUnderlineAbove );
                     nWidth = 0;
@@ -6465,7 +6465,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const 
OUString& rText, bool
 
             if( nWidth > 0 )
             {
-                drawTextLine( SubPixelToLogic(aStartPt, true),
+                drawTextLine( SubPixelToLogic(aStartPt, bCheckSubPixelToLogic),
                               ImplDevicePixelToLogicWidth( nWidth ),
                               eStrikeout, eUnderline, eOverline, 
bUnderlineAbove );
             }
@@ -6474,7 +6474,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const 
OUString& rText, bool
         {
             DevicePoint aStartPt = rLayout.GetDrawPosition();
             int nWidth = rLayout.GetTextWidth() / rLayout.GetUnitsPerPixel();
-            drawTextLine( SubPixelToLogic(aStartPt, true),
+            drawTextLine( SubPixelToLogic(aStartPt, bCheckSubPixelToLogic),
                           ImplDevicePixelToLogicWidth( nWidth ),
                           eStrikeout, eUnderline, eOverline, bUnderlineAbove );
         }
@@ -6552,7 +6552,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const 
OUString& rText, bool
 
             DevicePoint aMarkDevPos(aPos);
             aMarkDevPos += aAdjOffset;
-            Point aMarkPos = SubPixelToLogic(aMarkDevPos, true);
+            Point aMarkPos = SubPixelToLogic(aMarkDevPos, 
bCheckSubPixelToLogic);
             drawEmphasisMark( aMarkPos.X(), aMarkPos.Y(),
                               aEmphPoly, bEmphPolyLine,
                               aEmphRect1, aEmphRect2 );
@@ -6617,7 +6617,7 @@ void PDFWriterImpl::drawText( const Point& rPos, const 
OUString& rText, sal_Int3
         0, {}, {}, SalLayoutFlags::NONE, nullptr, layoutGlyphs );
     if( pLayout )
     {
-        drawLayout( *pLayout, rText, bTextLines );
+        drawLayout( *pLayout, rText, bTextLines, true );
     }
 }
 
@@ -6635,7 +6635,7 @@ void PDFWriterImpl::drawTextArray( const Point& rPos, 
const OUString& rText, o3t
         SalLayoutFlags::NONE, nullptr, layoutGlyphs );
     if( pLayout )
     {
-        drawLayout( *pLayout, rText, true );
+        drawLayout( *pLayout, rText, true, true );
     }
 }
 
@@ -6653,7 +6653,7 @@ void PDFWriterImpl::drawStretchText( const Point& rPos, 
sal_uLong nWidth, const
         {}, {}, SalLayoutFlags::NONE, nullptr, layoutGlyphs );
     if( pLayout )
     {
-        drawLayout( *pLayout, rText, true );
+        drawLayout( *pLayout, rText, true, true );
     }
 }
 

Reply via email to