Bugzilla – Attachment 173616 Details for
Bug 104597
RTL script text runs are reversed on PDF import, PDFIProcessor::mirrorString misbehaving
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
tdf104597-not-perfect-patch.diff
tdf104597-not-perfect-patch.diff (text/plain), 1.76 KB, created by
Kevin Suo
on 2021-07-16 04:59:07 UTC
(
hide
)
Description:
tdf104597-not-perfect-patch.diff
Filename:
MIME Type:
Creator:
Kevin Suo
Created:
2021-07-16 04:59:07 UTC
Size:
1.76 KB
patch
obsolete
>diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx >index d5ce02ad89bf..9f5756e548d1 100644 >--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx >+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx >@@ -35,6 +35,7 @@ > > #include <string.h> > #include <string_view> >+#include <algorithm> > > using namespace ::com::sun::star; > using namespace ::com::sun::star::lang; >@@ -122,7 +123,17 @@ void DrawXmlEmitter::visit( TextElement& elem, const std::list< std::unique_ptr< > } > > if (isRTL) // If so, reverse string >- str = PDFIProcessor::mirrorString( str ); >+ { >+ // Note: Poppler 21.04 fixed the word order for RTL text, see: >+ // https://cgit.freedesktop.org/poppler/poppler/commit/?id=7578e04f8d48d307e82764e05ab13f6612180641 >+ // Thus for poppler version >= 21.04, the following code may not needed? >+ OUStringBuffer reversedStr; >+ for (int i=str.getLength(); i>0; i--) >+ { >+ reversedStr.append(str.subView(i-1, 1)); >+ } >+ str = reversedStr; >+ } > > m_rEmitContext.rEmitter.beginTag( "text:span", aProps ); > >@@ -701,8 +712,7 @@ void DrawXmlOptimizer::optimizeTextElements(Element& rParent) > rCurGC.FillColor.Red == rNextGC.FillColor.Red && > rCurGC.FillColor.Green == rNextGC.FillColor.Green && > rCurGC.FillColor.Blue == rNextGC.FillColor.Blue && >- rCurGC.FillColor.Alpha == rNextGC.FillColor.Alpha && >- (rCurGC.Transformation == rNextGC.Transformation || notTransformed(rNextGC)) >+ rCurGC.FillColor.Alpha == rNextGC.FillColor.Alpha > ) > { > pCur->updateGeometryWith( pNext );
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 104597
:
129516
|
129523
|
153035
| 173616 |
173617
|
173618
|
173646
|
173657
|
182980
|
182981
|
183843
|
183844
|
183883