core.git: Branch 'libreoffice-7-6' - sdext/source

2024-01-15 Thread Thorsten Behrens (via logerrit)
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 1e0670916be8f9d1347b362364d1c49d8fea3492
Author: Thorsten Behrens 
AuthorDate: Sat Jan 13 21:40:09 2024 +0100
Commit: Xisco Fauli 
CommitDate: Mon Jan 15 16:24:05 2024 +0100

Fix obscure xpdfimport crash on missing fonts

Invert logic, such that the case WMode == 0 and no font set now run
the former else branch. Happened here for an obscure pdf I was missing
some fonts for.

Change-Id: I2825c914a04f6a95d459eeeffb8091ed8f1819dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162029
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 1637610478c4493c29a29286b66250ef47507681)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162093
Reviewed-by: Michael Stahl 
(cherry picked from commit a2813ce500a408ed0de716972823277c1f9aeab0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162096
Reviewed-by: Xisco Fauli 

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index 3ad139b65fa3..2517618e1019 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -956,18 +956,18 @@ void PDFOutDev::drawChar(GfxState *state, double x, 
double y,
 
 double csdx = 0.0;
 double csdy = 0.0;
-if (state->getFont()->getWMode())
+if (!state->getFont() || !state->getFont()->getWMode())
 {
-csdy = state->getCharSpace();
+csdx = state->getCharSpace();
 if (*u == ' ')
-csdy += state->getWordSpace();
+csdx += state->getWordSpace();
+csdx *= state->getHorizScaling();
 }
 else
 {
-csdx = state->getCharSpace();
+csdy = state->getCharSpace();
 if (*u == ' ')
-csdx += state->getWordSpace();
-csdx *= state->getHorizScaling();
+csdy += state->getWordSpace();
 }
 
 double cstdx = 0.0;


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sdext/source

2023-11-28 Thread Kevin Suo (via logerrit)
 sdext/source/pdfimport/tree/writertreevisiting.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f52d8f004f7d70f89ee805c6f71f1791cac70c0f
Author: Kevin Suo 
AuthorDate: Wed Nov 22 16:11:33 2023 +0800
Commit: Xisco Fauli 
CommitDate: Tue Nov 28 09:46:57 2023 +0100

tdf#157589 tdf#153969: Revert "sdext.pdfimport Writer: Do not visit...

... DrawElement twice in WriterXmlEmitter"

This reverts commit 9ea9d3ccc0f8e4833e745d9655b61d42d6d8fe83.

The reason for the revert:
It causes regressions as indicated in tdf#157589 and tdf#153969.
That commit may be my misunderstanding of the code.

Change-Id: Idd188bf83721d309623a7f8484d064327a3a23af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159811
Tested-by: Jenkins
Reviewed-by: Kevin Suo 
(cherry picked from commit 5589659829f8a1cef8ca1c8a468732105bbe231b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159906
Reviewed-by: Xisco Fauli 

diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx 
b/sdext/source/pdfimport/tree/writertreevisiting.cxx
index a8331b87bfd2..ce8845447e7f 100644
--- a/sdext/source/pdfimport/tree/writertreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx
@@ -413,7 +413,7 @@ void WriterXmlEmitter::visit( DocumentElement& elem, const 
std::list< std::uniqu
 // only DrawElement types
 for( auto it = elem.Children.begin(); it != elem.Children.end(); ++it )
 {
-if( dynamic_cast(it->get()) != nullptr )
+if( dynamic_cast(it->get()) == nullptr )
 (*it)->visitedBy( *this, it );
 }