[Libreoffice-commits] core.git: filter/source

2023-11-30 Thread Mike Kaganski (via logerrit)
 filter/source/config/cache/typedetection.cxx |   26 ++
 1 file changed, 26 insertions(+)

New commits:
commit 93357349ff1998b41ea1ebedf09dc1cc5da316f7
Author: Mike Kaganski 
AuthorDate: Thu Nov 30 23:42:54 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri Dec 1 07:23:32 2023 +0100

Related: tdf#96401 Check ZIP magic number, to avoid false detections

Change-Id: Ice077f35293a3d0f37c74911d5a6db7ccab5fb31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160168
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/filter/source/config/cache/typedetection.cxx 
b/filter/source/config/cache/typedetection.cxx
index c411249877af..065fe483a3dd 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #define DEBUG_TYPE_DETECTION 0
@@ -841,6 +842,31 @@ void TypeDetection::impl_getAllFormatTypes(
 static bool isBrokenZIP(const css::uno::Reference& 
xStream,
 const 
css::uno::Reference& xContext)
 {
+try
+{
+// Only consider seekable streams starting with "PK", to avoid false 
detections
+css::uno::Reference xSeek(xStream, 
css::uno::UNO_QUERY_THROW);
+comphelper::ScopeGuard restorePos(
+[xSeek, nPos = xSeek->getPosition()]
+{
+try
+{
+xSeek->seek(nPos);
+}
+catch (const css::uno::Exception&)
+{
+}
+});
+css::uno::Sequence magic(2);
+xStream->readBytes(magic, 2);
+if (magic.getLength() < 2 || magic[0] != 'P' || magic[1] != 'K')
+return false;
+}
+catch (const css::uno::Exception&)
+{
+return false;
+}
+
 std::vector aArguments{
 css::uno::Any(xStream),
 css::uno::Any(css::beans::NamedValue("AllowRemoveOnInsert", 
css::uno::Any(false))),


[Libreoffice-commits] core.git: filter/source

2023-11-29 Thread Stephan Bergmann (via logerrit)
 filter/source/config/cache/filtercache.cxx |8 
 filter/source/msfilter/rtfutil.cxx |4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 966bf32c4f160b25506a14c772125e5ff50314c0
Author: Stephan Bergmann 
AuthorDate: Wed Nov 29 18:02:34 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Nov 29 22:08:20 2023 +0100

Extended loplugin:ostr: filter

Change-Id: I900c7e070f9830b3da1dbcce75d418a75652d1ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160121
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/filter/source/config/cache/filtercache.cxx 
b/filter/source/config/cache/filtercache.cxx
index 186eadd1a317..8a6f88703823 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -768,7 +768,7 @@ css::uno::Reference< css::uno::XInterface > 
FilterCache::impl_openConfig(std::un
 return m_xConfigTypes;
 sPath   = CFGPACKAGE_TD_TYPES;
 pConfig = _xConfigTypes;
-sRtlLog = "impl_openconfig(E_PROVIDER_TYPES)";
+sRtlLog = "impl_openconfig(E_PROVIDER_TYPES)"_ostr;
 }
 break;
 
@@ -778,7 +778,7 @@ css::uno::Reference< css::uno::XInterface > 
FilterCache::impl_openConfig(std::un
 return m_xConfigFilters;
 sPath   = CFGPACKAGE_TD_FILTERS;
 pConfig = _xConfigFilters;
-sRtlLog = "impl_openconfig(E_PROVIDER_FILTERS)";
+sRtlLog = "impl_openconfig(E_PROVIDER_FILTERS)"_ostr;
 }
 break;
 
@@ -788,7 +788,7 @@ css::uno::Reference< css::uno::XInterface > 
FilterCache::impl_openConfig(std::un
 return m_xConfigOthers;
 sPath   = CFGPACKAGE_TD_OTHERS;
 pConfig = _xConfigOthers;
-sRtlLog = "impl_openconfig(E_PROVIDER_OTHERS)";
+sRtlLog = "impl_openconfig(E_PROVIDER_OTHERS)"_ostr;
 }
 break;
 
@@ -798,7 +798,7 @@ css::uno::Reference< css::uno::XInterface > 
FilterCache::impl_openConfig(std::un
 // the old configuration format only. It's not cached!
 sPath   = CFGPACKAGE_TD_OLD;
 pConfig = 
-sRtlLog = "impl_openconfig(E_PROVIDER_OLD)";
+sRtlLog = "impl_openconfig(E_PROVIDER_OLD)"_ostr;
 }
 break;
 
diff --git a/filter/source/msfilter/rtfutil.cxx 
b/filter/source/msfilter/rtfutil.cxx
index 53f4caea7b98..108b52daf0c0 100644
--- a/filter/source/msfilter/rtfutil.cxx
+++ b/filter/source/msfilter/rtfutil.cxx
@@ -31,7 +31,7 @@ void WrapOle1InOle2(SvStream& rOle1, sal_uInt32 nOle1Size, 
SvStream& rOle2,
 SvGlobalName aName;
 if (rClassName == "PBrush")
 {
-aAnsiUserType = "Bitmap Image";
+aAnsiUserType = "Bitmap Image"_ostr;
 aName = SvGlobalName(0x0003000A, 0, 0, 0xc0, 0, 0, 0, 0, 0, 0, 0x46);
 }
 else
@@ -40,7 +40,7 @@ void WrapOle1InOle2(SvStream& rOle1, sal_uInt32 nOle1Size, 
SvStream& rOle2,
 {
 SAL_WARN("filter.ms", "WrapOle1InOle2: unexpected class name: '" 
<< rClassName << "'");
 }
-aAnsiUserType = "OLE Package";
+aAnsiUserType = "OLE Package"_ostr;
 aName = SvGlobalName(0x0003000C, 0, 0, 0xc0, 0, 0, 0, 0, 0, 0, 0x46);
 }
 pStorage->SetClass(aName, SotClipboardFormatId::NONE, "");


[Libreoffice-commits] core.git: filter/source

2023-11-28 Thread Mike Kaganski (via logerrit)
 filter/source/config/cache/typedetection.cxx   |5 -
 filter/source/storagefilterdetect/filterdetect.cxx |4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit e2aa7041b9a831bbd235f698a6485e2282b6f5ca
Author: Mike Kaganski 
AuthorDate: Tue Nov 28 08:44:23 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Nov 28 09:21:06 2023 +0100

lok: don't use template flag in more places

Similar to commit e2ee3dd61ab8ea5d970d8da5df3233e7bba5909e (lok: add
broken package interaction handler, 2023-10-02), all places of broken
package handling should allow replacing the original document.

Change-Id: I8450dfc0ab60444fa08014cc952ac857998d35ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160009
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/filter/source/config/cache/typedetection.cxx 
b/filter/source/config/cache/typedetection.cxx
index 15a257eef878..c411249877af 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -931,8 +932,10 @@ OUString TypeDetection::impl_detectTypeFlatAndDeep(  
utl::MediaDescriptor& r
 
 if (aRequest.isApproved())
 {
+// lok: we want to overwrite file in jail, so 
don't use template flag
+const bool bIsLOK = 
comphelper::LibreOfficeKit::isActive();
 
rDescriptor[utl::MediaDescriptor::PROP_DOCUMENTTITLE] <<= aDocumentTitle;
-rDescriptor[utl::MediaDescriptor::PROP_ASTEMPLATE] 
<<= true;
+rDescriptor[utl::MediaDescriptor::PROP_ASTEMPLATE] 
<<= !bIsLOK;
 rDescriptor["RepairPackage"] <<= true;
 }
 else
diff --git a/filter/source/storagefilterdetect/filterdetect.cxx 
b/filter/source/storagefilterdetect/filterdetect.cxx
index 8312726e11da..c73355e02a9d 100644
--- a/filter/source/storagefilterdetect/filterdetect.cxx
+++ b/filter/source/storagefilterdetect/filterdetect.cxx
@@ -141,8 +141,10 @@ OUString SAL_CALL 
StorageFilterDetect::detect(uno::Sequence

[Libreoffice-commits] core.git: filter/source

2023-11-27 Thread Mike Kaganski (via logerrit)
 filter/source/config/cache/typedetection.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 657f98d9272dd97e4f4c6e03cce4a0fa9f526819
Author: Mike Kaganski 
AuthorDate: Mon Nov 27 12:21:30 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Nov 27 11:47:40 2023 +0100

Related: tdf#96401 Set PROP_ASTEMPLATE for broken ZIP package

Same as in StorageFilterDetect::detect. It would prompt user on save
to provide a new file name, instead of silently rewriting (possibly
recovered with errors) document.

Change-Id: I8ede6d01e2d482f409e8b3f7452deb1e4bd02a85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159985
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/filter/source/config/cache/typedetection.cxx 
b/filter/source/config/cache/typedetection.cxx
index 5bc4f98b82f5..15a257eef878 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -930,7 +930,11 @@ OUString TypeDetection::impl_detectTypeFlatAndDeep(  
utl::MediaDescriptor& r
 xInteraction->handle(aRequest.GetRequest());
 
 if (aRequest.isApproved())
+{
+
rDescriptor[utl::MediaDescriptor::PROP_DOCUMENTTITLE] <<= aDocumentTitle;
+rDescriptor[utl::MediaDescriptor::PROP_ASTEMPLATE] 
<<= true;
 rDescriptor["RepairPackage"] <<= true;
+}
 else
 rDescriptor["RepairAllowed"] <<= false; // Do not 
ask again
 }


[Libreoffice-commits] core.git: filter/source

2023-10-30 Thread Mike Kaganski (via logerrit)
 filter/source/pdf/pdfexport.cxx |   30 --
 1 file changed, 28 insertions(+), 2 deletions(-)

New commits:
commit 24d4540088f7b45716e87db3fcf0817518d61fe1
Author: Mike Kaganski 
AuthorDate: Mon Oct 30 08:41:54 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Oct 30 14:26:49 2023 +0100

Allow passing Math-specific options to PDF export

The options present in the Math' Print dialog:
* Contents:
  - Title;
  - Formula text;
  - Borders;
* Size:
  - Original size;
  - Fit to page;
  - Scaling N%

were previously not handled in math_pdf_Export. This change makes
them handled, similar to handling of other modules' options.

The final handling of them happens in SmDocShell::Impl_Print.

  TitleRow (boolean; default = true)
  FormulaText (boolean; default = true)
  Border (boolean; default = true)
  PrintFormat (long: 0 - original size; 1 - fit to page; 2 - scaling to 
PrintScale; default = 0)
  PrintScale (unsigned short; default = 100)

They are also available in command line, as implemented in commit
0c3b8792b712e939d2ad524d554f96616b4844be (PDF export: allow setting
filter data keys from the cmdline, 2022-01-24), using JSON syntax.

TODO: make these options available in Math' PDF export dialog.
Change-Id: I4fcc609e943823a5325a4840988a96c9d5ab3223
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158637
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index a8f3cda62224..7d07f8182bdc 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -450,7 +450,11 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 OUString aOpenPassword, aPermissionPassword;
 Reference< beans::XMaterialHolder > xEnc;
 Sequence< beans::NamedValue > aPreparedPermissionPassword;
-
+std::optional oMathTitleRow;
+std::optional oMathFormulaText;
+std::optional oMathBorder;
+std::optional oMathPrintFormat;
+std::optional oMathPrintScale;
 
 // getting the string for the creator
 OUString aCreator;
@@ -674,6 +678,17 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 // Redaction & bitmap related stuff
 else if ( rProp.Name == "IsRedactMode" )
 rProp.Value >>= mbIsRedactMode;
+// Math-specific render options
+else if (rProp.Name == "TitleRow")
+oMathTitleRow = rProp;
+else if (rProp.Name == "FormulaText")
+oMathFormulaText = rProp;
+else if (rProp.Name == "Border")
+oMathBorder = rProp;
+else if (rProp.Name == "PrintFormat")
+oMathPrintFormat = rProp;
+else if (rProp.Name == "PrintScale")
+oMathPrintScale = rProp;
 }
 
 if (!aSignCertificate.is() && 
!aSignCertificateSubjectName.isEmpty())
@@ -981,7 +996,7 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 aPDFExtOutDevData.SetIsReduceImageResolution( 
mbReduceImageResolution );
 aPDFExtOutDevData.SetIsExportNamedDestinations( 
bExportBmkToDest );
 
-Sequence< PropertyValue > aRenderOptions{
+std::vector aRenderOptionsVector{
 comphelper::makePropertyValue("RenderDevice", 
uno::Reference(xDevice)),
 comphelper::makePropertyValue("ExportNotesPages", false),
 comphelper::makePropertyValue("IsFirstPage", true),
@@ -992,6 +1007,17 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 comphelper::makePropertyValue("SinglePageSheets", 
bSinglePageSheets),
 comphelper::makePropertyValue("ExportNotesInMargin", 
bExportNotesInMargin)
 };
+if (oMathTitleRow)
+aRenderOptionsVector.push_back(*oMathTitleRow);
+if (oMathFormulaText)
+aRenderOptionsVector.push_back(*oMathFormulaText);
+if (oMathBorder)
+aRenderOptionsVector.push_back(*oMathBorder);
+if (oMathPrintFormat)
+aRenderOptionsVector.push_back(*oMathPrintFormat);
+if (oMathPrintScale)
+aRenderOptionsVector.push_back(*oMathPrintScale);
+Sequence aRenderOptions = 
comphelper::containerToSequence(aRenderOptionsVector);
 Any& rExportNotesValue = aRenderOptions.getArray()[ 1 ].Value;
 
 if( !aPageRange.isEmpty() || !aSelection.hasValue() )


[Libreoffice-commits] core.git: filter/source

2023-10-29 Thread Mike Kaganski (via logerrit)
 filter/source/pdf/pdfexport.cxx |  345 
 filter/source/pdf/pdfexport.hxx |   54 --
 2 files changed, 174 insertions(+), 225 deletions(-)

New commits:
commit 9a4e4db710137b1a7cb8e62ffa16128c7cc72177
Author: Mike Kaganski 
AuthorDate: Sun Oct 29 18:22:09 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Oct 30 06:38:58 2023 +0100

These members can be local variables

They are only used in one method.

Change-Id: Ic6fafb1518b7bc57cd1500fdbabbeb26739db291
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158624
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 0bb6131c582a..a8f3cda62224 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -82,62 +82,17 @@ PDFExport::PDFExport( const Reference< XComponent >& 
rxSrcDoc,
 mxContext   ( xContext ),
 mxStatusIndicator   ( rxStatusIndicator ),
 mxIH( rxIH ),
-mbUseTaggedPDF  ( false ),
-mnPDFTypeSelection  ( 0 ),
-mbPDFUACompliance   ( false),
-mbExportNotes   ( true ),
-mbExportNotesInMargin   ( false ),
-mbExportPlaceholders( false ),
-mbUseReferenceXObject   ( false ),
-mbExportNotesPages  ( false ),
-mbExportOnlyNotesPages  ( false ),
-mbUseTransitionEffects  ( true ),
-mbExportBookmarks   ( true ),
-mbExportHiddenSlides( false ),
-mbSinglePageSheets  ( false ),
-mnOpenBookmarkLevels( -1 ),
 mbUseLosslessCompression( false ),
 mbReduceImageResolution ( true ),
 mbSkipEmptyPages( true ),
-mbAddStream ( false ),
 mnMaxImageResolution( 300 ),
 mnQuality   ( 80 ),
-mnFormsFormat   ( 0 ),
-mbExportFormFields  ( true ),
-mbAllowDuplicateFieldNames  ( false ),
 mnProgressValue ( 0 ),
 mbRemoveTransparencies  ( false ),
 
 mbIsRedactMode  ( false ),
 maWatermarkColor( COL_LIGHTGREEN ),
-maWatermarkFontName ( "Helvetica" ),
-
-mbHideViewerToolbar ( false ),
-mbHideViewerMenubar ( false ),
-mbHideViewerWindowControls  ( false ),
-mbFitWindow ( false ),
-mbCenterWindow  ( false ),
-mbOpenInFullScreenMode  ( false ),
-mbDisplayPDFDocumentTitle   ( true ),
-mnPDFDocumentMode   ( 0 ),
-mnPDFDocumentAction ( 0 ),
-mnZoom  ( 100 ),
-mnInitialPage   ( 1 ),
-mnPDFPageLayout ( 0 ),
-
-mbEncrypt   ( false ),
-mbRestrictPermissions   ( false ),
-mnPrintAllowed  ( 2 ),
-mnChangesAllowed( 4 ),
-mbCanCopyOrExtract  ( true ),
-mbCanExtractForAccessibility( true ),
-
-// #i56629
-mbExportRelativeFsysLinks   ( false ),
-mnDefaultLinkAction ( 0 ),
-mbConvertOOoTargetToPDFTarget( false ),
-mbExportBmkToDest   ( false ),
-mbSignPDF   ( false )
+maWatermarkFontName ( "Helvetica" )
 {
 }
 
@@ -441,6 +396,53 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 
 if( xRenderable.is() )
 {
+// The defaults
+bool bUseTaggedPDF = false;
+sal_Int32 nPDFTypeSelection = 0;
+bool bPDFUACompliance = false;
+bool bExportNotes = true;
+bool bExportNotesInMargin = false;
+bool bExportNotesPages = false;
+bool bExportOnlyNotesPages = false;
+bool bUseTransitionEffects = true;
+bool bExportFormFields = true;
+sal_Int32 nFormsFormat = 0;
+bool bAllowDuplicateFieldNames = false;
+bool bHideViewerToolbar = false;
+bool bHideViewerMenubar = false;
+bool bHideViewerWindowControls = false;
+bool bFitWindow = false;
+bool bCenterWindow = false;
+bool bOpenInFullScreenMode = false;
+bool bDisplayPDFDocumentTitle = true;
+sal_Int32 nPDFDocumentMode = 0;
+sal_Int32 nPDFDocumentAction = 0;
+sal_Int32 nZoom = 100;
+sal_Int32 nInitialPage = 1;
+sal_Int32 nPDFPageLayout = 0;
+bool bAddStream = false;
+bool bEncrypt = false;
+bool bRestrictPermissions = false;
+sal_Int32 nPrintAllowed = 2;
+sal_Int32 nChangesAllowed = 4;
+bool bCanCopyOrExtract = true;
+bool bCanExtractForAccessibility = true;
+// #i56629
+bool bExportRelativeFsysLinks = false;
+sal_Int32 nDefaultLinkAction = 0;

[Libreoffice-commits] core.git: filter/source

2023-10-29 Thread Mike Kaganski (via logerrit)
 filter/source/pdf/pdffilter.cxx |   32 +---
 1 file changed, 13 insertions(+), 19 deletions(-)

New commits:
commit ac296a9b21193ac492da17b7510dff9bdd855aad
Author: Mike Kaganski 
AuthorDate: Sun Oct 29 10:45:04 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Oct 29 10:17:48 2023 +0100

Simplify a bit

Change-Id: Ib9e3cb046ac5b3b6af8308cda02f20c3575d15d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158608
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index d28803aa01c9..dcfc918bbdd0 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -54,31 +54,25 @@ bool PDFFilter::implExport( const Sequence< PropertyValue 
>& rDescriptor )
 Reference< XOutputStream >  xOStm;
 Sequence< PropertyValue >   aFilterData;
 OUString aFilterOptions;
-sal_Int32   nLength = rDescriptor.getLength();
-const PropertyValue*pValue = rDescriptor.getConstArray();
 boolbIsRedactMode = false;
 boolbRet = false;
 Reference< task::XStatusIndicator > xStatusIndicator;
 Reference< task::XInteractionHandler > xIH;
 
-for (sal_Int32 i = 0; i < nLength; ++i)
+for (const auto& rValue : rDescriptor)
 {
-if ( pValue[ i ].Name == "OutputStream" )
-pValue[ i ].Value >>= xOStm;
-else if ( pValue[ i ].Name == "FilterData" )
-pValue[ i ].Value >>= aFilterData;
-else if ( pValue[ i ].Name == "FilterOptions" )
-pValue[ i ].Value >>= aFilterOptions;
-else if ( pValue[ i ].Name == "StatusIndicator" )
-pValue[ i ].Value >>= xStatusIndicator;
-else if ( pValue[i].Name == "InteractionHandler" )
-pValue[i].Value >>= xIH;
-}
-
-for (sal_Int32 i = 0 ; i < nLength; ++i)
-{
-if ( pValue[i].Name == "IsRedactMode")
-pValue[i].Value >>= bIsRedactMode;
+if (rValue.Name == "OutputStream")
+rValue.Value >>= xOStm;
+else if (rValue.Name == "FilterData")
+rValue.Value >>= aFilterData;
+else if (rValue.Name == "FilterOptions")
+rValue.Value >>= aFilterOptions;
+else if (rValue.Name == "StatusIndicator")
+rValue.Value >>= xStatusIndicator;
+else if (rValue.Name == "InteractionHandler")
+rValue.Value >>= xIH;
+else if (rValue.Name == "IsRedactMode")
+rValue.Value >>= bIsRedactMode;
 }
 
 if (!aFilterData.hasElements() && aFilterOptions.startsWith("{"))


[Libreoffice-commits] core.git: filter/source

2023-10-24 Thread Caolán McNamara (via logerrit)
 filter/source/msfilter/msdffimp.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 06425229d89d7283b4070b0885992cd7ad3bf73e
Author: Caolán McNamara 
AuthorDate: Tue Oct 24 09:37:37 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Oct 24 12:53:36 2023 +0200

ofz: Use-of-uninitialized-value

Change-Id: Id7ae178e687edf9550ea1ccef475e326cbe4de2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158376
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 6f2f29665ee0..3fd6e84db310 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -6134,7 +6134,7 @@ void SvxMSDffManager::GetDrawingGroupContainerData( 
SvStream& rSt, sal_uInt32 nL
 void SvxMSDffManager::GetDrawingContainerData( SvStream& rSt, sal_uInt32 
nLenDg,
sal_uInt16 nDrawingContainerId )
 {
-sal_uInt8 nVer;sal_uInt16 nInst;sal_uInt16 nFbt;sal_uInt32 nLength;
+sal_uInt8 nVer;sal_uInt16 nInst;sal_uInt16 nFbt(0);sal_uInt32 nLength(0);
 
 sal_uLong nReadDg = 0;
 


[Libreoffice-commits] core.git: filter/source

2023-10-19 Thread Stephan Bergmann (via logerrit)
 filter/source/msfilter/escherex.cxx  |6 -
 filter/source/msfilter/msdffimp.cxx  |   14 +--
 filter/source/msfilter/msocximex.cxx |2 
 filter/source/msfilter/msvbahelper.cxx   |4 -
 filter/source/pdf/pdfexport.cxx  |4 -
 filter/source/svg/svgexport.cxx  |   28 +++
 filter/source/svg/svgwriter.cxx  |   82 +++
 filter/source/textfilterdetect/filterdetect.cxx  |   16 ++--
 filter/source/xsltdialog/typedetectionexport.cxx |   28 +++
 filter/source/xsltdialog/xmlfilterjar.cxx|2 
 10 files changed, 93 insertions(+), 93 deletions(-)

New commits:
commit 24655ccaeb7d36cf024b31ad5925244ac7016351
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:30:14 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 19 20:53:37 2023 +0200

Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: filter

Change-Id: I1dd21c1dc2a7aed54fa1c03036ad75d2e0eade87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158193
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index 112d468e90db..caf07865941e 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -598,7 +598,7 @@ void EscherPropertyContainer::CreateFillProperties(
 uno::Any aAny;
 AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapNone );
 AddOpt( ESCHER_Prop_AnchorText, ESCHER_AnchorMiddle );
-static constexpr OUStringLiteral aPropName( u"FillStyle" );
+static constexpr OUString aPropName( u"FillStyle"_ustr );
 
 if ( EscherPropertyValueHelper::GetPropertyValue(
 aAny, rXPropSet, aPropName ) )
@@ -2598,10 +2598,10 @@ void 
EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
 
 static constexpr OUStringLiteral sViewBox( u"ViewBox"  );
 static constexpr OUStringLiteral sTextRotateAngle( u"TextRotateAngle"  
);
-static constexpr OUStringLiteral sExtrusion  ( u"Extrusion"  );
+static constexpr OUString sExtrusion  ( u"Extrusion"_ustr  );
 static constexpr OUStringLiteral sEquations  ( u"Equations"  );
 static constexpr OUStringLiteral sPath   ( u"Path"  );
-static constexpr OUStringLiteral sTextPath   ( u"TextPath"  );
+static constexpr OUString sTextPath   ( u"TextPath"_ustr  );
 static constexpr OUStringLiteral sHandles( u"Handles"  );
 static constexpr OUStringLiteral sAdjustmentValues   ( u"AdjustmentValues" 
 );
 
diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 058b61e1253d..6f2f29665ee0 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -171,7 +171,7 @@ using namespace container   ;
 
 // static counter for OLE-Objects
 static sal_uInt32 nMSOleObjCntr = 0;
-constexpr OUStringLiteral MSO_OLE_Obj = u"MSO_OLE_Obj";
+constexpr OUString MSO_OLE_Obj = u"MSO_OLE_Obj"_ustr;
 
 namespace {
 /* Office File Formats - 2.2.23  */
@@ -615,7 +615,7 @@ void SvxMSDffManager::SolveSolver( const 
SvxMSDffSolverContainer& rSolver )
 {
 const SfxPoolItem& aCustomShape =  
static_cast(pO)->GetMergedItem( 
SDRATTR_CUSTOMSHAPE_GEOMETRY );
 SdrCustomShapeGeometryItem aGeometryItem( 
static_cast(aCustomShape) );
-static constexpr OUStringLiteral sPath( 
u"Path" );
+static constexpr OUString sPath( u"Path"_ustr 
);
 sal_Int16 nGluePointType = 
EnhancedCustomShapeGluePointType::SEGMENTS;
 css::uno::Any* pAny = 
aGeometryItem.GetPropertyValueByName( sPath, "GluePointType" );
 if ( pAny )
@@ -737,7 +737,7 @@ void SvxMSDffManager::SolveSolver( const 
SvxMSDffSolverContainer& rSolver )
 sal_Int32 nX = 0, nY = 0;
 if ( ( rPara.First.Value >>= nX ) 
&& ( rPara.Second.Value >>= nY ) )
 {
-static constexpr 
OUStringLiteral sGluePoints( u"GluePoints" );
+static constexpr OUString 
sGluePoints( u"GluePoints"_ustr );
 css::uno::Sequence< 
css::drawing::EnhancedCustomShapeParameterPair > aGluePoints;
 pAny = 
aGeometryItem.GetPropertyValueByName( sPath, sGluePoints );
 if ( pAny )
@@ -2833,7 +2833,7 @@ void DffPropertyReader::CheckAndCorrectExcelTextRotation( 
SvStream& rIn, SfxItem
 
 const css::uno::Any* pAny;
 

[Libreoffice-commits] core.git: filter/source

2023-10-19 Thread Stephan Bergmann (via logerrit)
 filter/source/t602/t602filter.cxx |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit d1d5900ca4d15caf3def78e3af8bb0d3fda98cf7
Author: Stephan Bergmann 
AuthorDate: Wed Oct 18 20:13:18 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 19 10:00:20 2023 +0200

Use OUString instead of OUStringLiteral

Change-Id: I0d49fa6c70c41b39b85f860ad648889be3613295
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158136
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/filter/source/t602/t602filter.cxx 
b/filter/source/t602/t602filter.cxx
index ae1b53f2ad95..d97bc3d5e5de 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -872,7 +872,7 @@ bool T602ImportFilterDialog::OptionsDlg()
 any <<= _val;\
 _prop->setPropertyValue(_nam, any);
 #define propString_(_prop,_nam,_val) \
-any <<= OUString(_val);\
+any <<= _val;\
 _prop->setPropertyValue(_nam, any);
 #define propStringFromResId_(_prop,_nam,_val) \
 any <<= FilterResId(_val);\
@@ -898,13 +898,13 @@ bool T602ImportFilterDialog::OptionsDlg()
 propInt_(xPSetDialog,"Height",90);
 propStringFromResId_(xPSetDialog,"Title", 
T602FILTER_STR_IMPORT_DIALOG_TITLE);
 
-static constexpr OUStringLiteral T602DLG_OK_BUTTON = u"ok_button";
-static constexpr OUStringLiteral T602DLG_CANCEL_BUTTON = u"cancel_button";
-static constexpr OUStringLiteral T602DLG_CODE_LB = u"code_lb";
-static constexpr OUStringLiteral T602DLG_AZBUKA_CB = u"azbuka_cb";
-static constexpr OUStringLiteral T602DLG_COMMENT_CB = u"comment_cb";
-static constexpr OUStringLiteral T602DLG_REFORMAT_CB = u"reformat_cb";
-static constexpr OUStringLiteral T602DLG_CODE_TXT = u"code_txt";
+static constexpr OUString T602DLG_OK_BUTTON = u"ok_button"_ustr;
+static constexpr OUString T602DLG_CANCEL_BUTTON = u"cancel_button"_ustr;
+static constexpr OUString T602DLG_CODE_LB = u"code_lb"_ustr;
+static constexpr OUString T602DLG_AZBUKA_CB = u"azbuka_cb"_ustr;
+static constexpr OUString T602DLG_COMMENT_CB = u"comment_cb"_ustr;
+static constexpr OUString T602DLG_REFORMAT_CB = u"reformat_cb"_ustr;
+static constexpr OUString T602DLG_CODE_TXT = u"code_txt"_ustr;
 
 Reference < XInterface > TextModel = 
Inst_("com.sun.star.awt.UnoControlFixedTextModel");
 Reference < XPropertySet > xPSetText( TextModel, UNO_QUERY );


[Libreoffice-commits] core.git: filter/source include/vcl vcl/qa vcl/source

2023-10-10 Thread Michael Stahl (via logerrit)
 filter/source/pdf/pdfexport.cxx |4 
 include/vcl/pdfextoutdevdata.hxx|2 
 vcl/qa/cppunit/pdfexport/data/transparentshape.fodp |  439 
 vcl/qa/cppunit/pdfexport/pdfexport.cxx  |   16 
 vcl/source/gdi/pdfextoutdevdata.cxx |   14 
 5 files changed, 471 insertions(+), 4 deletions(-)

New commits:
commit c50bca0fc298973bbeda697072528e3dfc887ac5
Author: Michael Stahl 
AuthorDate: Tue Oct 10 12:15:37 2023 +0200
Commit: Michael Stahl 
CommitDate: Tue Oct 10 16:33:11 2023 +0200

tdf#157182 vcl,filter: PDF/A export: fix crash due to SE ID mismatch

The SE IDs in PDFExtOutDevData and PDFWriterImpl are supposed to match.
If PDF/A-1 is exported then RemoveTransparenciesFromMetaFile() is
called and that does unspeakable things to the Metafile and then we just
throw away the PDF related data for the page in
PDFExtOutDevData::ResetSyncData().

This means that then EnsureStructureElement are called on
PDFExtOutDevData but not on PDFWriterImpl, so on the next page the IDs
will no longer match, which is noticed if there is no transparency to be
removed on that page.

pdfextoutdevdata.cxx:347: bool vcl::PageSyncData::PlaySyncPageAct(): 
Assertion `id == -1 || id == mParaInts.front()' failed.

Guess the easiest way to deal with this is to have the premature
ResetSyncData() replay only the EnsureStructureElement actions, which is
only possible because they don't really require any extra data stored in
the ridiculous vectors in PageSyncData; PDFWriterImpl will eventually
remove the elements as they are never initialised.

(regression from commit 07d790ca473cd6e71f0343419b819fa6b485dc01)

Change-Id: I8eb295504067edff00608e28fd86b0c86d547083
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157748
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index bfa67aea1787..940d6145ceb6 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1186,7 +1186,7 @@ void PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, 
vcl::PDFExtOutDevData&
 // Throw them all away in the absence of a way to reposition them to 
new positions of
 // their replacements.
 if (aCtx.m_bTransparenciesWereRemoved)
-rPDFExtOutDevData.ResetSyncData();
+rPDFExtOutDevData.ResetSyncData();
 }
 else
 {
@@ -1202,7 +1202,7 @@ void PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, 
vcl::PDFExtOutDevData&
 
 rWriter.PlayMetafile( aMtf, aCtx,  );
 
-rPDFExtOutDevData.ResetSyncData();
+rPDFExtOutDevData.ResetSyncData(nullptr);
 
 if (!msWatermark.isEmpty())
 {
diff --git a/include/vcl/pdfextoutdevdata.hxx b/include/vcl/pdfextoutdevdata.hxx
index 199f30a00c59..206dfa4adc97 100644
--- a/include/vcl/pdfextoutdevdata.hxx
+++ b/include/vcl/pdfextoutdevdata.hxx
@@ -105,7 +105,7 @@ public:
 virtual ~PDFExtOutDevData() override;
 
 bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, 
const GDIMetaFile& rMtf );
-void ResetSyncData();
+void ResetSyncData(PDFWriter * pWriterIfRemoveTransparencies);
 
 void PlayGlobalActions( PDFWriter& rWriter );
 
diff --git a/vcl/qa/cppunit/pdfexport/data/transparentshape.fodp 
b/vcl/qa/cppunit/pdfexport/data/transparentshape.fodp
new file mode 100644
index ..2fddc3ac0db4
--- /dev/null
+++ b/vcl/qa/cppunit/pdfexport/data/transparentshape.fodp
@@ -0,0 +1,439 @@
+
+http://www.w3.org/TR/css3-text/; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#; 
xmlns:xhtml="http://www.w3.org/1999/xhtml; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xforms="http://www.w3.org/2002/xforms; 
xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooow="http://ope
 noffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink; 
xmlns:drawooo="http://openoffice.org/2010/draw; 
xmlns:oooc="http://openoffice.org/2004/calc; 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 

[Libreoffice-commits] core.git: filter/source officecfg/registry

2023-10-05 Thread Gabor Kelemen (via logerrit)
 filter/source/msfilter/msoleexp.cxx|   37 -
 officecfg/registry/data/org/openoffice/Setup.xcu   |1 
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   14 
 3 files changed, 1 insertion(+), 51 deletions(-)

New commits:
commit f9ac0ced960112af69caeacfffd7ebd200f07221
Author: Gabor Kelemen 
AuthorDate: Mon Oct 2 18:10:13 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Thu Oct 5 14:40:19 2023 +0200

[API CHANGE] tdf#154077 Drop InternalMSExport config group

In the code base it was essentially a no-op key

Change-Id: I2cb3bd1bd75cbeda0497bd46136280b4792ee9a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157497
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/filter/source/msfilter/msoleexp.cxx 
b/filter/source/msfilter/msoleexp.cxx
index cd9f521da605..679082080c3c 100644
--- a/filter/source/msfilter/msoleexp.cxx
+++ b/filter/source/msfilter/msoleexp.cxx
@@ -19,10 +19,6 @@
 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -37,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -83,36 +78,6 @@ static OUString GetStorageType( const SvGlobalName& aEmbName 
)
 return OUString();
 }
 
-static bool UseOldMSExport()
-{
-uno::Reference< lang::XMultiServiceFactory > xProvider(
-configuration::theDefaultProvider::get(
-comphelper::getProcessComponentContext()));
-try {
-uno::Sequence< uno::Any > aArg{ uno::Any(
-OUString( "/org.openoffice.Office.Common/InternalMSExport" )) };
-uno::Reference< container::XNameAccess > xNameAccess(
-xProvider->createInstanceWithArguments(
-"com.sun.star.configuration.ConfigurationUpdateAccess",
-aArg ),
-uno::UNO_QUERY );
-if ( xNameAccess.is() )
-{
-uno::Any aResult = xNameAccess->getByName( "UseOldExport" );
-
-bool bResult;
-if ( aResult >>= bResult )
-return bResult;
-}
-}
-catch( const uno::Exception& )
-{
-}
-
-OSL_FAIL( "Could not get access to configuration entry!" );
-return false;
-}
-
 void SvxMSExportOLEObjects::ExportOLEObject( const css::uno::Reference < 
css::embed::XEmbeddedObject>& rObj, SotStorage& rDestStg )
 {
 svt::EmbeddedObjectRef aObj( rObj, embed::Aspects::MSOLE_CONTENT );
@@ -217,7 +182,7 @@ void SvxMSExportOLEObjects::ExportOLEObject( 
svt::EmbeddedObjectRef const & rObj
 {
 // own format, maybe SO6 format or lower
 SvGlobalName aEmbName = GetEmbeddedVersion( aOwnGlobalName );
-if ( aEmbName != SvGlobalName() && !UseOldMSExport() )
+if ( aEmbName != SvGlobalName() )
 {
 // this is a SO6 embedded object, save in old binary format
 rDestStg.SetVersion( SOFFICE_FILEFORMAT_31 );
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu 
b/officecfg/registry/data/org/openoffice/Setup.xcu
index cb7c13ebe715..a1c90529560b 100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -875,7 +875,6 @@
 /org.openoffice.Office.Common/Help
 /org.openoffice.Office.Common/History
 /org.openoffice.Office.Common/I18N
-/org.openoffice.Office.Common/InternalMSExport
 /org.openoffice.Office.Common/Load
 
/org.openoffice.Office.Common/Misc/DisableUICustomization
 /org.openoffice.Office.Common/Misc/ExperimentalMode
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 6ae673e5b46f..b71a8c23f9e3 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -706,20 +706,6 @@
 15
   
 
-
-  
-Contains internal MSExport settings that are common for all
-apps.
-  
-  
-
-  Specifies if an old (5.0 format) way instead of a new one (6.0
-  OLE embedded document) should be used for export of inplace objects 
in
-  case MS-filters are not used for them.
-
-false
-  
-
 
   
 Contains a description of the persistent password


[Libreoffice-commits] core.git: filter/source

2023-10-05 Thread Heiko Tietze (via logerrit)
 filter/source/pdf/impdialog.cxx |   10 ++
 filter/source/pdf/impdialog.hxx |3 ++-
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 07a06e40400f3713619cb456d62d4bb952e85436
Author: Heiko Tietze 
AuthorDate: Fri Jul 21 11:47:45 2023 +0200
Commit: Heiko Tietze 
CommitDate: Thu Oct 5 13:10:15 2023 +0200

Resolves tdf#156337 - Keep warning label enabled on PDF security tab

Change-Id: Ifea77294825b987e4277e146cc34af120e38c8c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154712
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index a036d432e3c3..c7149b0ca534 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -936,7 +936,7 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, 
TogglePDFVersionOrUniversalAccessibilityHa
 // set the security page status (and its controls as well)
 ImpPDFTabSecurityPage* pSecPage = mpParent ? mpParent->getSecurityPage() : 
nullptr;
 if (pSecPage)
-pSecPage->ImplPDFASecurityControl(!bIsPDFA);
+pSecPage->ImplPDFASecurityControl();
 
 mxCbTaggedPDF->set_sensitive(
 !bIsPDFA && !bIsPDFUA && !IsReadOnlyProperty("UseTaggedPDF"));
@@ -1315,6 +1315,7 @@ 
ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(weld::Container* pPage, weld::Dialo
 , mxCbEnableCopy(m_xBuilder->weld_check_button("enablecopy"))
 , mxCbEnableAccessibility(m_xBuilder->weld_check_button("enablea11y"))
 , mxPasswordTitle(m_xBuilder->weld_label("setpasswordstitle"))
+, mxPermissionTitle(m_xBuilder->weld_label("label2"))
 {
 msStrSetPwd = mxPasswordTitle->get_label();
 mxPbSetPwd->connect_clicked(LINK(this, ImpPDFTabSecurityPage, 
ClickmaPbSetPwdHdl));
@@ -1411,7 +1412,7 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const  
ImpPDFTabDialog* pParent
 ImpPDFTabGeneralPage* pGeneralPage = pParent->getGeneralPage();
 
 if (pGeneralPage)
-ImplPDFASecurityControl(!pGeneralPage->IsPdfaSelected());
+ImplPDFASecurityControl();
 }
 
 IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, weld::Button&, void)
@@ -1479,6 +1480,8 @@ void ImpPDFTabSecurityPage::enablePermissionControls()
 {
 mxCbEnableAccessibility->set_active(true);
 }
+mxPermissionTitle->set_sensitive(!bIsPDFASel);
+mxPbSetPwd->set_sensitive(!bIsPDFASel);
 mxCbEnableAccessibility->set_sensitive(!bIsPDFUASel);
 if (bIsPDFASel)
 {
@@ -1532,9 +1535,8 @@ void ImpPDFTabSecurityPage::enablePermissionControls()
 
 // This tab page is under control of the PDF/A-1a checkbox:
 // TODO: implement a method to do it.
-void ImpPDFTabSecurityPage::ImplPDFASecurityControl( bool bEnableSecurity )
+void ImpPDFTabSecurityPage::ImplPDFASecurityControl()
 {
-m_xContainer->set_sensitive(bEnableSecurity);
 // after enable, check the status of control as if the dialog was 
initialized
 enablePermissionControls();
 }
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 7a8985ebc807..8cbfc0af987f 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -355,6 +355,7 @@ class ImpPDFTabSecurityPage : public SfxTabPage
 std::unique_ptr mxCbEnableCopy;
 std::unique_ptr mxCbEnableAccessibility;
 std::unique_ptr mxPasswordTitle;
+std::unique_ptr mxPermissionTitle;
 
 std::shared_ptr< SfxPasswordDialog > mpPasswordDialog;
 std::shared_ptr< weld::MessageDialog > mpUnsupportedMsgDialog;
@@ -371,7 +372,7 @@ public:
 
 voidGetFilterConfigItem( ImpPDFTabDialog* 
paParent);
 voidSetFilterConfigItem( const ImpPDFTabDialog* 
paParent );
-voidImplPDFASecurityControl( bool bEnableSecurity 
);
+voidImplPDFASecurityControl();
 boolhasPassword() const { return 
mbHaveOwnerPassword || mbHaveUserPassword; }
 };
 


[Libreoffice-commits] core.git: filter/source include/svx xmloff/source

2023-10-04 Thread Bogdan B (via logerrit)
 filter/source/msfilter/escherex.cxx  |2 +-
 include/svx/strings.hrc  |2 +-
 xmloff/source/transform/PropertyActionsOASIS.cxx |2 +-
 xmloff/source/transform/PropertyActionsOOo.cxx   |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7b4bf155b622e985cdc5f90d620d0a797bc48204
Author: Bogdan B 
AuthorDate: Wed Oct 4 17:02:21 2023 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Wed Oct 4 18:42:36 2023 +0200

tdf#145834 Consistency for "Fontwork"

Change-Id: I5f660fac8576d96bf2d2363106be56a4d4fb4f64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157545
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index 19cdd2f3187a..112d468e90db 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -3452,7 +3452,7 @@ void 
EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
 AddOpt(DFF_Prop_gtextAlign,gTextAlign);
 }
 }
-if((nTextPathFlags & 0x4000) != 0)  // Is Font work
+if((nTextPathFlags & 0x4000) != 0)  // Is Fontwork
 {
 OutlinerParaObject* 
pOutlinerParaObject(rSdrObjCustomShape.GetOutlinerParaObject());
 if ( pOutlinerParaObject && 
pOutlinerParaObject->IsEffectivelyVertical() )
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index f17b76c7a3ae..223ee37c2cbe 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -534,7 +534,7 @@
 #define STR_TABLE_STYLE_SETTINGS
NC_("STR_TABLE_STYLE_SETTINGS", "Table style settings")
 #define STR_ObjNameSingulTable  
NC_("STR_ObjNameSingulTable", "Table")
 #define STR_ObjNamePluralTable  
NC_("STR_ObjNamePluralTable", "Tables")
-#define STR_ObjNameSingulFONTWORK   
NC_("STR_ObjNameSingulFONTWORK", "Font work")
+#define STR_ObjNameSingulFONTWORK   
NC_("STR_ObjNameSingulFONTWORK", "Fontwork")
 // Strings for the Draw-Dialog 
 #define RID_SVXSTR_SOLID
NC_("RID_SVXSTR_SOLID", "Continuous")
 #define RID_SVXSTR_GRADIENT 
NC_("RID_SVXSTR_GRADIENT", "Gradient")
diff --git a/xmloff/source/transform/PropertyActionsOASIS.cxx 
b/xmloff/source/transform/PropertyActionsOASIS.cxx
index 8860f3d22fa9..0de00fb5eace 100644
--- a/xmloff/source/transform/PropertyActionsOASIS.cxx
+++ b/xmloff/source/transform/PropertyActionsOASIS.cxx
@@ -150,7 +150,7 @@ XMLTransformerActionInit const 
aGraphicPropertyOASISAttrActionTable[] =
 { XML_NAMESPACE_DRAW, XML_FILL_IMAGE_NAME, 
XML_ATACTION_DECODE_STYLE_NAME_REF,
 XML_FAMILY_TYPE_FILL_IMAGE, 0, 0 },
 
-// Font work properties
+// Fontwork properties
 { XML_NAMESPACE_DRAW, XML_FONTWORK_DISTANCE, XML_ATACTION_IN2INCH, 
NO_PARAMS },
 { XML_NAMESPACE_DRAW, XML_FONTWORK_START, XML_ATACTION_IN2INCH, NO_PARAMS 
},
 { XML_NAMESPACE_DRAW, XML_FONTWORK_SHADOW_OFFSET_X, XML_ATACTION_IN2INCH, 
NO_PARAMS },
diff --git a/xmloff/source/transform/PropertyActionsOOo.cxx 
b/xmloff/source/transform/PropertyActionsOOo.cxx
index cc6fc0e6b6f9..abcd7903737d 100644
--- a/xmloff/source/transform/PropertyActionsOOo.cxx
+++ b/xmloff/source/transform/PropertyActionsOOo.cxx
@@ -350,7 +350,7 @@ XMLTransformerActionInit const 
aGraphicPropertyOOoAttrActionTable[] =
 { XML_NAMESPACE_DRAW, XML_SIZE_PROTECT, XML_ATACTION_SIZE_PROTECT, 
NO_PARAMS },
 { XML_NAMESPACE_DRAW, XML_FIT_TO_CONTOUR, XML_ATACTION_COPY, NO_PARAMS },
 
-// Font work properties
+// Fontwork properties
 { XML_NAMESPACE_DRAW, XML_FONTWORK_STYLE, XML_ATACTION_COPY, NO_PARAMS },
 { XML_NAMESPACE_DRAW, XML_FONTWORK_ADJUST, XML_ATACTION_COPY, NO_PARAMS },
 { XML_NAMESPACE_DRAW, XML_FONTWORK_DISTANCE, XML_ATACTION_INCH2IN, 
NO_PARAMS },


[Libreoffice-commits] core.git: filter/source

2023-10-03 Thread Hannah Meeks (via logerrit)
 filter/source/config/cache/filtercache.cxx |  177 ++---
 1 file changed, 41 insertions(+), 136 deletions(-)

New commits:
commit 3288065782544e7a2571c808f3ff17487018f762
Author: Hannah Meeks 
AuthorDate: Fri Aug 18 21:41:41 2023 +0100
Commit: Mike Kaganski 
CommitDate: Tue Oct 3 20:54:46 2023 +0200

Simplify long if statements

Change-Id: I379fb5809e5e00788445bcf9cebdcaba563b1af4

Use structured binding, fixup

Change-Id: Ibd52ff1313336aa8a082477dee3ea7fce0f1d3f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157492
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/filter/source/config/cache/filtercache.cxx 
b/filter/source/config/cache/filtercache.cxx
index aa0eff534cb4..534195893744 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -1809,6 +1809,37 @@ void FilterCache::impl_saveItem(const 
css::uno::Reference< css::container::XName
 }
 }
 
+namespace {
+constexpr struct {
+SfxFilterFlags eFlag;
+rtl::OUStringConstExpr aName;
+} flagFilterSwitcher[] = {
+{ SfxFilterFlags::STARONEFILTER, FLAGNAME_3RDPARTYFILTER },
+{ SfxFilterFlags::ALIEN, FLAGNAME_ALIEN },
+{ SfxFilterFlags::CONSULTSERVICE, FLAGNAME_CONSULTSERVICE },
+{ SfxFilterFlags::DEFAULT, FLAGNAME_DEFAULT },
+{ SfxFilterFlags::ENCRYPTION, FLAGNAME_ENCRYPTION },
+{ SfxFilterFlags::EXPORT, FLAGNAME_EXPORT },
+{ SfxFilterFlags::IMPORT, FLAGNAME_IMPORT },
+{ SfxFilterFlags::INTERNAL, FLAGNAME_INTERNAL },
+{ SfxFilterFlags::NOTINFILEDLG, FLAGNAME_NOTINFILEDIALOG },
+{ SfxFilterFlags::MUSTINSTALL, FLAGNAME_NOTINSTALLED },
+{ SfxFilterFlags::OWN, FLAGNAME_OWN },
+{ SfxFilterFlags::PACKED, FLAGNAME_PACKED },
+{ SfxFilterFlags::PASSWORDTOMODIFY, FLAGNAME_PASSWORDTOMODIFY },
+{ SfxFilterFlags::PREFERED, FLAGNAME_PREFERRED },
+{ SfxFilterFlags::STARTPRESENTATION, FLAGNAME_STARTPRESENTATION },
+{ SfxFilterFlags::OPENREADONLY, FLAGNAME_READONLY },
+{ SfxFilterFlags::SUPPORTSSELECTION, FLAGNAME_SUPPORTSSELECTION },
+{ SfxFilterFlags::TEMPLATE, FLAGNAME_TEMPLATE },
+{ SfxFilterFlags::TEMPLATEPATH, FLAGNAME_TEMPLATEPATH },
+{ SfxFilterFlags::COMBINED, FLAGNAME_COMBINED },
+{ SfxFilterFlags::SUPPORTSSIGNING, FLAGNAME_SUPPORTSSIGNING },
+{ SfxFilterFlags::GPGENCRYPTION, FLAGNAME_GPGENCRYPTION },
+{ SfxFilterFlags::EXOTIC, FLAGNAME_EXOTIC },
+};
+}
+
 /*---
 static! => no locks necessary
 ---*/
@@ -1816,29 +1847,11 @@ css::uno::Sequence< OUString > 
FilterCache::impl_convertFlagField2FlagNames(SfxF
 {
 std::vector lFlagNames;
 
-if (nFlags & SfxFilterFlags::STARONEFILTER) 
lFlagNames.emplace_back(FLAGNAME_3RDPARTYFILTER   );
-if (nFlags & SfxFilterFlags::ALIEN) 
lFlagNames.emplace_back(FLAGNAME_ALIEN);
-if (nFlags & SfxFilterFlags::CONSULTSERVICE   ) 
lFlagNames.emplace_back(FLAGNAME_CONSULTSERVICE   );
-if (nFlags & SfxFilterFlags::DEFAULT  ) 
lFlagNames.emplace_back(FLAGNAME_DEFAULT  );
-if (nFlags & SfxFilterFlags::ENCRYPTION   ) 
lFlagNames.emplace_back(FLAGNAME_ENCRYPTION   );
-if (nFlags & SfxFilterFlags::EXPORT   ) 
lFlagNames.emplace_back(FLAGNAME_EXPORT   );
-if (nFlags & SfxFilterFlags::IMPORT   ) 
lFlagNames.emplace_back(FLAGNAME_IMPORT   );
-if (nFlags & SfxFilterFlags::INTERNAL ) 
lFlagNames.emplace_back(FLAGNAME_INTERNAL );
-if (nFlags & SfxFilterFlags::NOTINFILEDLG ) 
lFlagNames.emplace_back(FLAGNAME_NOTINFILEDIALOG  );
-if (nFlags & SfxFilterFlags::MUSTINSTALL  ) 
lFlagNames.emplace_back(FLAGNAME_NOTINSTALLED );
-if (nFlags & SfxFilterFlags::OWN  ) 
lFlagNames.emplace_back(FLAGNAME_OWN  );
-if (nFlags & SfxFilterFlags::PACKED   ) 
lFlagNames.emplace_back(FLAGNAME_PACKED   );
-if (nFlags & SfxFilterFlags::PASSWORDTOMODIFY ) 
lFlagNames.emplace_back(FLAGNAME_PASSWORDTOMODIFY );
-if (nFlags & SfxFilterFlags::PREFERED ) 
lFlagNames.emplace_back(FLAGNAME_PREFERRED);
-if (nFlags & SfxFilterFlags::STARTPRESENTATION) 
lFlagNames.emplace_back(FLAGNAME_STARTPRESENTATION);
-if (nFlags & SfxFilterFlags::OPENREADONLY ) 
lFlagNames.emplace_back(FLAGNAME_READONLY );
-if (nFlags & SfxFilterFlags::SUPPORTSSELECTION) 
lFlagNames.emplace_back(FLAGNAME_SUPPORTSSELECTION);
-if (nFlags & SfxFilterFlags::TEMPLATE ) 
lFlagNames.emplace_back(FLAGNAME_TEMPLATE );
-if (nFlags & SfxFilterFlags::TEMPLATEPATH ) 
lFlagNames.emplace_back(FLAGNAME_TEMPLATEPATH );
-if (nFlags & SfxFilterFlags::COMBINED ) 
lFlagNames.emplace_back(FLAGNAME_COMBINED  

[Libreoffice-commits] core.git: filter/source

2023-09-30 Thread Justin Luth (via logerrit)
 filter/source/pdf/impdialog.cxx |   24 ++--
 1 file changed, 10 insertions(+), 14 deletions(-)

New commits:
commit 1cf500366e8de4c1c89c1f9235629d2efeaa89af
Author: Justin Luth 
AuthorDate: Fri Sep 29 11:10:11 2023 -0400
Commit: Justin Luth 
CommitDate: Sat Sep 30 17:26:51 2023 +0200

NFC pdfexport dialog: cleanup impdialog.cxx

No Functional Change intended

Change-Id: Ie08883af2a6cf3d84f77f550e147f8aba24a152b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157432
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index a444f69891c6..ba412851c393 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -593,13 +593,6 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 mbIsWriter = pParent->mbIsWriter;
 mbIsSpreadsheet = pParent->mbIsSpreadsheet;
 
-mxCbExportNotesInMargin->set_sensitive(
-mbIsWriter && 
!pParent->maConfigItem.IsReadOnly("ExportNotesInMargin"));
-mxCbExportEmptyPages->set_sensitive(
-mbIsWriter && !pParent->maConfigItem.IsReadOnly("IsSkipEmptyPages"));
-mxCbExportPlaceholders->set_sensitive(
-mbIsWriter && !pParent->maConfigItem.IsReadOnly("ExportPlaceholders"));
-
 mxRbLosslessCompression->connect_toggled( LINK( this, 
ImpPDFTabGeneralPage, ToggleCompressionHdl ) );
 const bool bUseLosslessCompression = pParent->mbUseLosslessCompression;
 if ( bUseLosslessCompression )
@@ -678,7 +671,10 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 
 
 mxCbExportNotes->set_active( pParent->mbExportNotes );
-mxCbExportNotesInMargin->set_active( pParent->mbExportNotesInMargin );
+mxCbExportNotesInMargin->set_active(mbIsWriter && 
pParent->mbExportNotesInMargin);
+mxCbExportNotesInMargin->set_sensitive(
+mbIsWriter && 
!pParent->maConfigItem.IsReadOnly("ExportNotesInMargin"));
+
 if (comphelper::LibreOfficeKit::isActive())
 {
 mxCbViewPDF->hide();
@@ -733,14 +729,14 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 mxCbSinglePageSheets->set_active(false);
 }
 
-mxCbExportPlaceholders->set_visible(mbIsWriter);
-if( !mbIsWriter )
-{
-mxCbExportPlaceholders->set_active(false);
-mxCbExportNotesInMargin->set_active(false);
-}
 mxCbExportEmptyPages->set_active(!pParent->mbIsSkipEmptyPages);
+mxCbExportEmptyPages->set_sensitive(
+mbIsWriter && !pParent->maConfigItem.IsReadOnly("IsSkipEmptyPages"));
+
+mxCbExportPlaceholders->set_visible(mbIsWriter);
 mxCbExportPlaceholders->set_active(pParent->mbIsExportPlaceholders);
+mxCbExportPlaceholders->set_sensitive(
+mbIsWriter && !pParent->maConfigItem.IsReadOnly("ExportPlaceholders"));
 
 mxCbAddStream->show();
 mxCbAddStream->set_active(pParent->mbAddStream);


[Libreoffice-commits] core.git: filter/source include/vcl vcl/source

2023-09-30 Thread Justin Luth (via logerrit)
 filter/source/pdf/impdialog.cxx|   79 ++---
 include/vcl/FilterConfigItem.hxx   |2 
 vcl/source/filter/FilterConfigItem.cxx |   14 +
 3 files changed, 80 insertions(+), 15 deletions(-)

New commits:
commit ba07ae10e765cb135097dceefd94346ff43bf472
Author: Justin Luth 
AuthorDate: Fri Sep 29 11:01:28 2023 -0400
Commit: Justin Luth 
CommitDate: Sat Sep 30 11:56:49 2023 +0200

pdf-dialog general-tab: set_sensitive if config not read-only

Disable (gray out) Export as PDF options
that are enforced (unchangeable) in the settings,
similar to how optsave does it for tools - options.

It is possible for an config extension to set oor:finalized="true",
which needs to prevent the user from changing the value.

Noticed during the LibreOffice conference in Bucharest, RO.

mxCbExportBookmarks == Export Outlines

Change-Id: I27f28107d1c1dc5d46fc6e2b8a8a83933e30d6ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157408
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 755f530eee27..a444f69891c6 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -593,9 +593,12 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 mbIsWriter = pParent->mbIsWriter;
 mbIsSpreadsheet = pParent->mbIsSpreadsheet;
 
-mxCbExportNotesInMargin->set_sensitive( mbIsWriter );
-mxCbExportEmptyPages->set_sensitive( mbIsWriter );
-mxCbExportPlaceholders->set_sensitive( mbIsWriter );
+mxCbExportNotesInMargin->set_sensitive(
+mbIsWriter && 
!pParent->maConfigItem.IsReadOnly("ExportNotesInMargin"));
+mxCbExportEmptyPages->set_sensitive(
+mbIsWriter && !pParent->maConfigItem.IsReadOnly("IsSkipEmptyPages"));
+mxCbExportPlaceholders->set_sensitive(
+mbIsWriter && !pParent->maConfigItem.IsReadOnly("ExportPlaceholders"));
 
 mxRbLosslessCompression->connect_toggled( LINK( this, 
ImpPDFTabGeneralPage, ToggleCompressionHdl ) );
 const bool bUseLosslessCompression = pParent->mbUseLosslessCompression;
@@ -603,16 +606,24 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 mxRbLosslessCompression->set_active(true);
 else
 mxRbJPEGCompression->set_active(true);
+const bool bReadOnlyCompression = 
!pParent->maConfigItem.IsReadOnly("UseLosslessCompression");
+mxRbLosslessCompression->set_sensitive(bReadOnlyCompression);
+mxRbJPEGCompression->set_sensitive(bReadOnlyCompression);
 
 mxNfQuality->set_value( pParent->mnQuality, FieldUnit::PERCENT );
-mxQualityFrame->set_sensitive(!bUseLosslessCompression);
+mxQualityFrame->set_sensitive(
+!bUseLosslessCompression && 
!pParent->maConfigItem.IsReadOnly("Quality"));
 
 mxCbReduceImageResolution->connect_toggled(LINK(this, 
ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl));
 const bool  bReduceImageResolution = pParent->mbReduceImageResolution;
 mxCbReduceImageResolution->set_active( bReduceImageResolution );
+mxCbReduceImageResolution->set_sensitive(
+!pParent->maConfigItem.IsReadOnly("ReduceImageResolution"));
 OUString aStrRes = OUString::number( pParent->mnMaxImageResolution ) + " 
DPI";
 mxCoReduceImageResolution->set_entry_text(aStrRes);
-mxCoReduceImageResolution->set_sensitive( bReduceImageResolution );
+mxCoReduceImageResolution->set_sensitive(
+bReduceImageResolution && 
!pParent->maConfigItem.IsReadOnly("MaxImageResolution"));
+
 mxCbWatermark->connect_toggled( LINK( this, ImpPDFTabGeneralPage, 
ToggleWatermarkHdl ) );
 mxFtWatermark->set_sensitive(false );
 mxEdWatermark->set_sensitive( false );
@@ -637,6 +648,7 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 const bool bIsPDFUA = pParent->mbPDFUACompliance;
 mxCbPDFUA->set_active(bIsPDFUA);
 mxCbPDFUA->connect_toggled(LINK(this, ImpPDFTabGeneralPage, 
TogglePDFVersionOrUniversalAccessibilityHandle));
+
mxCbPDFUA->set_sensitive(!pParent->maConfigItem.IsReadOnly("PDFUACompliance"));
 
 // the TogglePDFVersionOrUniversalAccessibilityHandle handler will read or 
write the *UserSelection based
 // on the mxCbPDFA (= bIsPDFA) state, so we have to prepare the correct 
input state.
@@ -644,15 +656,25 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 mxCbTaggedPDF->set_active(pParent->mbUseTaggedPDFUserSelection);
 else
 mbUseTaggedPDFUserSelection = pParent->mbUseTaggedPDFUserSelection;
+
 mxCbExportBookmarks->set_active(pParent->mbExportBookmarksUserSelection);
 TogglePDFVersionOrUniversalAccessibilityHandle(*mxCbPDFA);
 
 mxCbExportFormFields->set_active(pParent->mbExportFormFields);
 mxCbExportFormFields->connect_toggled( LINK( this, 

[Libreoffice-commits] core.git: filter/source

2023-09-14 Thread Adam Seskunas (via logerrit)
 filter/source/msfilter/escherex.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit d039fcd1cc6ce1f746b412f364790614bf972740
Author: Adam Seskunas 
AuthorDate: Thu Sep 14 21:02:14 2023 -0700
Commit: Mike Kaganski 
CommitDate: Fri Sep 15 07:28:13 2023 +0200

Move nUnicode variable to for loop condition statement.

Use nUnicode directly in range based loop condition statement
instead of declaring seperately in loop body.

Change-Id: I07d8fb7a693909e0cf43ae0562547c51d001eb14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156936
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index 923bd84da756..19cdd2f3187a 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -214,9 +214,8 @@ void EscherPropertyContainer::AddOpt(
 std::vector aBuf;
 aBuf.reserve(rString.size() * 2 + 2);
 
-for(const auto& nChar: rString)
+for(const sal_Unicode nUnicode: rString)
 {
-const sal_Unicode nUnicode(nChar);
 aBuf.push_back(static_cast(nUnicode));
 aBuf.push_back(static_cast(nUnicode >> 8));
 }


[Libreoffice-commits] core.git: filter/source

2023-09-14 Thread Adam Seskunas (via logerrit)
 filter/source/msfilter/escherex.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 046cee10e62993238534c68e33d97ed63067b290
Author: Adam Seskunas 
AuthorDate: Thu Sep 7 09:39:11 2023 -0700
Commit: Ilmari Lauhakangas 
CommitDate: Thu Sep 14 16:47:29 2023 +0200

tdf#145538 Change traditional for loop to range based for loop

Change-Id: I6c589c588a363cf09a1e6ae79a48911e23cbcf28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156676
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index c8115a3d3fb4..923bd84da756 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -214,9 +214,9 @@ void EscherPropertyContainer::AddOpt(
 std::vector aBuf;
 aBuf.reserve(rString.size() * 2 + 2);
 
-for(size_t i(0); i < rString.size(); i++)
+for(const auto& nChar: rString)
 {
-const sal_Unicode nUnicode(rString[i]);
+const sal_Unicode nUnicode(nChar);
 aBuf.push_back(static_cast(nUnicode));
 aBuf.push_back(static_cast(nUnicode >> 8));
 }


[Libreoffice-commits] core.git: filter/source

2023-09-09 Thread Noel Grandin (via logerrit)
 filter/source/pdf/pdfdecomposer.cxx |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 2d4f840a950ba64be5ba81ff72b2cb4bdc0f97de
Author: Noel Grandin 
AuthorDate: Sat Sep 9 13:48:10 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Sep 9 15:41:41 2023 +0200

fix XPdfDecomposer

accidentally pushed the test commit:
commit d3e0130b1e5a0beb7995565b6e365aec248eece0
Author: Noel Grandin 
Date:   Fri Sep 8 14:02:13 2023 +0200
XPdfDecomposer does not need to implement XAggreggation

Change-Id: I8d65d69723120648020654ded658d0fa7c62d906
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156769
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/pdf/pdfdecomposer.cxx 
b/filter/source/pdf/pdfdecomposer.cxx
index e13ffbb8e162..998f73dc1160 100644
--- a/filter/source/pdf/pdfdecomposer.cxx
+++ b/filter/source/pdf/pdfdecomposer.cxx
@@ -10,7 +10,7 @@
 #include 
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -32,19 +32,13 @@ using namespace css;
 namespace
 {
 /// Class to convert the PDF data into a XPrimitive2D (containing only a 
bitmap).
-class XPdfDecomposer
-: public ::cppu::WeakAggImplHelper2
+class XPdfDecomposer : public ::cppu::WeakImplHelper
 {
 public:
 explicit XPdfDecomposer(uno::Reference const& 
context);
 XPdfDecomposer(const XPdfDecomposer&) = delete;
 XPdfDecomposer& operator=(const XPdfDecomposer&) = delete;
 
-void SAL_CALL setDelegator(css::uno::Reference 
const&) final
-{
-assert(false);
-}
-
 // XPdfDecomposer
 uno::Sequence> SAL_CALL
 getDecomposition(const uno::Reference& 
xDataContainer,


[Libreoffice-commits] core.git: filter/source

2023-09-08 Thread Noel Grandin (via logerrit)
 filter/source/pdf/pdfdecomposer.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit d3e0130b1e5a0beb7995565b6e365aec248eece0
Author: Noel Grandin 
AuthorDate: Fri Sep 8 14:02:13 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 8 22:15:27 2023 +0200

XPdfDecomposer does not need to implement XAggreggation

Checked on jenkins using 'make check' and

+void SAL_CALL setDelegator(css::uno::Reference 
const &) final { assert(false); }
+

Change-Id: I324e0f8825f8b9e8619b1238624b4288720b08cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156719
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/pdf/pdfdecomposer.cxx 
b/filter/source/pdf/pdfdecomposer.cxx
index c1a02c776262..e13ffbb8e162 100644
--- a/filter/source/pdf/pdfdecomposer.cxx
+++ b/filter/source/pdf/pdfdecomposer.cxx
@@ -40,6 +40,11 @@ public:
 XPdfDecomposer(const XPdfDecomposer&) = delete;
 XPdfDecomposer& operator=(const XPdfDecomposer&) = delete;
 
+void SAL_CALL setDelegator(css::uno::Reference 
const&) final
+{
+assert(false);
+}
+
 // XPdfDecomposer
 uno::Sequence> SAL_CALL
 getDecomposition(const uno::Reference& 
xDataContainer,


[Libreoffice-commits] core.git: filter/source include/svx reportdesign/source sc/inc sc/source sd/source solenv/clang-format svx/Library_svxcore.mk svx/source sw/inc sw/source

2023-09-07 Thread Noel Grandin (via logerrit)
 filter/source/msfilter/eschesdo.cxx  |4 -
 include/svx/fmdpage.hxx  |   58 
 include/svx/unopage.hxx  |   10 ++
 reportdesign/source/core/inc/Section.hxx |3 
 sc/inc/pageuno.hxx   |6 -
 sc/source/ui/unoobj/pageuno.cxx  |4 -
 sd/source/ui/inc/unopage.hxx |5 -
 sd/source/ui/unoidl/unopage.cxx  |  112 +++
 solenv/clang-format/excludelist  |2 
 svx/Library_svxcore.mk   |1 
 svx/source/form/fmdpage.cxx  |   97 --
 svx/source/svdraw/svdpage.cxx|4 -
 svx/source/unodraw/unomod.cxx|7 -
 svx/source/unodraw/unopage.cxx   |   42 +++
 sw/inc/unodraw.hxx   |4 -
 sw/source/core/unocore/unodraw.cxx   |6 -
 16 files changed, 125 insertions(+), 240 deletions(-)

New commits:
commit 46b8c7a83f2cae57966ac55591e6f512ceaa114f
Author: Noel Grandin 
AuthorDate: Thu Sep 7 12:38:51 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 7 18:41:23 2023 +0200

merge SvxFmDrawPage into SvxDrawPage

it adds hardly any functionality.

Change-Id: I82f5c52148222596d52f1fb41d726733ca1cf40d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156654
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/msfilter/eschesdo.cxx 
b/filter/source/msfilter/eschesdo.cxx
index efe6cdfaa495..480b3dfe42f5 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -872,7 +872,7 @@ bool ImplEESdrWriter::ImplInitPage( const SdrPage& rPage )
 Reference xOldDrawPage(mXDrawPage, UNO_QUERY);
 if (xOldDrawPage.is())
 xOldDrawPage->dispose();
-mXDrawPage = pSvxDrawPage = new SvxFmDrawPage( 
const_cast() );
+mXDrawPage = pSvxDrawPage = new SvxDrawPage( 
const_cast() );
 mXShapes = mXDrawPage;
 if ( !mXShapes.is() )
 return false;
diff --git a/include/svx/fmdpage.hxx b/include/svx/fmdpage.hxx
deleted file mode 100644
index e7f3732cad1c..
--- a/include/svx/fmdpage.hxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_SVX_FMDPAGE_HXX
-#define INCLUDED_SVX_FMDPAGE_HXX
-
-#include 
-#include 
-#include 
-
-
-// SvxFmDrawPage
-
-typedef cppu::ImplInheritanceHelper 
SvxFmDrawPage_Base;
-
-class SVXCORE_DLLPUBLIC SvxFmDrawPage : public SvxFmDrawPage_Base
-{
-protected:
-
-// Creating a SdrObject based on a Description. Can be used by derived 
classes to
-// support own css::drawing::Shapes (for example Controls)
-virtual rtl::Reference CreateSdrObject_( const 
css::uno::Reference< css::drawing::XShape > & xShape ) override;
-
-// The following method is called when a SvxShape object should be created.
-// Derived classes can create a derivation or an object aggregating 
SvxShape.
-virtual css::uno::Reference< css::drawing::XShape >  CreateShape( 
SdrObject *pObj ) const override;
-
-public:
-SvxFmDrawPage( SdrPage* pPage );
-virtual ~SvxFmDrawPage() noexcept override;
-
-virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
-
-// XFormsSupplier
-virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL 
getForms() override;
-
-// XFormsSupplier2
-virtual sal_Bool SAL_CALL hasForms() override;
-};
-
-#endif // INCLUDED_SVX_FMDPAGE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/unopage.hxx b/include/svx/unopage.hxx
index fc6860aa9274..82f643e29471 100644
--- a/include/svx/unopage.hxx
+++ b/include/svx/unopage.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -54,7 +55,8 @@ class SVXCORE_DLLPUBLIC SvxDrawPage : protected 
cppu::BaseMutex,
css::drawing::XShapes3,

[Libreoffice-commits] core.git: filter/source include/filter

2023-09-07 Thread Samuel Mehrbrodt (via logerrit)
 filter/source/msfilter/msdffimp.cxx |2 +-
 filter/source/msfilter/svdfppt.cxx  |   31 ++-
 include/filter/msfilter/svdfppt.hxx |3 +--
 3 files changed, 4 insertions(+), 32 deletions(-)

New commits:
commit 76932ec6c45089f3319c4fc211d92d19d92666c3
Author: Samuel Mehrbrodt 
AuthorDate: Thu Sep 7 09:07:55 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Thu Sep 7 13:56:00 2023 +0200

tdf#48083 Handle mso_fillBackground directly when processing the shape

And remove the no longer needed special handling
in SdrPowerPointImport::ImportPage

Follow-up to a43f1ac6c964181cbaa4c889409688197cbf7a2b

Change-Id: I0382d5cf93f9e3dfba2b7822032e3eb3cf668a8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156638
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index bc28e62e2b16..e8164dacd6f0 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1471,7 +1471,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& 
rIn, SfxItemSet& rSet, co
 }
 }
 }
-else if (eXFill == drawing::FillStyle_BITMAP && bUseSlideBackground)
+else if (eXFill == drawing::FillStyle_NONE && bUseSlideBackground)
 {
 rSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
 XFillUseSlideBackgroundItem aFillBgItem(true);
diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index a4442cfb2393..0ef068f94e0c 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1295,13 +1295,6 @@ rtl::Reference SdrEscherImport::ProcessObj( 
SvStream& rSt, DffObjData
 maFidcls[ nSec ].dgid = rPersistEntry.nDrawingDgId; // 
insert the correct drawing id;
 }
 }
-if ( GetPropertyValue( DFF_Prop_fNoFillHitTest, 0 ) & 0x10 )
-{
-if (GetPropertyValue(DFF_Prop_fillType, mso_fillSolid) == 
mso_fillBackground)
-{
-rData.aBackgroundColoredObjects.push_back( pRet );
-}
-}
 }
 return pRet;
 }
@@ -2903,7 +2896,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, 
const PptSlidePersistEntry*
 if ( pObj )
 {
 if ( 
aProcessData.pTableRowProperties )
-pObj = 
CreateTable(pObj.get(), aProcessData.pTableRowProperties.get(), 
aProcessData.rPersistEntry.xSolverContainer.get(), 
aProcessData.aBackgroundColoredObjects);
+pObj = 
CreateTable(pObj.get(), aProcessData.pTableRowProperties.get(), 
aProcessData.rPersistEntry.xSolverContainer.get());
 
 pRet->NbcInsertObject( 
pObj.get() );
 
@@ -2925,23 +2918,6 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, 
const PptSlidePersistEntry*
 break;
 }
 
-// Handle shapes where the fill matches the background
-// fill (mso_fillBackground).
-if (rSlidePersist.ePageKind == PPT_SLIDEPAGE)
-{
-if 
(!aProcessData.aBackgroundColoredObjects.empty())
-{
-for (auto const & pObject : 
aProcessData.aBackgroundColoredObjects)
-{
-SfxItemSet 
aNewSet(*pObject->GetMergedItemSet().GetPool());
-
aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_NONE));
-XFillUseSlideBackgroundItem 
aFillBgItem(true);
-aNewSet.Put(aFillBgItem);
-pObject->SetMergedItemSet(aNewSet);
-}
-}
-}
-
 if ( rSlidePersist.pBObj )
 {
 // #i99386# transfer the attributes from the 
temporary BackgroundObject
@@ -7500,8 +7476,7 @@ static void ApplyCellLineAttributes( const SdrObject* 
pLine, Reference< XTable >
 
 rtl::Reference SdrPowerPointImport::CreateTable(
 SdrObject* pGroup, const sal_uInt32* pTableArry,
-SvxMSDffSolverContainer* pSolverContainer,
-std::vector>& rBackgroundColoredObjects)
+SvxMSDffSolverContainer* pSolverContainer)
 {
 rtl::Reference pRet = pGroup;
 
@@ -7655,8 +7630,6 @@ rtl::Reference 
SdrPowerPointImport::CreateTable(
 {
 SdrObject* pPartObj = aIter.Next();
 removeShapeId(pPartObj);
-   

[Libreoffice-commits] core.git: filter/source sd/qa

2023-09-04 Thread Samuel Mehrbrodt (via logerrit)
 filter/source/msfilter/msdffimp.cxx |   13 -
 filter/source/msfilter/svdfppt.cxx  |   17 +++--
 sd/qa/unit/data/ppt/tdf48083.ppt|binary
 sd/qa/unit/import-tests2.cxx|   16 +++-
 4 files changed, 34 insertions(+), 12 deletions(-)

New commits:
commit a43f1ac6c964181cbaa4c889409688197cbf7a2b
Author: Samuel Mehrbrodt 
AuthorDate: Mon Sep 4 14:54:38 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Sep 4 19:44:29 2023 +0200

tdf#48083 Import mso_fillBackground from ppt

Change-Id: Ic60fbc5fcfd7b38e7dd594690e5cfe784061a3d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156517
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 8d6f9023ad16..bc28e62e2b16 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -74,6 +74,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1338,6 +1339,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& 
rIn, SfxItemSet& rSet, co
 if ( nFillFlags & 0x10 )
 {
 auto eMSO_FillType = GetPropertyValue(DFF_Prop_fillType, 
mso_fillSolid);
+bool bUseSlideBackground = false;
 drawing::FillStyle eXFill = drawing::FillStyle_NONE;
 switch( eMSO_FillType )
 {
@@ -1366,7 +1368,10 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& 
rIn, SfxItemSet& rSet, co
 case mso_fillShadeTitle :   // special type - shade to title 
---  for PP
 eXFill = drawing::FillStyle_GRADIENT;
 break;
-//  case mso_fillBackground :   // Use the background fill 
color/pattern
+case mso_fillBackground :   // Use the background fill 
color/pattern
+eXFill = drawing::FillStyle_NONE;
+bUseSlideBackground = true;
+break;
 default: break;
 }
 rSet.Put( XFillStyleItem( eXFill ) );
@@ -1466,6 +1471,12 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& 
rIn, SfxItemSet& rSet, co
 }
 }
 }
+else if (eXFill == drawing::FillStyle_BITMAP && bUseSlideBackground)
+{
+rSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
+XFillUseSlideBackgroundItem aFillBgItem(true);
+rSet.Put(aFillBgItem);
+}
 }
 else
 rSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index fa4c9c55d7dc..a4442cfb2393 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -53,6 +53,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2930,17 +2931,13 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, 
const PptSlidePersistEntry*
 {
 if 
(!aProcessData.aBackgroundColoredObjects.empty())
 {
-if (!rSlidePersist.pBObj)
+for (auto const & pObject : 
aProcessData.aBackgroundColoredObjects)
 {
-for (auto const & pObject : 
aProcessData.aBackgroundColoredObjects)
-{
-// The shape wants a background, but 
the slide doesn't have
-// one: default to white.
-SfxItemSet 
aNewSet(*pObject->GetMergedItemSet().GetPool());
-
aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_SOLID));
-aNewSet.Put(XFillColorItem(OUString(), 
COL_WHITE));
-pObject->SetMergedItemSet(aNewSet);
-}
+SfxItemSet 
aNewSet(*pObject->GetMergedItemSet().GetPool());
+
aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_NONE));
+XFillUseSlideBackgroundItem 
aFillBgItem(true);
+aNewSet.Put(aFillBgItem);
+pObject->SetMergedItemSet(aNewSet);
 }
 }
 }
diff --git a/sd/qa/unit/data/ppt/tdf48083.ppt b/sd/qa/unit/data/ppt/tdf48083.ppt
new file mode 100644
index ..97ca371d7a55
Binary files /dev/null and b/sd/qa/unit/data/ppt/tdf48083.ppt differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 7702e27d715e..525177ba44da 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -581,7 +581,9 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf105150PPT)
 // This 

[Libreoffice-commits] core.git: filter/source

2023-08-18 Thread Caolán McNamara (via logerrit)
 filter/source/svg/svgwriter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 30febe5fc4ac3117ff5dabcd1fec4acfc7b759d8
Author: Caolán McNamara 
AuthorDate: Wed Aug 16 15:04:58 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 18 18:24:04 2023 +0200

cool#6616 compare graphics for equality with operator==...

instead of checking equal CheckSums.

For better or worse while Bitmap::operator== also considers equal
CheckSums as equal Bitmaps operator== can quickly return true if
both Bitmaps share the same underlying SalBitmap which is nearly
always true in the example here

Change-Id: I6b5cd484aeef7505721a493a3bff23ee345147dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155740
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 4f21f0493b06..62aa05115fbb 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -2916,7 +2916,7 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& 
rBmpEx,
 if (aGraphic.GetType() == GraphicType::Bitmap)
 {
 const BitmapEx& rGraphicBitmap = aGraphic.GetBitmapExRef();
-if (rGraphicBitmap.GetChecksum() == rBmpEx.GetChecksum())
+if (rGraphicBitmap == rBmpEx)
 {
 bool bPNG = false;
 GfxLink aGfxLink = aGraphic.GetGfxLink();


[Libreoffice-commits] core.git: filter/source sw/source

2023-08-07 Thread Khaled Hosny (via logerrit)
 filter/source/pdf/impdialog.cxx   |   13 +++--
 sw/source/core/view/printdata.cxx |3 +--
 2 files changed, 4 insertions(+), 12 deletions(-)

New commits:
commit fed82c416aba3380b8c8931f7d8e0ec359e52a2c
Author: Khaled Hosny 
AuthorDate: Mon Aug 7 12:59:40 2023 +0300
Commit: خالد حسني 
CommitDate: Mon Aug 7 13:38:27 2023 +0200

tdf#139164: Revert "tdf#54908 Make selection active if there's a selection

(Writer)"

This reverts commit 87d5c863109f7991e3f2f3a1eb970c00d5a27bd5.

Making Writer print selection only by default is not something people
expect, and it is not the default in any other application. Judging by
the number of duplicates, it seems to have caught a lot of people by
surprise, which is not a good UX.

Change-Id: Ia7c8928c474d3390d7f7fee6e0c2e504a41d51b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155422
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 3279581eedd5..755f530eee27 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -586,9 +586,8 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 mxRbAll->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleAllHdl ) 
);
 TogglePagesHdl();
 
-const bool bSelectionPresent = pParent->mbSelectionPresent;
-mxRbSelection->set_sensitive( bSelectionPresent );
-if ( bSelectionPresent )
+mxRbSelection->set_sensitive( pParent->mbSelectionPresent );
+if ( pParent->mbSelectionPresent )
 mxRbSelection->connect_toggled( LINK( this, ImpPDFTabGeneralPage, 
ToggleSelectionHdl ) );
 mbIsPresentation = pParent->mbIsPresentation;
 mbIsWriter = pParent->mbIsWriter;
@@ -707,13 +706,7 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 }
 
 mxCbExportPlaceholders->set_visible(mbIsWriter);
-if( mbIsWriter )
-{
-// tdf#54908 Make selection active if there is a selection in Writer's 
version
-mxRbSelection->set_active( bSelectionPresent );
-mxCbExportNotesInMargin->set_active(pParent->mbExportNotesInMargin);
-}
-else
+if( !mbIsWriter )
 {
 mxCbExportPlaceholders->set_active(false);
 mxCbExportNotesInMargin->set_active(false);
diff --git a/sw/source/core/view/printdata.cxx 
b/sw/source/core/view/printdata.cxx
index 62a2780f9c58..7cf3017eeec7 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -284,8 +284,7 @@ SwPrintUIOptions::SwPrintUIOptions(
 uno::Sequence< OUString > aWidgetIds{ "rbAllPages", "rbRangePages", 
"rbRangeSelection" };
 m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, 
OUString(),
 aHelpIds, 
aPrintRangeName,
-aChoices,
-bHasSelection ? 2 : 0,
+aChoices, 0 /* always 
default to 'All pages' */,
 aChoicesDisabled);
 
 // show an Edit dependent on "Pages" selected


[Libreoffice-commits] core.git: filter/source vcl/qa vcl/source

2023-07-04 Thread Michael Stahl (via logerrit)
 filter/source/pdf/pdfexport.cxx|   16 +
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |   90 +
 vcl/source/gdi/pdfwriter_impl.cxx  |4 -
 3 files changed, 108 insertions(+), 2 deletions(-)

New commits:
commit dd4ce9b2fc7feaf288055b24b5bc4842c0d2b4de
Author: Michael Stahl 
AuthorDate: Tue Jul 4 11:32:07 2023 +0200
Commit: Michael Stahl 
CommitDate: Tue Jul 4 14:15:49 2023 +0200

tdf#152235 filter,vcl: PDF/UA export: tag watermark as Artifact

Change-Id: I64e57a832678be935b69a5cea328cc252a4bf29d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153951
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index eb43260d8a83..f9c5fb44af6b 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1262,6 +1262,13 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& 
rWriter, const Size& rPageSi
 pDev->Pop();
 
 rWriter.Push();
+// tdf#152235 tag around the reference to the XObject on the page
+rWriter.BeginStructureElement(vcl::PDFWriter::NonStructElement, 
::std::u16string_view());
+rWriter.SetStructureAttribute(vcl::PDFWriter::Type, 
vcl::PDFWriter::Pagination);
+rWriter.SetStructureAttribute(vcl::PDFWriter::Subtype, 
vcl::PDFWriter::Watermark);
+// HACK: this should produce *nothing* itself but is necessary to output
+// the Artifact tag here, not inside the XObject
+rWriter.DrawPolyLine({});
 rWriter.SetMapMode( MapMode( MapUnit::MapPoint ) );
 rWriter.SetFont( aFont );
 rWriter.SetTextColor(maWatermarkColor);
@@ -1304,6 +1311,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& 
rWriter, const Size& rPageSi
 rWriter.BeginTransparencyGroup();
 rWriter.DrawText( aTextPoint, msWatermark );
 rWriter.EndTransparencyGroup( aTextRect, 50 );
+rWriter.EndStructureElement();
 rWriter.Pop();
 }
 
@@ -1350,6 +1358,13 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& 
rWriter, const Size& rP
 pDev->Pop();
 
 rWriter.Push();
+// tdf#152235 tag around the reference to the XObject on the page
+rWriter.BeginStructureElement(vcl::PDFWriter::NonStructElement, 
::std::u16string_view());
+rWriter.SetStructureAttribute(vcl::PDFWriter::Type, 
vcl::PDFWriter::Pagination);
+rWriter.SetStructureAttribute(vcl::PDFWriter::Subtype, 
vcl::PDFWriter::Watermark);
+// HACK: this should produce *nothing* itself but is necessary to output
+// the Artifact tag here, not inside the XObject
+rWriter.DrawPolyLine({});
 rWriter.SetMapMode( MapMode( MapUnit::MapPoint ) );
 rWriter.SetFont(aFont);
 rWriter.SetTextColor( Color(19,20,22) );
@@ -1385,6 +1400,7 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& 
rWriter, const Size& rP
 aTextPoint.Move( nTextWidth*1.5, 0 );
 }
 
+rWriter.EndStructureElement();
 rWriter.Pop();
 }
 
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 5698288b4c22..34e733c115c3 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -3314,6 +3314,96 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf152231)
 CPPUNIT_ASSERT_EQUAL(static_cast(12), nPara);
 }
 
+CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf152235)
+{
+aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+// Enable PDF/UA
+uno::Sequence 
aFilterData(comphelper::InitPropertySequence(
+{ { "PDFUACompliance", uno::Any(true) },
+  { "Watermark", uno::Any(OUString("kendy")) },
+  // need to set a font to avoid assertions about missing "Helvetica"
+  { "WatermarkFontName", uno::Any(OUString("Liberation Sans")) },
+  { "SelectPdfVersion", uno::Any(sal_Int32(17)) } }));
+aMediaDescriptor["FilterData"] <<= aFilterData;
+mxComponent = loadFromDesktop("private:factory/swriter");
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+xStorable->storeToURL(maTempFile.GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
+
+vcl::filter::PDFDocument aDocument;
+SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
+CPPUNIT_ASSERT(aDocument.Read(aStream));
+
+std::vector aPages = aDocument.GetPages();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), aPages.size());
+
+vcl::filter::PDFObjectElement* pContents = 
aPages[0]->LookupObject("Contents");
+CPPUNIT_ASSERT(pContents);
+vcl::filter::PDFStreamElement* pStream = pContents->GetStream();
+CPPUNIT_ASSERT(pStream);
+SvMemoryStream& rObjectStream = pStream->GetMemory();
+// Uncompress it.
+SvMemoryStream aUncompressed;
+ZCodec aZCodec;
+aZCodec.BeginCompression();
+rObjectStream.Seek(0);
+aZCodec.Decompress(rObjectStream, aUncompressed);
+CPPUNIT_ASSERT(aZCodec.EndCompression());
+
+auto pStart = static_cast(aUncompressed.GetData());
+const 

[Libreoffice-commits] core.git: filter/source vcl/source

2023-06-14 Thread Andrea Gelmini (via logerrit)
 filter/source/svg/svgwriter.cxx |2 +-
 vcl/source/filter/svm/SvmReader.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 667c7ea976fab4691660844560eb2dcc7ecbbd19
Author: Andrea Gelmini 
AuthorDate: Tue Jun 13 20:46:32 2023 +0200
Commit: Julien Nabet 
CommitDate: Wed Jun 14 09:09:36 2023 +0200

Fix typo

Change-Id: I042c738e5d6e037a8c658a02cbfaef8f1d23799e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152999
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index be95c89de895..1826507bead8 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -3400,7 +3400,7 @@ void SVGActionWriter::ImplWriteActions( const 
GDIMetaFile& rMtf,
 const size_t nMaxPossibleEntries = 
aMemStm.remainingSize() / 4 * sizeof(double);
 if (nTmp > nMaxPossibleEntries)
 {
-SAL_WARN("filter.svg", "gradiant record claims to 
have: " << nTmp << " entries, but only " << nMaxPossibleEntries << " possible, 
clamping");
+SAL_WARN("filter.svg", "gradient record claims to 
have: " << nTmp << " entries, but only " << nMaxPossibleEntries << " possible, 
clamping");
 nTmp = nMaxPossibleEntries;
 }
 
diff --git a/vcl/source/filter/svm/SvmReader.cxx 
b/vcl/source/filter/svm/SvmReader.cxx
index 20462b620da5..56f2d933bbe9 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -1347,7 +1347,7 @@ rtl::Reference 
SvmReader::FloatTransparentHandler(ImplMetaReadData*
 const size_t nMaxPossibleEntries = mrStream.remainingSize() / 4 * 
sizeof(double);
 if (nTmp > nMaxPossibleEntries)
 {
-SAL_WARN("vcl.gdi", "gradiant record claims to have: " << nTmp << 
" entries, but only "
+SAL_WARN("vcl.gdi", "gradient record claims to have: " << nTmp << 
" entries, but only "
<< 
nMaxPossibleEntries
<< " 
possible, clamping");
 nTmp = nMaxPossibleEntries;


[Libreoffice-commits] core.git: filter/source vcl/source

2023-06-13 Thread Caolán McNamara (via logerrit)
 filter/source/svg/svgwriter.cxx |9 -
 vcl/source/filter/svm/SvmReader.cxx |   11 ++-
 2 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 0ea5dde060df7ef638fbd1f2efe6aa221033e69c
Author: Caolán McNamara 
AuthorDate: Tue Jun 13 14:45:59 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 13 17:11:24 2023 +0200

cid#1532379 Untrusted loop bound

and

cid#1532378 Untrusted loop bound

Change-Id: I06f9267f02a6f41559d617c1a43671d4a8234350
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152964
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index bb9f39dd8d19..be95c89de895 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -3393,10 +3393,17 @@ void SVGActionWriter::ImplWriteActions( const 
GDIMetaFile& rMtf,
 basegfx::BColorStops aColorStops;
 SvMemoryStream aMemStm(const_cast(pA->GetData()), pA->GetDataSize(), StreamMode::READ);
 VersionCompatRead aCompat(aMemStm);
-sal_uInt16 nTmp;
+sal_uInt16 nTmp(0);
 double fOff, fR, fG, fB;
 aMemStm.ReadUInt16( nTmp );
 
+const size_t nMaxPossibleEntries = 
aMemStm.remainingSize() / 4 * sizeof(double);
+if (nTmp > nMaxPossibleEntries)
+{
+SAL_WARN("filter.svg", "gradiant record claims to 
have: " << nTmp << " entries, but only " << nMaxPossibleEntries << " possible, 
clamping");
+nTmp = nMaxPossibleEntries;
+}
+
 for (sal_uInt16 a(0); a < nTmp; a++)
 {
 aMemStm.ReadDouble(fOff);
diff --git a/vcl/source/filter/svm/SvmReader.cxx 
b/vcl/source/filter/svm/SvmReader.cxx
index 4ec9ec0a3d2e..20462b620da5 100644
--- a/vcl/source/filter/svm/SvmReader.cxx
+++ b/vcl/source/filter/svm/SvmReader.cxx
@@ -1340,10 +1340,19 @@ rtl::Reference 
SvmReader::FloatTransparentHandler(ImplMetaReadData*
 if (aCompat.GetVersion() > 1)
 {
 basegfx::BColorStops aColorStops;
-sal_uInt16 nTmp;
+sal_uInt16 nTmp(0);
 double fOff, fR, fG, fB;
 mrStream.ReadUInt16(nTmp);
 
+const size_t nMaxPossibleEntries = mrStream.remainingSize() / 4 * 
sizeof(double);
+if (nTmp > nMaxPossibleEntries)
+{
+SAL_WARN("vcl.gdi", "gradiant record claims to have: " << nTmp << 
" entries, but only "
+   << 
nMaxPossibleEntries
+   << " 
possible, clamping");
+nTmp = nMaxPossibleEntries;
+}
+
 for (sal_uInt16 a(0); a < nTmp; a++)
 {
 mrStream.ReadDouble(fOff);


[Libreoffice-commits] core.git: filter/source

2023-06-13 Thread Caolán McNamara (via logerrit)
 filter/source/svg/svgexport.cxx |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit bd4d9056cbc40af6b097727d3649ff1e5da09a53
Author: Caolán McNamara 
AuthorDate: Mon Jun 12 20:51:41 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jun 13 10:57:02 2023 +0200

turn off undo while creating SdrGrafObj in svg export filter

otherwise in the SdrGrafObj ctor onGraphicChanged is called
which can put us into the undo stack. presumably as we haven't finished
constructing yet the ref count isn't right

==20597==ERROR: AddressSanitizer: heap-use-after-free
instdir/program/libmergedlo.so
SdrObject::SetTitle(rtl::OUString const&)
libreoffice/svx/source/svdraw/svdobj.cxx:811
instdir/program/libmergedlo.so
SdrGrafObj::onGraphicChanged()
libreoffice/svx/source/svdraw/svdograf.cxx:172
instdir/program/libmergedlo.so
SdrGrafObj
libreoffice/svx/source/svdraw/svdograf.cxx:272
instdir/program/../program/libsvgfilterlo.so

SVGFilter::implExportWriterTextGraphic(com::sun::star::uno::Reference
 const&)
libreoffice/filter/source/svg/svgexport.cxx:863
instdir/program/../program/libsvgfilterlo.so

SVGFilter::filterWriterOrCalc(com::sun::star::uno::Sequence
 const&)
libreoffice/filter/source/svg/svgfilter.cxx:590
instdir/program/../program/libsvgfilterlo.so

SVGFilter::filter(com::sun::star::uno::Sequence
 const&)
libreoffice/filter/source/svg/svgfilter.cxx:135
instdir/program/libmergedlo.so
SfxObjectShell::ExportTo(SfxMedium&)
libreoffice/sfx2/source/doc/objstor.cxx:2494

freed by thread T0 here:
instdir/program/libmergedlo.so
~SdrUndoObj
libreoffice/svx/source/svdraw/svdundo.cxx:203

previously allocated by thread T0 here:
instdir/program/libuno_sal.so.3
rtl_allocateMemory
libreoffice/sal/rtl/alloc_global.cxx:38
instdir/program/../program/libsvgfilterlo.so
cppu::OWeakObject::operator new(unsigned long)
libreoffice/include/cppuhelper/weak.hxx:89
instdir/program/../program/libsvgfilterlo.so

SVGFilter::filterWriterOrCalc(com::sun::star::uno::Sequence
 const&)
libreoffice/filter/source/svg/svgfilter.cxx:590
instdir/program/../program/libsvgfilterlo.so

SVGFilter::filter(com::sun::star::uno::Sequence
 const&)
libreoffice/filter/source/svg/svgfilter.cxx:135
instdir/program/libmergedlo.so
SfxObjectShell::ExportTo(SfxMedium&)
libreoffice/sfx2/source/doc/objstor.cxx:2494

Change-Id: Ife225b4250fda53514110b176f35e5278d23f287
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152935
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index a8afae2c6461..5e63db81b70c 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -860,7 +861,17 @@ bool SVGFilter::implExportWriterTextGraphic( const 
Reference< view::XSelectionSu
 if(pSvxDrawPage == nullptr || pSvxDrawPage->GetSdrPage() == nullptr)
 return false;
 
-rtl::Reference pGraphicObj = new 
SdrGrafObj(pSvxDrawPage->GetSdrPage()->getSdrModelFromSdrPage(), aGraphic, 
tools::Rectangle( aPos, aSize ));
+SdrModel& rModel = pSvxDrawPage->GetSdrPage()->getSdrModelFromSdrPage();
+const bool bUndoEnable = rModel.IsUndoEnabled();
+if (bUndoEnable)
+rModel.EnableUndo(false);
+comphelper::ScopeGuard guard([bUndoEnable, ]() {
+// restore when leaving
+if (bUndoEnable)
+rModel.EnableUndo(false);
+});
+
+rtl::Reference pGraphicObj = new SdrGrafObj(rModel, aGraphic, 
tools::Rectangle( aPos, aSize ));
 uno::Reference< drawing::XShape > xShape = 
GetXShapeForSdrObject(pGraphicObj.get());
 uno::Reference< XPropertySet > xShapePropSet(xShape, uno::UNO_QUERY);
 xShapePropSet->setPropertyValue("Graphic", uno::Any(xGraphic));


[Libreoffice-commits] core.git: filter/source

2023-06-12 Thread Caolán McNamara (via logerrit)
 filter/source/svg/svgexport.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 061d6a280d17d18012a2f53e9870b5b2715bcef0
Author: Caolán McNamara 
AuthorDate: Mon Jun 12 15:25:32 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Jun 12 18:21:33 2023 +0200

Resolves: tdf#155791 export of default impress slide master to svg failed

Change-Id: Ie4ec64fef6d8c2c2844a01d06109ad9022714c11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152902
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 8810c0e51a6a..a8afae2c6461 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -670,7 +670,7 @@ bool SVGFilter::implExportImpressOrDraw( const Reference< 
XOutputStream >& rxOSt
 
 if( rxOStm.is() )
 {
-if( !mSelectedPages.empty() && !mMasterPageTargets.empty() )
+if (!mSelectedPages.empty())
 {
 ::rtl::Reference< ::utl::OStreamWrapper > aTempStmWrapper = new 
::utl::OStreamWrapper( aTempStm );
 Reference< XDocumentHandler > xDocHandler = 
implCreateExportDocumentHandler( aTempStmWrapper );
@@ -1024,7 +1024,7 @@ bool SVGFilter::implExportDocument()
 mpSVGWriter->SetPreviewMode();
 
 // #i124608# export a given object selection, so no MasterPage 
export at all
-if (!mbExportShapeSelection)
+if (!mbExportShapeSelection && !mMasterPageTargets.empty())
 implExportMasterPages( mMasterPageTargets, 0, 
mMasterPageTargets.size() - 1 );
 implExportDrawPages( mSelectedPages, 0, nLastPage );
 


[Libreoffice-commits] core.git: filter/source

2023-06-12 Thread Caolán McNamara (via logerrit)
 filter/source/svg/svgexport.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b1b3c70f1f16f02a83e23d2b0265bc97b0188a11
Author: Caolán McNamara 
AuthorDate: Mon Jun 12 12:10:09 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Jun 12 15:50:07 2023 +0200

cannot export selected fontwork in writer to svg

Background property isn't supported

Change-Id: Ic8c5ff979d16a328fece5b4b2f87c85348606bce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152896
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 3114d80b592a..8810c0e51a6a 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -2329,7 +2329,8 @@ bool SVGFilter::implCreateObjects()
 if( xPropSet.is() )
 {
 Reference< XPropertySet > xBackground;
-xPropSet->getPropertyValue( "Background" ) >>= xBackground;
+if 
(xPropSet->getPropertySetInfo()->hasPropertyByName("Background"))
+xPropSet->getPropertyValue( "Background" ) >>= xBackground;
 if( xBackground.is() )
 {
 drawing::FillStyle aFillStyle;


[Libreoffice-commits] core.git: filter/source include/vcl vcl/inc vcl/qa vcl/source

2023-06-10 Thread Paris Oplopoios (via logerrit)
 filter/source/config/fragments/types/png_Portable_Network_Graphic.xcu |2 
 include/vcl/filter/PngImageReader.hxx |4 
 include/vcl/graphic/GraphicMetadata.hxx   |3 
 vcl/inc/graphic/GraphicFormatDetector.hxx |4 
 vcl/qa/cppunit/GraphicFormatDetectorTest.cxx  |   17 
 vcl/qa/cppunit/data/TypeDetectionExample.apng |binary
 vcl/qa/cppunit/png/PngFilterTest.cxx  |   20 
 vcl/qa/cppunit/png/data/apng_simple.apng  |binary
 vcl/source/filter/GraphicFormatDetector.cxx   |   22 
 vcl/source/filter/graphicfilter.cxx   |7 
 vcl/source/filter/png/PngImageReader.cxx  |  424 
+-
 11 files changed, 475 insertions(+), 28 deletions(-)

New commits:
commit bf944e33569e4a1d6236a54671b7320cdc6ffaf6
Author: Paris Oplopoios 
AuthorDate: Mon Feb 6 14:19:41 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Sat Jun 10 16:10:39 2023 +0200

tdf#104877 Add basic APNG format support

Add basic APNG (animated PNG) format support that can correctly display
simple files with no transparency

Change-Id: Ibfb6e13953a8ba48a535a40b08792b3723b7dc0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140089
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git 
a/filter/source/config/fragments/types/png_Portable_Network_Graphic.xcu 
b/filter/source/config/fragments/types/png_Portable_Network_Graphic.xcu
index 7fe5e2adbfda..0b5be4b19923 100644
--- a/filter/source/config/fragments/types/png_Portable_Network_Graphic.xcu
+++ b/filter/source/config/fragments/types/png_Portable_Network_Graphic.xcu
@@ -18,7 +18,7 @@
 
 com.sun.star.comp.draw.FormatDetector
 
-png
+png apng
 image/png
 false
 PNG - Portable Network 
Graphic
diff --git a/include/vcl/filter/PngImageReader.hxx 
b/include/vcl/filter/PngImageReader.hxx
index 34b8279bc654..01fdc2915e54 100644
--- a/include/vcl/filter/PngImageReader.hxx
+++ b/include/vcl/filter/PngImageReader.hxx
@@ -26,6 +26,7 @@ namespace com::sun::star::task
 class XStatusIndicator;
 }
 
+class Graphic;
 class BitmapEx;
 class SvStream;
 
@@ -42,12 +43,15 @@ public:
 // Returns true if image was successfully read without errors.
 // A usable bitmap may be returned even if there were errors (e.g. 
incomplete image).
 bool read(BitmapEx& rBitmap);
+bool read(Graphic& rGraphic);
 // Returns a bitmap without indicating if there were errors.
 BitmapEx read();
 
 // Returns the contents of the msOG chunk (containing a Gif image), if it 
exists.
 // Does not change position in the stream.
 static BinaryDataContainer getMicrosoftGifChunk(SvStream& rStream);
+
+static bool isAPng(SvStream& rStream);
 };
 
 } // namespace vcl
diff --git a/include/vcl/graphic/GraphicMetadata.hxx 
b/include/vcl/graphic/GraphicMetadata.hxx
index da27fde01514..46c3d12a12a2 100644
--- a/include/vcl/graphic/GraphicMetadata.hxx
+++ b/include/vcl/graphic/GraphicMetadata.hxx
@@ -42,7 +42,8 @@ enum class GraphicFileFormat
 SVG = 0x00f9,
 WMZ = 0x00fa,
 EMZ = 0x00fb,
-SVGZ = 0x00fc
+SVGZ = 0x00fc,
+APNG = 0x00fd
 };
 struct GraphicMetadata
 {
diff --git a/vcl/inc/graphic/GraphicFormatDetector.hxx 
b/vcl/inc/graphic/GraphicFormatDetector.hxx
index 64d1e74de80a..2dfb41b461ba 100644
--- a/vcl/inc/graphic/GraphicFormatDetector.hxx
+++ b/vcl/inc/graphic/GraphicFormatDetector.hxx
@@ -52,6 +52,9 @@ static inline OUString 
getImportFormatShortName(GraphicFileFormat nFormat)
 case GraphicFileFormat::PNG:
 pKeyName = "PNG";
 break;
+case GraphicFileFormat::APNG:
+pKeyName = "APNG";
+break;
 case GraphicFileFormat::XBM:
 pKeyName = "XBM";
 break;
@@ -163,6 +166,7 @@ public:
 bool checkTIF();
 bool checkGIF();
 bool checkPNG();
+bool checkAPNG();
 bool checkJPG();
 bool checkSVM();
 bool checkPCD();
diff --git a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx 
b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx
index 30cd8f9ebe1e..945cb6d1c613 100644
--- a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx
+++ b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx
@@ -39,6 +39,7 @@ class GraphicFormatDetectorTest : public 
test::BootstrapFixtureBase
 void testDetectPCX();
 void testDetectJPG();
 void testDetectPNG();
+void testDetectAPNG();
 void testDetectGIF();
 void testDetectPSD();
 void testDetectTGA();
@@ -63,6 +64,7 @@ class GraphicFormatDetectorTest : public 
test::BootstrapFixtureBase
 CPPUNIT_TEST(testDetectPCX);
 CPPUNIT_TEST(testDetectJPG);
 CPPUNIT_TEST(testDetectPNG);
+CPPUNIT_TEST(testDetectAPNG);
 CPPUNIT_TEST(testDetectGIF);
 

[Libreoffice-commits] core.git: filter/source

2023-06-09 Thread Andrea Gelmini (via logerrit)
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a7b5fe0c813977347a8d10ac5a52862f6150fbc0
Author: Andrea Gelmini 
AuthorDate: Fri Jun 9 21:12:52 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Jun 10 07:13:39 2023 +0200

Fix typo

Change-Id: Iaf94d6e4c771220167a17131b57be68290203b35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152802
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 278b613c766c..a8a4aa0b0347 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -3000,7 +3000,7 @@
 (realized style family 'section' is missing, see 
https://docs.oasis-open.org/office/OpenDocument/v1.3/os/schemas/OpenDocument-v1.3-schema-rng.html#12668
 and wrote an issue to ODF TC: 
https://github.com/oasis-tcs/odf-tc/issues/49
 
-in addition the mapping of styleable ODF elements to their 
@style:family attribute is availabe in structured form (XML) in the ODF Toolkit 
generator project:
+in addition the mapping of styleable ODF elements to their 
@style:family attribute is available in structured form (XML) in the ODF 
Toolkit generator project:

https://github.com/tdf/odftoolkit/blob/master/generator/schema2template/src/test/resources/test-input/odf/generation/odfdom-java/dom/grammar-additions.xml#LL43C52-L43C52r-additions.xml#LL43C52-L43C52
 -->
 


[Libreoffice-commits] core.git: filter/source

2023-06-09 Thread Andrea Gelmini (via logerrit)
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a7481809d7dd9072d965e7fd281b5f2020c09b97
Author: Andrea Gelmini 
AuthorDate: Fri Jun 9 21:13:15 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Jun 10 07:13:11 2023 +0200

Fix typo

Change-Id: I64f539d427a61877a0647b7b4e1a217c5d913cc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152803
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 7b3c7e4d3b17..278b613c766c 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -2853,7 +2853,7 @@
 
 
 
-
+
 
  
 


[Libreoffice-commits] core.git: filter/source

2023-06-09 Thread Caolán McNamara (via logerrit)
 filter/source/pdf/pdfdialog.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e4c611ddc731d6a2ca9c3de61a02d1d4b6eefa9b
Author: Caolán McNamara 
AuthorDate: Fri Jun 9 12:51:22 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jun 9 20:26:48 2023 +0200

pdf export dialog can crash if async mode used

dialogClosed can cause the owner of PDFDialog to drop it during the
callback

==4057599==ERROR: AddressSanitizer: heap-use-after-free on address 
0x6130003cc890 at pc 0x7fecd4abe0f4 bp 0x7ffce7ef2d80 sp 0x7ffce7ef2d78
READ of size 8 at 0x6130003cc890 thread T0
#0 0x7fecd4abe0f3 in std::__shared_ptr::operator bool() const 
/usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/shared_ptr_base.h:1670:16
#1 0x7fecd4abe0f3 in 
svt::OGenericUnoAsyncDialog::destroyAsyncDialog() 
core/include/svtools/genericasyncunodialog.hxx:107:13
#2 0x7fecd4abd362 in 
PDFDialog::runAsync(com::sun::star::uno::Reference
 const&)::$_0::operator()(int) const core/filter/source/pdf/pdfdialog.cxx:95:9

0x6130003cc890 is located 272 bytes inside of 336-byte region 
[0x6130003cc780,0x6130003cc8d0)
freed by thread T0 here:
#0 0x4b7cfa in __interceptor_free 
(core/instdir/program/soffice.bin+0x4b7cfa) (BuildId: 
e1b47bbe1dcc1e4ed692b09b49fe3da8d206f4b1)
#1 0x7fed09f540b2 in 
com::sun::star::uno::Reference::~Reference()
 core/include/com/sun/star/uno/Reference.hxx:114:22
#2 0x7fed09f540b2 in ModelData_Impl::~ModelData_Impl() 
core/sfx2/source/doc/guisaveas.cxx:359:1

previously allocated by thread T0 here:
#0 0x4b7fa2 in malloc (core/instdir/program/soffice.bin+0x4b7fa2) 
(BuildId: e1b47bbe1dcc1e4ed692b09b49fe3da8d206f4b1)
#1 0x7fecd4ab87cf in cppu::OWeakObject::operator new(unsigned long) 
core/include/cppuhelper/weak.hxx:89:18
#2 0x7fecd4ab87cf in filter_PDFDialog_get_implementation 
core/filter/source/pdf/pdfdialog.cxx:170:26
...
#9 0x7fed09f811a4 in 
SfxStoringHelper::GUIStoreModel(com::sun::star::uno::Reference
 const&, std::basic_string_view>, 
com::sun::star::uno::Sequence&, bool, 
SignatureState, bool) core/sfx2/source/doc/guisaveas.cxx:1561:29

Change-Id: I7ea28b9b4bb7c826f1c3c8ced7ea8217573f733b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152793
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx
index c036fc747b2a..c7dd241c2049 100644
--- a/filter/source/pdf/pdfdialog.cxx
+++ b/filter/source/pdf/pdfdialog.cxx
@@ -79,6 +79,7 @@ void PDFDialog::executedDialog( sal_Int16 nExecutionResult )
 void PDFDialog::runAsync(const css::uno::Reference< 
css::ui::dialogs::XDialogClosedListener >& xListener)
 {
 SfxTabDialogController::runAsync(m_xAsyncDialog, [this, 
xListener](sal_Int32 nResponse) {
+rtl::Reference xThis(this); // keep alive for scope, 
dialogClosed can cause owner to drop this
 executedAsyncDialog( m_xAsyncDialog, nResponse );
 css::ui::dialogs::DialogClosedEvent aEvent;
 aEvent.DialogResult = nResponse;


[Libreoffice-commits] core.git: filter/source sc/CppunitTest_sc_html_export_test.mk sc/qa sw/qa

2023-06-09 Thread Svante Schubert (via logerrit)
 filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl |5 
 filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl |   25 
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl  |  345 
+-
 filter/source/xslt/odf2xhtml/export/xhtml/header.xsl|7 
 filter/source/xslt/odf2xhtml/export/xhtml/table.xsl |6 
 sc/CppunitTest_sc_html_export_test.mk   |5 
 sc/qa/extras/htmlexporttest.cxx |   18 
 sc/qa/extras/testdocuments/default-styles.ods   |binary
 sw/qa/extras/htmlexport/xhtmlexport.cxx |   23 
 9 files changed, 394 insertions(+), 40 deletions(-)

New commits:
commit 2d9f739ccfead38cdaa13780f7bb5172553dbd77
Author: Svante Schubert 
AuthorDate: Wed May 17 17:44:39 2023 +0200
Commit: Michael Stahl 
CommitDate: Fri Jun 9 15:12:40 2023 +0200

tdf#155244 filter: XHTML export: Making ODF style IDs unique for ...

... HTML/CSS by adding a prefix (the @style:family with '-' as glue 
character)
to their style name.

Disabled debug output for style:family-name in XSL

add text:a to text family

... and add a unit test.

Change-Id: Ie846f5ea2a872872f38036aff59d29c8f530ed32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152749
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl 
b/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl
index 2d6cd7285037..60b47be753ca 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl
@@ -196,7 +196,10 @@
 
 
 
-
+
+
+
+
 
 
 
diff --git a/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl 
b/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
index 7a04bee074a8..0f36b36486de 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
@@ -93,7 +93,10 @@
 
 
 
-
+
+
+
+
 
 
 
@@ -317,7 +320,10 @@ Scenarios unmatched:
 
 
 
-
+
+
+
+
 
 
 
@@ -341,7 +347,10 @@ Scenarios unmatched:
 
 
 
-
+
+
+
+
 
 
 
@@ -358,7 +367,10 @@ Scenarios unmatched:
 
 
 
-
+
+
+
+
 
 
 
@@ -382,7 +394,10 @@ Scenarios unmatched:
 
 
 
-
+
+
+
+
 
 
 
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 9706c1df0615..7b3c7e4d3b17 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -19,7 +19,7 @@
 
-http://www.w3.org/1999/XSL/Transform; 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:dom="http://www.w3.org/2001/xml-events; 

[Libreoffice-commits] core.git: filter/source

2023-06-08 Thread Franklin Weng (via logerrit)
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7f5e2fc7c1ae7c0c2bec76809e11365b255601d5
Author: Franklin Weng 
AuthorDate: Wed May 10 14:18:45 2023 +0800
Commit: Michael Stahl 
CommitDate: Thu Jun 8 17:27:33 2023 +0200

tdf#155182 : fix test of $minLabelWidth which is always true

Change-Id: I74e6e101ba16de1100e71ed950116bceb6862829
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151601
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index da397ac9c24d..9706c1df0615 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -2025,7 +2025,7 @@
 
 
 
-
+
 
 
 


[Libreoffice-commits] core.git: filter/source

2023-06-07 Thread Caolán McNamara (via logerrit)
 filter/source/msfilter/svdfppt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4fff25fc2e5335036bd21b9b3739837f31887351
Author: Caolán McNamara 
AuthorDate: Wed Jun 7 14:54:40 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jun 7 16:45:56 2023 +0200

ofz: Use-of-uninitialized-value

Change-Id: I880d86faf3c42480a505b452a15da0701ac7e964
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152704
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index 6b41f04cfc16..400b9716127f 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -482,7 +482,7 @@ void PptOEPlaceholderAtom::Clear()
 SvStream& ReadPptOEPlaceholderAtom( SvStream& rIn, PptOEPlaceholderAtom& rAtom 
)
 {
 rIn.ReadUInt32( rAtom.nPlacementId );
-sal_uInt8 nTmp;
+sal_uInt8 nTmp(0);
 rIn.ReadUChar(nTmp);
 rAtom.nPlaceholderId = static_cast(nTmp);
 rIn.ReadUChar( rAtom.nPlaceholderSize );


[Libreoffice-commits] core.git: filter/source

2023-05-24 Thread Andrea Gelmini (via logerrit)
 filter/source/pdf/pdfexport.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 01c12264f1f6ec3b78cab0c6acb04a55b1a52903
Author: Andrea Gelmini 
AuthorDate: Wed May 24 14:01:02 2023 +0200
Commit: Julien Nabet 
CommitDate: Wed May 24 20:37:57 2023 +0200

Fix typo

Change-Id: I9478777b375b69794a3ae61ee35842ca94b6ba1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152202
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 54dd54f7590e..a29ff1afb777 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -883,7 +883,7 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 aContext.BaseURL = xModel->getURL();
 // relative link option is private to PDF Export filter and 
limited to local filesystem only
 aContext.RelFsys = mbExportRelativeFsysLinks;
-// determine the default acton for PDF links
+// determine the default action for PDF links
 switch( mnDefaultLinkAction )
 {
 default:


[Libreoffice-commits] core.git: filter/source

2023-05-17 Thread Xisco Fauli (via logerrit)
 filter/source/msfilter/svdfppt.cxx |   14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit d92a89afbdff4faddc869fde88bb6b52d300ea60
Author: Xisco Fauli 
AuthorDate: Tue May 16 13:08:45 2023 +0200
Commit: Xisco Fauli 
CommitDate: Wed May 17 12:32:06 2023 +0200

tdf#154118: ppt: use SetTextLeft instead of SetLeft

and for that, call SetTextFirstLineOffsetValue first
Also simplify the code a bit

Regression from a0875d09d9eeb368e9e319f3f2f29ec3be71b56c
"editeng: remove SvxLRSpaceItem::nTxtLeft"

Change-Id: If45ded4602f2c9acc885439940db9741d16a5534
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151827
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
Reviewed-by: Xisco Fauli 

diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index b6dc298d44b4..6b41f04cfc16 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -6211,22 +6211,16 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet,  
std::optional< sal_Int16 >& rS
 GetAttrib(PPT_ParaAttr_BulletOn, nIsBullet2, nDestinationInstance);
 GetAttrib(PPT_ParaAttr_TextOfs, _nTextOfs, nDestinationInstance);
 GetAttrib(PPT_ParaAttr_BulletOfs, _nBulletOfs, nDestinationInstance);
+SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
 if ( !nIsBullet2 )
 {
-SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
 auto const nAbsLSpace = convertMasterUnitToMm100(_nTextOfs);
 auto const nFirstLineOffset = nAbsLSpace - 
convertMasterUnitToMm100(_nBulletOfs);
-aLRSpaceItem.SetLeft( nAbsLSpace );
 aLRSpaceItem.SetTextFirstLineOffsetValue( -nFirstLineOffset );
-rSet.Put( aLRSpaceItem );
-}
-else
-{
-SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
-aLRSpaceItem.SetLeft( 0 );
-aLRSpaceItem.SetTextFirstLineOffsetValue( 0 );
-rSet.Put( aLRSpaceItem );
+aLRSpaceItem.SetTextLeft( nAbsLSpace );
 }
+rSet.Put( aLRSpaceItem );
+
 if ( GetAttrib( PPT_ParaAttr_Adjust, nVal, nDestinationInstance ) )
 {
 if ( nVal <= 3 )


[Libreoffice-commits] core.git: filter/source

2023-05-08 Thread Andrea Gelmini (via logerrit)
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 678858db53258a0e03497ca167556a2bfea50958
Author: Andrea Gelmini 
AuthorDate: Mon May 8 14:20:03 2023 +0200
Commit: Julien Nabet 
CommitDate: Mon May 8 17:56:27 2023 +0200

Fix typo

Change-Id: Ie6383936bd199646b7b76937c6a2d5a1066536d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151508
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index de1e9750aa43..da397ac9c24d 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -1087,7 +1087,7 @@
  padding:0; 
 
 
-
+
 
 
 


[Libreoffice-commits] core.git: filter/source

2023-05-08 Thread Svante Schubert (via logerrit)
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl |   20 +++-
 1 file changed, 3 insertions(+), 17 deletions(-)

New commits:
commit 603934447c19033acc5590c37efffe208b65bbd8
Author: Svante Schubert 
AuthorDate: Fri May 5 14:05:54 2023 +0200
Commit: Michael Stahl 
CommitDate: Mon May 8 09:43:11 2023 +0200

XHTML export: Removing former 'ugly' - now redundant- fix added by

tdf146264 as now made redundant by prior changes

Change-Id: I6747e33d1ffd4812d8881e10cda2300e7d79e1b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151468
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 59636c5835f7..de1e9750aa43 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -367,7 +367,6 @@
 
 
 
-
 
 
 
@@ -702,7 +701,6 @@
 
 
 
-
 
 
@@ -825,7 +823,6 @@
 
 
 
-
 
 
 
@@ -835,7 +832,6 @@
 
 
 
-
 
 
 
@@ -855,14 +851,9 @@
 
 cm;
 
-
-
-
-
-
-
+
+
+
 
 
 
@@ -933,13 +924,11 @@
 
 
 
-
 
 
 
 
 
-
 
 
 
@@ -983,7 +972,6 @@
 
 
 
-
 
 
 
@@ -1063,7 +1051,6 @@
 
 
 
-
 
 
 
@@ -2603,7 +2590,6 @@
 
 
 
-
 
 
 


[Libreoffice-commits] core.git: filter/source sd/qa sw/qa

2023-05-08 Thread Svante Schubert (via logerrit)
 filter/source/xslt/odf2xhtml/export/common/body.xsl |2 
 filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl |2 
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl  |  118 
++
 sd/qa/unit/HtmlExportTest.cxx   |   24 
++
 sd/qa/unit/data/tdf154989.odg   |binary
 sw/qa/extras/htmlexport/xhtmlexport.cxx |   10 
 6 files changed, 104 insertions(+), 52 deletions(-)

New commits:
commit e857b12dada1468cb3bdb49ed5ea636df0b6d153
Author: Svante Schubert 
AuthorDate: Fri May 5 12:26:53 2023 +0200
Commit: Michael Stahl 
CommitDate: Mon May 8 09:42:22 2023 +0200

tdf#154989 filter: XHTML export: avoid duplicated frames

Various updates on XSLT ODF2HTML triggered by TDF issue 154989 - esp. 
image/frame positioning by CSS position

(regression from commit f680b6d74209fd78c547201b2f14c6547e55c81b)

Change-Id: I4d08a67ebca7ae3808db07c828488bb9284623a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151094
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/xslt/odf2xhtml/export/common/body.xsl 
b/filter/source/xslt/odf2xhtml/export/common/body.xsl
index bcad3abd9ab3..8dfb78222186 100644
--- a/filter/source/xslt/odf2xhtml/export/common/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/body.xsl
@@ -81,7 +81,7 @@
 
 
 
-
+
 
 
 
diff --git 
a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl 
b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
index c81cc9a1e0be..06e22d7e2fed 100644
--- a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
@@ -23,7 +23,7 @@
 
 
 
-
+
 background-color:
 
 ; 
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index fca8d9a763b7..6ad03e260d8c 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -141,15 +141,21 @@
 
 
 
+
 
 
 
 
-
+
 
 
 max-width:
-
+
+;
+
+
+max-height:
+
 ;
 
 
@@ -253,20 +259,20 @@
 
 
 
-
-
-
-
+
+
+
+
 
-
+
 
-
+
 
 
-
-
-
 
+
+
+
 
 
 
@@ -361,11 +367,12 @@
 
 
 
+
 
 
 
 
-
+
 
 
@@ -421,7 +428,7 @@
  is an unbreakable whitespace to give content to the 
element and force a browser not to ignore the element -->
 
 
-
+  
  
 
-
+
 
 
 
@@ -695,6 +702,7 @@
 
 
 
+
 
 
@@ -704,7 +712,10 @@
 p
 
 
-
+
+Next 'div' was a 'text:p'.
+
+
 
 
 
 
 
@@ -814,17 +825,17 @@
 
 
 
-
+
 
 
 
-
 
 
 
 
 
 
+
 
 
 
@@ -847,7 +858,7 @@
 
-
+
 
 
 
@@ -922,13 +933,13 @@
 
 
 
-
+
 
 
 
 
 
-
+
 
 
 
@@ -972,7 +983,7 @@
 
 
 
-
+
 
 
 
@@ -1052,15 +1063,8 @@
 
 
 
+
 
-

[Libreoffice-commits] core.git: filter/source

2023-05-08 Thread Michael Stahl (via logerrit)
 filter/source/xslt/odf2xhtml/export/xhtml/header.xsl |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit ab85fd73a52256da6feb4fabd1b188f4f0fb7ce4
Author: Michael Stahl 
AuthorDate: Wed May 3 16:00:17 2023 +0200
Commit: Michael Stahl 
CommitDate: Mon May 8 09:41:59 2023 +0200

tdf#153839 XHTML export: do not add newlines to attribute values

(regression from commit d2e8705c9cc503afdaed366b1f71ed012b0c568f)

Change-Id: I5e841b1db195b0646c5a2244061f93b97344c3dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151465
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
index 581b8b8d3421..8ee38796ebdf 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
@@ -267,7 +267,6 @@
  
  en-US
  
- 
 
 
 
@@ -277,7 +276,6 @@
  
  
  
- 
 
 
 
@@ -287,7 +285,6 @@
 , 
 
 
-
 
 
 


[Libreoffice-commits] core.git: filter/source

2023-05-08 Thread Michael Stahl (via logerrit)
 filter/source/xslt/odf2xhtml/export/common/table/table.xsl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 63ac36893ad7f3b1c73cb46667fbfd5384a747dc
Author: Michael Stahl 
AuthorDate: Wed May 3 15:02:30 2023 +0200
Commit: Michael Stahl 
CommitDate: Mon May 8 09:40:31 2023 +0200

tdf#153839 XHTML export: fix syntax error in table.xsl

Static error at xsl:param on line 67 column 40 of table.xsl:
  XTSE0010: xsl:param must not be preceded by other instructions

(regression from commit ce4272c25426f0084e53735e80870b9339239078)

Change-Id: I5bed9a8ad81edc5ec016618cb9fd5d75209a2809
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151464
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/filter/source/xslt/odf2xhtml/export/common/table/table.xsl 
b/filter/source/xslt/odf2xhtml/export/common/table/table.xsl
index d55948cab5b9..1e9baa5703f2 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table/table.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table/table.xsl
@@ -63,9 +63,9 @@
 
 
 
-
 
 
+
 
 
 


[Libreoffice-commits] core.git: filter/source framework/source sfx2/source svtools/source sw/source unotools/source vcl/source

2023-04-28 Thread Caolán McNamara (via logerrit)
 filter/source/pdf/pdfexport.cxx |   22 +--
 framework/source/fwe/helper/titlehelper.cxx |   13 +
 framework/source/services/modulemanager.cxx |   21 +--
 sfx2/source/appl/workwin.cxx|4 ++
 sfx2/source/view/classificationhelper.cxx   |3 ++
 svtools/source/config/optionsdrawinglayer.cxx   |   13 +
 sw/source/core/bastyp/SwSmartTagMgr.cxx |5 ++-
 sw/source/core/layout/paintfrm.cxx  |3 +-
 sw/source/core/txtnode/OnlineAccessibilityCheck.cxx |3 +-
 sw/source/core/view/printdata.cxx   |3 +-
 sw/source/uibase/uiview/view.cxx|   28 +---
 sw/source/uibase/uno/unotxdoc.cxx   |3 +-
 unotools/source/config/securityoptions.cxx  |6 ++--
 vcl/source/gdi/pdfwriter_impl.cxx   |7 ++---
 vcl/source/window/settings.cxx  |   22 +--
 15 files changed, 99 insertions(+), 57 deletions(-)

New commits:
commit 2b7773ebb8e8e1662adc4f90ae90f4f746254169
Author: Caolán McNamara 
AuthorDate: Fri Apr 28 14:57:53 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 28 21:23:25 2023 +0200

survive exporting to pdf without config for fuzzing

Change-Id: I229f25a8a15b21257756ecfa008b9e99681003c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151172
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 3edcd1976c4f..54dd54f7590e 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -479,15 +479,19 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 aContext.DocumentInfo.Keywords = 
::comphelper::string::convertCommaSeparated(xDocumentProps->getKeywords());
 }
 }
-// getting the string for the producer
-OUString aProducerOverride = 
officecfg::Office::Common::Save::Document::GeneratorOverride::get();
-if( !aProducerOverride.isEmpty())
-aContext.DocumentInfo.Producer = aProducerOverride;
-else
-aContext.DocumentInfo.Producer =
-utl::ConfigManager::getProductName() +
-" " +
-utl::ConfigManager::getProductVersion();
+
+if (!utl::ConfigManager::IsFuzzing())
+{
+// getting the string for the producer
+OUString aProducerOverride = 
officecfg::Office::Common::Save::Document::GeneratorOverride::get();
+if (!aProducerOverride.isEmpty())
+aContext.DocumentInfo.Producer = aProducerOverride;
+else
+aContext.DocumentInfo.Producer =
+utl::ConfigManager::getProductName() +
+" " +
+utl::ConfigManager::getProductVersion();
+}
 
 aContext.DocumentInfo.Creator = aCreator;
 
diff --git a/framework/source/fwe/helper/titlehelper.cxx 
b/framework/source/fwe/helper/titlehelper.cxx
index e0983d9e5549..be779736e0f7 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -496,11 +496,14 @@ void TitleHelper::impl_updateTitleForFrame (const 
css::uno::Reference< css::fram
 
 impl_appendComponentTitle   (sTitle, xComponent);
 #ifndef MACOSX
-// fdo#70376: We want the window title to contain just the
-// document name (from the above "component title").
-impl_appendProductName  (sTitle);
-impl_appendModuleName   (sTitle);
-impl_appendDebugVersion (sTitle);
+if (!utl::ConfigManager::IsFuzzing())
+{
+// fdo#70376: We want the window title to contain just the
+// document name (from the above "component title").
+impl_appendProductName  (sTitle);
+impl_appendModuleName   (sTitle);
+impl_appendDebugVersion (sTitle);
+}
 #endif
 impl_appendSafeMode (sTitle);
 
diff --git a/framework/source/services/modulemanager.cxx 
b/framework/source/services/modulemanager.cxx
index 475084c4cd5c..ce48cfd44123 100644
--- a/framework/source/services/modulemanager.cxx
+++ b/framework/source/services/modulemanager.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 namespace {
@@ -127,10 +128,13 @@ private:
 ModuleManager::ModuleManager(css::uno::Reference< css::uno::XComponentContext 
>  xContext)
 : m_xContext(std::move(xContext))
 {
-m_xCFG.set( comphelper::ConfigurationHelper::openConfig(
-m_xContext, "/org.openoffice.Setup/Office/Factories",
-comphelper::EConfigurationModes::ReadOnly ),
-css::uno::UNO_QUERY_THROW );
+if (!utl::ConfigManager::IsFuzzing())
+{
+   

[Libreoffice-commits] core.git: filter/source

2023-04-21 Thread Franklin Weng (via logerrit)
 filter/source/xslt/odf2xhtml/export/common/table/table.xsl |4 ++
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl |   19 ++---
 2 files changed, 20 insertions(+), 3 deletions(-)

New commits:
commit ce4272c25426f0084e53735e80870b9339239078
Author: Franklin Weng 
AuthorDate: Wed Mar 22 12:33:38 2023 +0800
Commit: Ilmari Lauhakangas 
CommitDate: Fri Apr 21 11:35:16 2023 +0200

tdf#153839 : Further handling for adding newlines

before and after some tags as described in comment 7

Change-Id: I6e2a6559a888d259c6d1cc848fad7d39a1ab653b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149280
Reviewed-by: Stéphane Guillou 
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/filter/source/xslt/odf2xhtml/export/common/table/table.xsl 
b/filter/source/xslt/odf2xhtml/export/common/table/table.xsl
index cfc1ebbc525b..d55948cab5b9 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table/table.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table/table.xsl
@@ -63,6 +63,7 @@
 
 
 
+
 
 
 
@@ -71,6 +72,7 @@
 
 
 
+
 
 
 
@@ -110,10 +112,12 @@
 
 
 
+
 
 
 
 
+
 
 
 
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index ca7a6906b82c..fca8d9a763b7 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -248,7 +248,9 @@
 
 
 
+
 Next 'div' was a 'draw:text-box'.
+
 
 
 
@@ -372,10 +374,14 @@
 
 
 
+
 Next 'div' was a 'text:p'.
+
 
 
+
 Next 'div' was a 
'draw:page'.
+
 
 
 
@@ -829,7 +835,9 @@
 
+
 Next 'div' added for 
floating.
+
 
 
 display:inline; position:relative; 
left:
@@ -1020,7 +1028,9 @@
 
 
 
+
 Next 'div' is emulating the top height of a 
draw:frame.
+
 

[Libreoffice-commits] core.git: filter/source

2023-04-14 Thread Stephan Bergmann (via logerrit)
 filter/source/config/cache/filtercache.hxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit b1c88800c2e3e6a509ba08050c7e65ce7d0e693a
Author: Stephan Bergmann 
AuthorDate: Fri Apr 14 08:34:40 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 14 13:31:25 2023 +0200

NamedValue needs to be a complete type here now

...at least with VS 2022 Preview 17.6.0 Preview 3.0 and --with-latest-c++,

> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1436~1.323\Include\span(78): 
error C2036: 'const com::sun::star::beans::NamedValue *': unknown size
> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1436~1.323\Include\span(73): 
note: while compiling class template member function 'std::_Span_iterator<_Ty> 
::_Span_iterator<_Ty>::operator --(void) noexcept'
> with
> [
> _Ty=const com::sun::star::beans::NamedValue
> ]
> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1436~1.323\Include\xutility(1414):
 note: see the first reference to 'std::_Span_iterator<_Ty>::operator --' in 
'std::iter_move'
> with
> [
> _Ty=const com::sun::star::beans::NamedValue
> ]
> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1436~1.323\Include\xutility(474):
 note: see the first reference to 'std::iter_move' in 
'std::ranges::_Iter_move::_Cpo::operator ()'
> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1436~1.323\Include\__msvc_iter_core.hpp(392):
 note: see reference to class template instantiation 'std::_Span_iterator<_Ty>' 
being compiled
> with
> [
> _Ty=const com::sun::star::beans::NamedValue
> ]
> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1436~1.323\Include\xutility(602):
 note: see reference to variable template 'bool 
input_or_output_iterator >' being compiled
> 
C:\PROGRA~1\MICROS~3\2022\Preview\VC\Tools\MSVC\1436~1.323\Include\xutility(1778):
 note: see reference to variable template 'bool 
input_iterator >' 
being compiled
> filter\source\config\cache\filtercache.hxx(368): note: see reference to 
class template instantiation 'std::span' being compiled

Change-Id: Ibff530be810f56a1f33bf78f0d2e3b76c64b08cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150385
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/filter/source/config/cache/filtercache.hxx 
b/filter/source/config/cache/filtercache.hxx
index 80db28b66505..a48e3df62767 100644
--- a/filter/source/config/cache/filtercache.hxx
+++ b/filter/source/config/cache/filtercache.hxx
@@ -23,6 +23,7 @@
 #include 
 
 #include "cacheitem.hxx"
+#include 
 #include 
 #include 
 #include 


[Libreoffice-commits] core.git: filter/source

2023-03-29 Thread Yousef_Rabia (via logerrit)
 filter/source/svg/presentation_engine.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6700f7f5b4eae31bf020e7d073c496c6e67a2397
Author: Yousef_Rabia 
AuthorDate: Sun Mar 26 21:06:00 2023 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Wed Mar 29 06:01:09 2023 +

tdf#147906 Use Math.hypot() for Pythagorean addition

Change-Id: I8823038bde51002ea8c02ca7e841aca99f928a58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149618
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index 08fdb283d60b..ba585b6f4b3c 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -763,7 +763,7 @@ function getDistance(p1, p2, props) {
 var x = p2[props[0]] - p1[props[0]],
 y = p2[props[1]] - p1[props[1]];
 
-return Math.sqrt((x * x) + (y * y));
+return Math.hypot(x, y);
 }
 
 /**


[Libreoffice-commits] core.git: filter/source

2023-03-24 Thread Andrea Gelmini (via logerrit)
 filter/source/pdf/impdialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fba19e93cca9a7cdfa1e4ac92291cd0b7f06d715
Author: Andrea Gelmini 
AuthorDate: Fri Mar 24 11:34:36 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Mar 24 12:06:05 2023 +

Fix typo

Change-Id: I4cc8dbd5a315844f858bf60e3b5b949c4adb1f58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149535
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 06fb46b9e3c1..bc0463e8983e 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -355,7 +355,7 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, OkHdl, weld::Button&, void)
 else if (ret == RET_NO)
 {
 m_xDialog->response(RET_CANCEL);
-// Show accessiblity check Sidebar deck
+// Show accessibility check Sidebar deck
 SfxDispatcher* pDispatcher = pShell->GetDispatcher();
 if (pDispatcher)
 {


[Libreoffice-commits] core.git: filter/source

2023-03-23 Thread Arvind K (via logerrit)
 filter/source/msfilter/msdffimp.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e466b4a92f5f7c49c6aff01af994d59d13633529
Author: Arvind K 
AuthorDate: Mon Mar 6 11:36:15 2023 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Thu Mar 23 11:53:16 2023 +

tdf#114441 Convert sal_uLong to better integer types

filter/ -> nFilePos in struct SvxMSDffBLIPInfo is assigned nBLIPPos
which is defined as sal_uInt32.

Change-Id: If2815449d12b17e8caadaff0324371c69a5a5ab6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148291
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index 53818a550bec..b397630f028a 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -188,8 +188,8 @@ enum class OfficeArtBlipRecInstance : sal_uInt32
 
 struct SvxMSDffBLIPInfo
 {
-sal_uLong  nFilePos;///< offset of the BLIP in data stream
-explicit SvxMSDffBLIPInfo(sal_uLong nFPos)
+sal_uInt32  nFilePos;///< offset of the BLIP in data stream
+explicit SvxMSDffBLIPInfo(sal_uInt32 nFPos)
 : nFilePos(nFPos)
 {
 }


[Libreoffice-commits] core.git: filter/source

2023-03-22 Thread Michael Stahl (via logerrit)
 filter/source/pdf/impdialog.cxx |   11 +++
 filter/source/pdf/impdialog.hxx |1 +
 filter/source/pdf/pdfexport.cxx |2 ++
 3 files changed, 14 insertions(+)

New commits:
commit 089b9e21c7210df3e5ee312a06131ce410989cf7
Author: Michael Stahl 
AuthorDate: Tue Mar 21 12:55:11 2023 +0100
Commit: Michael Stahl 
CommitDate: Wed Mar 22 10:36:14 2023 +

filter: PDF export dialog: always disable ReferenceXObject for PDF/UA

  7.20 XObjects
  Reference XObjects, as noted in ISO 32000-1:2008, 8.10.4, shall
  not be used in conforming PDF/UA files.

Change-Id: I62a4b6b76a6cb1d14d4fd39fad90ec0323a481c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149261
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 29d60abe73bc..c43cde0cf6e1 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -775,6 +775,7 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( 
ImpPDFTabDialog* pParent )
 if (!bIsPDFUA)
 {
 pParent->mbExportBookmarksUserSelection = pParent->mbExportBookmarks;
+pParent->mbUseReferenceXObjectUserSelection = 
pParent->mbUseReferenceXObject;
 }
 
 pParent->mbUseTaggedPDFUserSelection = mbUseTaggedPDFUserSelection;
@@ -923,12 +924,22 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, 
TogglePDFVersionOrUniversalAccessibilityHa
 }
 mxCbExportBookmarks->set_active(true);
 }
+if (mxCbUseReferenceXObject->get_sensitive())
+{
+if (mpParent)
+{
+mpParent->mbUseReferenceXObjectUserSelection = 
mxCbUseReferenceXObject->get_active();
+}
+mxCbUseReferenceXObject->set_active(false);
+}
 }
 else if (mpParent)
 {
 
mxCbExportBookmarks->set_active(mpParent->mbExportBookmarksUserSelection);
+
mxCbUseReferenceXObject->set_active(mpParent->mbUseReferenceXObjectUserSelection);
 }
 mxCbExportBookmarks->set_sensitive(!bIsPDFUA);
+mxCbUseReferenceXObject->set_sensitive(!bIsPDFUA);
 
 ImpPDFTabOpnFtrPage *const pOpenPage(mpParent ? mpParent->getOpenPage() : 
nullptr);
 if (pOpenPage)
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 62ed7d580f44..45442c58048b 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -87,6 +87,7 @@ class ImpPDFTabDialog final : public SfxTabDialogController
 boolmbExportNotesInMargin;
 boolmbViewPDF;
 boolmbUseReferenceXObject;
+boolmbUseReferenceXObjectUserSelection = false;
 boolmbExportNotesPages;
 boolmbExportOnlyNotesPages;
 boolmbUseTransitionEffects;
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 15d1a577fe47..3edcd1976c4f 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -712,6 +712,8 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 mbUseTaggedPDF = true;
 // ISO 14289-1:2014, Clause: 7.16
 mbCanExtractForAccessibility = true;
+// ISO 14289-1:2014, Clause: 7.20
+mbUseReferenceXObject = false;
 }
 
 // copy in context the values default in the constructor or set by 
the FilterData sequence of properties


[Libreoffice-commits] core.git: filter/source

2023-03-16 Thread Andrea Gelmini (via logerrit)
 filter/source/pdf/impdialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2d426a9299adb5cfd4a38af33b66b7409f6b789d
Author: Andrea Gelmini 
AuthorDate: Thu Mar 16 20:57:24 2023 +0100
Commit: Julien Nabet 
CommitDate: Thu Mar 16 20:54:38 2023 +

Fix typo

Change-Id: Ic43a5bb4d243b2c4081fcd56130e20ed1c3b43a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149009
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index a214e9d9cde9..29d60abe73bc 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1088,7 +1088,7 @@ void 
ImpPDFTabOpnFtrPage::SetFilterConfigItem(ImpPDFTabDialog *const pParent)
 }
 
 // The call from ImpPDFTabGeneralPage::SetFilterConfigItem() did not init
-// the radio buttons correctly becuse ImpPDFTabOpnFtrPage did not yet 
exist.
+// the radio buttons correctly because ImpPDFTabOpnFtrPage did not yet 
exist.
 ToggleInitialView(*pParent);
 }
 


[Libreoffice-commits] core.git: filter/source officecfg/registry sc/qa sd/qa sw/qa

2023-03-16 Thread Michael Stahl (via logerrit)
 filter/source/pdf/impdialog.cxx|   70 -
 filter/source/pdf/impdialog.hxx|7 +
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |2 
 sc/qa/uitest/calc_tests4/exportToPDF.py|4 
 sd/qa/uitest/impress_tests/exportToPDF.py  |4 
 sw/qa/uitest/writer_tests4/exportToPDF.py  |4 
 6 files changed, 81 insertions(+), 10 deletions(-)

New commits:
commit 529afed0ba3ca5e659cea661816e9164846630e8
Author: Michael Stahl 
AuthorDate: Tue Mar 14 15:20:22 2023 +0100
Commit: Michael Stahl 
CommitDate: Thu Mar 16 09:09:50 2023 +

tdf#39667 filter,officecfg: PDF export dialog: set initial view to...

... Outline for PDF/UA.

* change the dialog to disable the radio buttons if PDF/UA is enabled
* also change the configuration to make Outline the default

Change-Id: Iea8c5e0f8560c972dc250859198bea1cb9fc3597
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148883
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index b3314ba0df1d..a214e9d9cde9 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -93,7 +93,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const 
Sequence< Property
 mbOpenInFullScreenMode( false ),
 mbDisplayPDFDocumentTitle( false ),
 mnMagnification( 0 ),
-mnInitialView( 0 ),
+mnInitialView( 1 ),
 mnZoom( 0 ),
 mnInitialPage( 1 ),
 mnPageLayout( 0 ),
@@ -225,6 +225,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, 
const Sequence< Property
 mbDisplayPDFDocumentTitle = maConfigItem.ReadBool( 
"DisplayPDFDocumentTitle", true );
 
 mnInitialView = maConfigItem.ReadInt32( "InitialView", 0 );
+mnInitialViewUserSelection = mnInitialView;
 mnMagnification = maConfigItem.ReadInt32( "Magnification", 0 );
 mnZoom = maConfigItem.ReadInt32( "Zoom", 100 );
 mnPageLayout = maConfigItem.ReadInt32( "PageLayout", 0 );
@@ -288,6 +289,15 @@ ImpPDFTabSecurityPage* ImpPDFTabDialog::getSecurityPage() 
const
 return nullptr;
 }
 
+ImpPDFTabOpnFtrPage * ImpPDFTabDialog::getOpenPage() const
+{
+SfxTabPage* pOpenPage = GetTabPage("initialview");
+if (pOpenPage)
+{
+return static_cast(pOpenPage);
+}
+return nullptr;
+}
 
 ImpPDFTabLinksPage* ImpPDFTabDialog::getLinksPage() const
 {
@@ -920,6 +930,12 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, 
TogglePDFVersionOrUniversalAccessibilityHa
 }
 mxCbExportBookmarks->set_sensitive(!bIsPDFUA);
 
+ImpPDFTabOpnFtrPage *const pOpenPage(mpParent ? mpParent->getOpenPage() : 
nullptr);
+if (pOpenPage)
+{
+pOpenPage->ToggleInitialView(*mpParent);
+}
+
 // PDF/A doesn't allow launch action, so enable/disable the selection on 
the Link page
 ImpPDFTabLinksPage* pLinksPage = mpParent ? mpParent->getLinksPage() : 
nullptr;
 if (pLinksPage)
@@ -969,6 +985,10 @@ void ImpPDFTabOpnFtrPage::GetFilterConfigItem( 
ImpPDFTabDialog* pParent  )
 pParent->mnInitialView = 1;
 else if( mxRbOpnThumbs->get_active() )
 pParent->mnInitialView = 2;
+if (!pParent->mbPDFUACompliance)
+{
+pParent->mnInitialViewUserSelection = pParent->mnInitialView;
+}
 
 pParent->mnMagnification = 0;
 if( mxRbMagnFitWin->get_active() )
@@ -996,7 +1016,7 @@ void ImpPDFTabOpnFtrPage::GetFilterConfigItem( 
ImpPDFTabDialog* pParent  )
 pParent->mbFirstPageLeft = mbUseCTLFont && 
mxCbPgLyFirstOnLeft->get_active();
 }
 
-void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const  ImpPDFTabDialog* pParent 
)
+void ImpPDFTabOpnFtrPage::SetFilterConfigItem(ImpPDFTabDialog *const pParent)
 {
 mbUseCTLFont = pParent->mbUseCTLFont;
 switch( pParent->mnPageLayout )
@@ -1066,6 +1086,52 @@ void ImpPDFTabOpnFtrPage::SetFilterConfigItem( const  
ImpPDFTabDialog* pParent )
 mxCbPgLyFirstOnLeft->set_active(pParent->mbFirstPageLeft);
 ToggleRbPgLyContinueFacingHdl();
 }
+
+// The call from ImpPDFTabGeneralPage::SetFilterConfigItem() did not init
+// the radio buttons correctly becuse ImpPDFTabOpnFtrPage did not yet 
exist.
+ToggleInitialView(*pParent);
+}
+
+void ImpPDFTabOpnFtrPage::ToggleInitialView(ImpPDFTabDialog & rParent)
+{
+bool const bIsPDFUA(rParent.getGeneralPage()->IsPdfUaSelected());
+if (bIsPDFUA)
+{   // only allow Outline for PDF/UA
+if (mxRbOpnOutline->get_sensitive())
+{
+if (mxRbOpnPageOnly->get_active())
+{
+rParent.mnInitialViewUserSelection = 0;
+}
+else if (mxRbOpnOutline->get_active())
+{
+rParent.mnInitialViewUserSelection = 1;
+}
+else if (mxRbOpnThumbs->get_active())
+{
+rParent.mnInitialViewUserSelection = 2;
+   

[Libreoffice-commits] core.git: filter/source

2023-03-14 Thread Michael Stahl (via logerrit)
 filter/source/pdf/impdialog.cxx |   24 +++-
 filter/source/pdf/impdialog.hxx |1 +
 2 files changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 4a96f25ac3ef9f2ed940d6e56eca87bba387d451
Author: Michael Stahl 
AuthorDate: Mon Mar 13 20:46:15 2023 +0100
Commit: Michael Stahl 
CommitDate: Tue Mar 14 09:40:39 2023 +

filter: PDF export dialog: always enable Outlines for PDF/UA

This is not a hard requirement, but why not prevent this pitfall
at least in the dialog:

  7.17 Navigation
  A document should include a document outline that matches the reading
  order and level of navigational targets (ISO 32000-1:2008, 12.3.3).

Change-Id: I06533123cdfe5fe1c79180d6ebd4e961b25a63b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148818
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 4693652292ed..b3314ba0df1d 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -198,6 +198,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, 
const Sequence< Property
 mbViewPDF = maConfigItem.ReadBool( "ViewPDFAfterExport", false );
 
 mbExportBookmarks = maConfigItem.ReadBool( "ExportBookmarks", true );
+mbExportBookmarksUserSelection = mbExportBookmarks;
 if ( mbIsPresentation )
 mbExportHiddenSlides = maConfigItem.ReadBool( "ExportHiddenSlides", 
false );
 if ( mbIsSpreadsheet )
@@ -619,6 +620,7 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 mxCbTaggedPDF->set_active(pParent->mbUseTaggedPDFUserSelection);
 else
 mbUseTaggedPDFUserSelection = pParent->mbUseTaggedPDFUserSelection;
+mxCbExportBookmarks->set_active(pParent->mbExportBookmarksUserSelection);
 TogglePDFVersionOrUniversalAccessibilityHandle(*mxCbPDFA);
 
 mxCbExportFormFields->set_active(pParent->mbExportFormFields);
@@ -628,7 +630,6 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 mxCbAllowDuplicateFieldNames->set_active( 
pParent->mbAllowDuplicateFieldNames );
 mxFormsFrame->set_sensitive(pParent->mbExportFormFields);
 
-mxCbExportBookmarks->set_active( pParent->mbExportBookmarks );
 
 mxCbExportNotes->set_active( pParent->mbExportNotes );
 mxCbExportNotesInMargin->set_active( pParent->mbExportNotesInMargin );
@@ -761,6 +762,10 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( 
ImpPDFTabDialog* pParent )
 
 if (!bIsPDFA && !bIsPDFUA)
 mbUseTaggedPDFUserSelection = pParent->mbUseTaggedPDF;
+if (!bIsPDFUA)
+{
+pParent->mbExportBookmarksUserSelection = pParent->mbExportBookmarks;
+}
 
 pParent->mbUseTaggedPDFUserSelection = mbUseTaggedPDFUserSelection;
 pParent->mbExportFormFields = mxCbExportFormFields->get_active();
@@ -898,6 +903,23 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, 
TogglePDFVersionOrUniversalAccessibilityHa
 mxCbTaggedPDF->set_active(mbUseTaggedPDFUserSelection);
 }
 
+if (bIsPDFUA)
+{
+if (mxCbExportBookmarks->get_sensitive())
+{
+if (mpParent)
+{
+mpParent->mbExportBookmarksUserSelection = 
mxCbExportBookmarks->get_active();
+}
+mxCbExportBookmarks->set_active(true);
+}
+}
+else if (mpParent)
+{
+
mxCbExportBookmarks->set_active(mpParent->mbExportBookmarksUserSelection);
+}
+mxCbExportBookmarks->set_sensitive(!bIsPDFUA);
+
 // PDF/A doesn't allow launch action, so enable/disable the selection on 
the Link page
 ImpPDFTabLinksPage* pLinksPage = mpParent ? mpParent->getLinksPage() : 
nullptr;
 if (pLinksPage)
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index dd2a9a3add98..aac0185482b6 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -97,6 +97,7 @@ class ImpPDFTabDialog final : public SfxTabDialogController
 boolmbExportFormFields;
 boolmbAllowDuplicateFieldNames;
 boolmbExportBookmarks;
+boolmbExportBookmarksUserSelection = true;
 boolmbExportHiddenSlides;
 boolmbSinglePageSheets;
 sal_Int32   mnOpenBookmarkLevels;


[Libreoffice-commits] core.git: filter/source

2023-03-14 Thread Michael Stahl (via logerrit)
 filter/source/pdf/impdialog.cxx |8 
 filter/source/pdf/pdfexport.cxx |3 +++
 2 files changed, 11 insertions(+)

New commits:
commit 62f8bf1fd379387cafeb616189480976d026224c
Author: Michael Stahl 
AuthorDate: Mon Mar 13 18:31:50 2023 +0100
Commit: Michael Stahl 
CommitDate: Tue Mar 14 09:40:03 2023 +

filter: PDF export/PDF dialog: PDF/UA requires P bit 10 enabled

Adapt dialog and export filter to ensure the bit is set:

  7.16 Security
  An encrypted conforming file shall contain a P key in its encryption
  dictionary (ISO 32000-1:2008, 7.6.3.2, Table 21). The 10th bit
  position of the P key shall be true.

Change-Id: I2e8e4f5b0ef44efeabf3017f2e12b58914e93520
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148802
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index c766c93d5938..4693652292ed 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1315,12 +1315,20 @@ IMPL_LINK_NOARG(ImpPDFTabSecurityPage, 
ClickmaPbSetPwdHdl, weld::Button&, void)
 void ImpPDFTabSecurityPage::enablePermissionControls()
 {
 bool bIsPDFASel = false;
+bool bIsPDFUASel = false;
 ImpPDFTabDialog* pParent = 
static_cast(GetDialogController());
 ImpPDFTabGeneralPage* pGeneralPage = pParent ? pParent->getGeneralPage() : 
nullptr;
 if (pGeneralPage)
 {
 bIsPDFASel = pGeneralPage->IsPdfaSelected();
+bIsPDFUASel = pGeneralPage->IsPdfUaSelected();
 }
+// ISO 14289-1:2014, Clause: 7.16
+if (bIsPDFUASel)
+{
+mxCbEnableAccessibility->set_active(true);
+}
+mxCbEnableAccessibility->set_sensitive(!bIsPDFUASel);
 if (bIsPDFASel)
 {
 mxUserPwdPdfa->show();
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 9074a345f809..15d1a577fe47 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -708,7 +708,10 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 aContext.UniversalAccessibilityCompliance = mbPDFUACompliance;
 if (mbPDFUACompliance)
 {
+// ISO 14289-1:2014, Clause: 7.1
 mbUseTaggedPDF = true;
+// ISO 14289-1:2014, Clause: 7.16
+mbCanExtractForAccessibility = true;
 }
 
 // copy in context the values default in the constructor or set by 
the FilterData sequence of properties


[Libreoffice-commits] core.git: filter/source

2023-03-14 Thread Michael Stahl (via logerrit)
 filter/source/pdf/impdialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 847f836c047152b6202b9ee28020df5e87eeba2f
Author: Michael Stahl 
AuthorDate: Mon Mar 13 17:53:18 2023 +0100
Commit: Michael Stahl 
CommitDate: Tue Mar 14 09:39:08 2023 +

tdf#154171 filter: PDF export dialog: don't show spurious error if PDF/UA 
toggled

1. Security tab, set permission password
2. General tab, disable PDF/UA
3. General tab, enable PDF/UA
4. spurious error dialog mentioning PDF/A, which is unrelated to PDF/UA

(regression from commit 5a7cfe98e96489b7fa19d286ddd1e8c8e591d7dd)

Change-Id: I742da1cd459919faeae53fc21e5f97ee6a7c6ffe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148801
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 2516342cde70..c766c93d5938 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -883,7 +883,7 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, 
TogglePDFVersionOrUniversalAccessibilityHa
 mxCbTaggedPDF->set_active(true);
 
 // if a password was set, inform the user that this will not be used
-if (pSecPage && pSecPage->hasPassword())
+if (bIsPDFA && pSecPage && pSecPage->hasPassword())
 {
 mxPasswordUnusedWarnDialog =
 
std::shared_ptr(Application::CreateMessageDialog(m_xContainer.get(),


[Libreoffice-commits] core.git: filter/source

2023-03-09 Thread Noel Grandin (via logerrit)
 filter/source/config/cache/typedetection.cxx |   41 +--
 filter/source/config/cache/typedetection.hxx |8 ++---
 2 files changed, 12 insertions(+), 37 deletions(-)

New commits:
commit 2b87bcf08cedd444ba8b4de87a6c2b81e1d5fb0d
Author: Noel Grandin 
AuthorDate: Thu Mar 9 14:44:01 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 9 17:33:18 2023 +

remove some unnecessary locking in TypeDetection

the FilterCache class is already internally thread-safe

Change-Id: Ic869bda1257cc61fc69557624c8d6e169645b23a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148538
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/config/cache/typedetection.cxx 
b/filter/source/config/cache/typedetection.cxx
index ebf4f0bcb7c7..c05f30af7649 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -400,7 +400,7 @@ OUString SAL_CALL 
TypeDetection::queryTypeByDescriptor(css::uno::Sequence< css::
 {
 // Caller specified the filter type.  Honor it.  Just get the 
default
 // type for that filter, and bail out.
-if (impl_validateAndSetFilterOnDescriptor(aLock, stlDescriptor, 
aSelectedFilter))
+if (impl_validateAndSetFilterOnDescriptor(stlDescriptor, 
aSelectedFilter))
 return 
stlDescriptor[utl::MediaDescriptor::PROP_TYPENAME].get();
 }
 
@@ -546,16 +546,10 @@ void 
TypeDetection::impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDes
 sFilter.clear();
 try
 {
-// SAFE ->
-std::unique_lock aLock(m_aMutex);
-
 CacheItem aType = cache.getItem(FilterCache::E_TYPE, sType);
 aType[PROPNAME_PREFERREDFILTER] >>= sFilter;
 cache.getItem(FilterCache::E_FILTER, sFilter);
 
-aLock.unlock();
-// <- SAFE
-
 // no exception => found valid type and filter => set it on the given 
descriptor
 rDescriptor[utl::MediaDescriptor::PROP_TYPENAME  ] <<= sType  ;
 rDescriptor[utl::MediaDescriptor::PROP_FILTERNAME] <<= sFilter;
@@ -569,9 +563,6 @@ void 
TypeDetection::impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDes
 sFilter.clear();
 try
 {
-// SAFE ->
-std::unique_lock aLock(m_aMutex);
-
 // Attention: For executing next lines of code, We must be sure that
 // all filters already loaded :-(
 // That can disturb our "load on demand feature". But we have no other 
chance!
@@ -581,15 +572,10 @@ void 
TypeDetection::impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDes
 { PROPNAME_TYPE, uno::Any(sType) } };
 std::vector lFilters = 
cache.getMatchingItemsByProps(FilterCache::E_FILTER, lIProps);
 
-aLock.unlock();
-// <- SAFE
-
 for (auto const& filter : lFilters)
 {
 sFilter = filter;
 
-// SAFE ->
-aLock.lock();
 try
 {
 CacheItem aFilter = cache.getItem(FilterCache::E_FILTER, 
sFilter);
@@ -601,8 +587,6 @@ void 
TypeDetection::impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDes
 }
 catch(const css::uno::Exception&)
 { continue; }
-aLock.unlock();
-// <- SAFE
 
 sFilter.clear();
 }
@@ -1084,11 +1068,8 @@ OUString 
TypeDetection::impl_askUserForTypeAndFilterIfAllowed(utl::MediaDescript
 // too and no ambiguous filter registration disturb us .-)
 
 OUString sFilter = aRequest.getFilter();
-{
-std::unique_lock aLock(m_aMutex);
-if (!impl_validateAndSetFilterOnDescriptor(aLock, rDescriptor, 
sFilter))
-return OUString();
-}
+if (!impl_validateAndSetFilterOnDescriptor(rDescriptor, sFilter))
+return OUString();
 OUString sType;
 rDescriptor[utl::MediaDescriptor::PROP_TYPENAME] >>= sType;
 return sType;
@@ -1143,16 +1124,11 @@ void 
TypeDetection::impl_removeTypeFilterFromDescriptor(utl::MediaDescriptor& rD
 bool TypeDetection::impl_validateAndSetTypeOnDescriptor(  
utl::MediaDescriptor& rDescriptor,
 const OUString&
   sType  )
 {
-// SAFE ->
+if (GetTheFilterCache().hasItem(FilterCache::E_TYPE, sType))
 {
-std::unique_lock aLock(m_aMutex);
-if (GetTheFilterCache().hasItem(FilterCache::E_TYPE, sType))
-{
-rDescriptor[utl::MediaDescriptor::PROP_TYPENAME] <<= sType;
-return true;
-}
+rDescriptor[utl::MediaDescriptor::PROP_TYPENAME] <<= sType;
+return true;
 }
-// <- SAFE
 
 // remove all related information from the descriptor
 impl_removeTypeFilterFromDescriptor(rDescriptor);
@@ -1160,9 +1136,8 @@ bool TypeDetection::impl_validateAndSetTypeOnDescriptor(  

[Libreoffice-commits] core.git: filter/source

2023-03-08 Thread Franklin Weng (via logerrit)
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl  |   11 
 filter/source/xslt/odf2xhtml/export/xhtml/header.xsl|   31 
 filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl |6 ++
 3 files changed, 48 insertions(+)

New commits:
commit d2e8705c9cc503afdaed366b1f71ed012b0c568f
Author: Franklin Weng 
AuthorDate: Wed Mar 1 00:04:11 2023 +0800
Commit: Miklos Vajna 
CommitDate: Thu Mar 9 07:43:14 2023 +

tdf#153839: add newline after certain tags

Add newline after certain tags in head section and paragraphs, to make 
generated xhtml easier to read.

Change-Id: I9562ef48d9dd1283110be4a45527616dce186681
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148026
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 430b834b3cca..ca7a6906b82c 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -50,9 +50,11 @@
 
 
 
+
 
 
 
+
 
 
 
@@ -178,6 +180,7 @@
 
 
 
+
 
 
 
@@ -233,6 +236,7 @@
 
 
 
+
 
 
 
@@ -472,10 +476,12 @@
 
 
 
+
 
 
 
 
+
 
 
 
@@ -547,6 +553,7 @@
 
 
 
+
 
 
 
@@ -558,6 +565,7 @@
 
 
 
+
 
 
 
@@ -565,6 +573,7 @@
 
 
 
+
 
 
 
@@ -580,6 +589,7 @@
 
 
 
+
 
 
 
@@ -1193,6 +1203,7 @@
 
 
 
+
 
 
 
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
index 2bd07d8d29e4..581b8b8d3421 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
@@ -55,12 +55,14 @@
 
 
 
+
 
 http://dublincore.org/documents/dcmi-terms/
 CSS helper variable will 
be created...
 
 
 
+
 
 CSS variable ready, 
header will be created...
 
@@ -68,6 +70,7 @@
 
 
 CSS header creation 
finished!
+
 
 
 
@@ -246,11 +249,13 @@
 
 
 
+
 
 
 
 
 
+
 
 
 
@@ -262,6 +267,7 @@
  
  en-US
  
+ 
 
 
 
@@ -271,6 +277,7 @@
  
  
  
+ 
 
 
 
@@ -280,13 +287,16 @@
 , 
 
 
+
 
 
+
 
 
 Content-Type
 application/xhtml+xml; 
charset=utf-8
 
+
 
 
 
@@ -304,6 +314,7 @@
 
 
 
+
 
 
 
@@ -315,6 +326,7 @@

 
 
+
 
 
 
@@ -322,6 +334,7 @@
 
 
 
+
 
 
 
@@ -329,18 +342,21 @@
 
 
 
+
 
 
 
 DCTERMS.source
 http://xml.openoffice.org/odf2xhtml
 
+
 
 
 
 
 
 
+
 
 
 
@@ -348,12 +364,14 @@
 
 
 
+
 
 
 
 
 
 
+
 
 
 
@@ -361,6 +379,7 @@
 
 
 
+
 
 
 
@@ -369,6 +388,7 @@
 
 
 
+
 
 
 
@@ -380,6 +400,7 @@
 
 
 
+
 
 
 
@@ -387,6 +408,7 @@
 
 
 
+
 
 
 
@@ -394,6 +416,7 @@
   

[Libreoffice-commits] core.git: filter/source include/vcl officecfg/registry vcl/qa vcl/source

2023-03-08 Thread Michael Stahl (via logerrit)
 filter/source/pdf/pdfexport.cxx|2 +-
 include/vcl/pdfwriter.hxx  |2 +-
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |2 +-
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |2 +-
 vcl/source/gdi/pdfwriter_impl.cxx  |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit e624e07cc54c408bb86bd2e52cfed3c7ec59fb4a
Author: Michael Stahl 
AuthorDate: Tue Mar 7 10:44:45 2023 +0100
Commit: Michael Stahl 
CommitDate: Wed Mar 8 10:38:24 2023 +

vcl: PDF export: default to PDF 1.7

Released by Adobe in 2006, and standardized as ISO 32000-1:2008.

Change-Id: I22c89019905c90e10fefb752c210ec7ea81b725b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148388
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index b966bf4bde95..9074a345f809 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -670,7 +670,7 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 {
 default:
 case 0:
-aContext.Version = vcl::PDFWriter::PDFVersion::PDF_1_6;
+aContext.Version = vcl::PDFWriter::PDFVersion::PDF_1_7;
 break;
 case 1:
 aContext.Version= vcl::PDFWriter::PDFVersion::PDF_A_1;
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 1e21fae1c5bd..bbb2d861fe56 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -641,7 +641,7 @@ The following structure describes the permissions used in 
PDF security
 DefaultLinkAction( PDFWriter::URIAction ),
 ConvertOOoTargetToPDFTarget( false ),
 ForcePDFAction( false ),
-Version( PDFWriter::PDFVersion::PDF_1_6 ),
+Version(PDFWriter::PDFVersion::PDF_1_7),
 UniversalAccessibilityCompliance( false ),
 Tagged( false ),
 SubmitFormat( PDFWriter::FDF ),
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 9ae5b9117f45..0332feaeef07 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5446,7 +5446,7 @@
 
   
 
-  PDF 1.6 (default selection).
+  PDF 1.7 (default selection).
 
   
   
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 30d9b5513c97..37b4c1feece0 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -2478,7 +2478,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testDefaultVersion)
 // Parse the export result.
 std::unique_ptr pPdfDocument = parsePDFExport();
 int nFileVersion = pPdfDocument->getFileVersion();
-CPPUNIT_ASSERT_EQUAL(16, nFileVersion);
+CPPUNIT_ASSERT_EQUAL(17, nFileVersion);
 }
 
 CPPUNIT_TEST_FIXTURE(PdfExportTest, testVersion15)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index a841842a6942..cbc0c20bc21f 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1300,8 +1300,8 @@ PDFWriterImpl::PDFWriterImpl( const 
PDFWriter::PDFWriterContext& rContext,
 case PDFWriter::PDFVersion::PDF_A_1:
 case PDFWriter::PDFVersion::PDF_1_4: aBuffer.append( "1.4" );break;
 case PDFWriter::PDFVersion::PDF_1_5: aBuffer.append( "1.5" );break;
-default:
 case PDFWriter::PDFVersion::PDF_1_6: aBuffer.append( "1.6" );break;
+default:
 case PDFWriter::PDFVersion::PDF_A_2:
 case PDFWriter::PDFVersion::PDF_A_3:
 case PDFWriter::PDFVersion::PDF_1_7: aBuffer.append( "1.7" );break;


[Libreoffice-commits] core.git: filter/source include/filter sd/source

2023-03-07 Thread Noel Grandin (via logerrit)
 filter/source/msfilter/svdfppt.cxx  |6 +++---
 include/filter/msfilter/svdfppt.hxx |4 ++--
 sd/source/filter/ppt/pptin.cxx  |2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit db0175bf3a4da8aec0e3607731b464c1ce91ee1d
Author: Noel Grandin 
AuthorDate: Tue Mar 7 10:14:23 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 7 11:24:47 2023 +

no need to allocate these separately

they are all one or two words in size

Change-Id: I44d60e9fca03ce6709551a660661dd2a6778fd7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148377
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index cb6381fb6fd3..faded37d12e2 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -846,7 +846,7 @@ rtl::Reference SdrEscherImport::ProcessObj( 
SvStream& rSt, DffObjData
 aTextObj.SetVertical( bVerticalText );
 if ( pRet )
 {
-bool bDeleteSource = aTextObj.GetOEPlaceHolderAtom() != 
nullptr;
+bool bDeleteSource = 
aTextObj.GetOEPlaceHolderAtom().has_value();
 if ( bDeleteSource  && dynamic_cast(pRet.get()) ==  nullptr // we are not allowed to get
 && dynamic_cast(pRet.get()) 
==  nullptr// grouped placeholder objects
 && dynamic_cast(pRet.get()) ==  nullptr )
@@ -6481,8 +6481,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, 
SdrPowerPointImport& rSdrPowerPointImport
 DffRecordHeader aPlaceHolderAtomHd;
 if ( SvxMSDffManager::SeekToRec( rIn, PPT_PST_OEPlaceholderAtom, 
aClientDataContainerHd.GetRecEndFilePos(),  ) )
 {
-mxImplTextObj->mpPlaceHolderAtom.reset( new PptOEPlaceholderAtom );
-ReadPptOEPlaceholderAtom( rIn, *( mxImplTextObj->mpPlaceHolderAtom 
) );
+mxImplTextObj->moPlaceHolderAtom.emplace();
+ReadPptOEPlaceholderAtom( rIn, *( mxImplTextObj->moPlaceHolderAtom 
) );
 }
 rIn.Seek( nOldPos );
 DffRecordHeader aProgTagHd;
diff --git a/include/filter/msfilter/svdfppt.hxx 
b/include/filter/msfilter/svdfppt.hxx
index 9c515615e0af..0fad50bf993f 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -1202,7 +1202,7 @@ struct ImplPPTTextObj final : public 
salhelper::SimpleReferenceObject
 {
 sal_uInt32  mnShapeId;
 sal_uInt32  mnShapeMaster;
-std::unique_ptr mpPlaceHolderAtom;
+std::optional moPlaceHolderAtom;
 TSS_TypemnInstance;
 TSS_TypemnDestinationInstance;
 MSO_SPT meShapeType;
@@ -1256,7 +1256,7 @@ public:
 voidSetDestinationInstance( TSS_Type nInstance )
 { mxImplTextObj->mnDestinationInstance = 
nInstance; }
 
-PptOEPlaceholderAtom*   GetOEPlaceHolderAtom() const { return 
mxImplTextObj->mpPlaceHolderAtom.get(); }
+const std::optional & GetOEPlaceHolderAtom() const { 
return mxImplTextObj->moPlaceHolderAtom; }
 sal_uInt32  GetTextFlags() const { return 
mxImplTextObj->mnTextFlags; }
 voidSetVertical( bool bVertical )
 {
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 8f022c606764..0cdc7f8fb59b 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2201,7 +2201,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* 
pTextObj, SdrTextObj* pObj
 ppStyleSheetAry = nullptr;
 
 PresObjKind ePresKind = PresObjKind::NONE;
-PptOEPlaceholderAtom* pPlaceHolder = pTextObj->GetOEPlaceHolderAtom();
+const std::optional& pPlaceHolder = 
pTextObj->GetOEPlaceHolderAtom();
 OUString aPresentationText;
 if ( pPlaceHolder )
 {


[Libreoffice-commits] core.git: filter/source vcl/unx

2023-03-06 Thread Noel Grandin (via logerrit)
 filter/source/graphicfilter/icgm/class1.cxx |3 ---
 vcl/unx/gtk3/salnativewidgets-gtk.cxx   |1 -
 2 files changed, 4 deletions(-)

New commits:
commit 0b92356a6c1844aef9ed49927fa4da310ee5bb2e
Author: Noel Grandin 
AuthorDate: Mon Mar 6 15:24:16 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 7 06:58:51 2023 +

clang-tidy dead-store

Change-Id: Id7c48e995b4f92f081fbd4d1af257e1b81e6a421
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148347
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/graphicfilter/icgm/class1.cxx 
b/filter/source/graphicfilter/icgm/class1.cxx
index 07a6fe253e4e..4304d142b5e5 100644
--- a/filter/source/graphicfilter/icgm/class1.cxx
+++ b/filter/source/graphicfilter/icgm/class1.cxx
@@ -151,9 +151,6 @@ void CGM::ImplDoClass1()
 }
 break;
 case 0x0a : /*Color Value Extent*/
-{
-nI1 = 6;
-}
 break;
 case 0x0b : /*MetaFile Element List */break;
 case 0x0c : /*MetaFile Default Replacement*/
diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx 
b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
index f55b45a8b92b..b5efe1b59ddc 100644
--- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx
@@ -782,7 +782,6 @@ void GtkSalGraphics::PaintOneSpinButton( GtkStyleContext 
*context,
 tools::Rectangle buttonRect = NWGetSpinButtonRect( nPart, aAreaRect );
 
 gtk_style_context_set_state(context, stateFlags);
-stateFlags = gtk_style_context_get_state(context);
 
 style_context_get_padding(context, );
 style_context_get_border(context, );


[Libreoffice-commits] core.git: filter/source sw/qa

2023-03-03 Thread Michael Stahl (via logerrit)
 filter/source/config/fragments/filters/OOXML_Text.xcu  |2 +-
 filter/source/config/fragments/filters/OOXML_Text_Template.xcu |2 +-
 filter/source/config/fragments/types/writer_OOXML.xcu  |2 +-
 filter/source/config/fragments/types/writer_OOXML_Template.xcu |2 +-
 sw/qa/uitest/writer_tests3/save_readonly_with_password.py  |2 +-
 sw/qa/uitest/writer_tests7/tdf131936.py|2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 7391942099d4a76639c1aa8e559643b2702da2b7
Author: Michael Stahl 
AuthorDate: Fri Mar 3 11:20:14 2023 +0100
Commit: Michael Stahl 
CommitDate: Fri Mar 3 16:49:30 2023 +

tdf#137883 filter: use en-dash instead of hyphen in UINames

(regression from commit ed0476b0625c4361df5ff040a6661a9634588cea)

Change-Id: I7c380a9871cf16623031751bd735f456a7ea200f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148167
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/config/fragments/filters/OOXML_Text.xcu 
b/filter/source/config/fragments/filters/OOXML_Text.xcu
index be5089123828..bbcceb1713d8 100644
--- a/filter/source/config/fragments/filters/OOXML_Text.xcu
+++ b/filter/source/config/fragments/filters/OOXML_Text.xcu
@@ -21,7 +21,7 @@
 com.sun.star.comp.Writer.WriterFilter
 
 
-Word 2010-365 Document
+Word 2010–365 Document
 
 
 1
diff --git a/filter/source/config/fragments/filters/OOXML_Text_Template.xcu 
b/filter/source/config/fragments/filters/OOXML_Text_Template.xcu
index abd511768ea6..55d326563bf6 100644
--- a/filter/source/config/fragments/filters/OOXML_Text_Template.xcu
+++ b/filter/source/config/fragments/filters/OOXML_Text_Template.xcu
@@ -21,7 +21,7 @@
 com.sun.star.comp.Writer.WriterFilter
 
 
-Word 2010-365 Template
+Word 2010–365 Template
 
 
 1
diff --git a/filter/source/config/fragments/types/writer_OOXML.xcu 
b/filter/source/config/fragments/types/writer_OOXML.xcu
index f3c99f7cbda6..079a6421f072 100644
--- a/filter/source/config/fragments/types/writer_OOXML.xcu
+++ b/filter/source/config/fragments/types/writer_OOXML.xcu
@@ -23,7 +23,7 @@
 true
 Office Open XML 
Text
 
-Word 2010-365 Document
+Word 2010–365 Document
 
 MSWordDoc
 
diff --git a/filter/source/config/fragments/types/writer_OOXML_Template.xcu 
b/filter/source/config/fragments/types/writer_OOXML_Template.xcu
index 3c1fa82c6fe6..a9d424b967b4 100644
--- a/filter/source/config/fragments/types/writer_OOXML_Template.xcu
+++ b/filter/source/config/fragments/types/writer_OOXML_Template.xcu
@@ -23,7 +23,7 @@
 true
 Office Open XML Text 
Template
 
-Word 2010-365 Template
+Word 2010–365 Template
 
 MSWordDoc
 
diff --git a/sw/qa/uitest/writer_tests3/save_readonly_with_password.py 
b/sw/qa/uitest/writer_tests3/save_readonly_with_password.py
index 0591ad9e0c91..e9a6140103f4 100644
--- a/sw/qa/uitest/writer_tests3/save_readonly_with_password.py
+++ b/sw/qa/uitest/writer_tests3/save_readonly_with_password.py
@@ -30,7 +30,7 @@ class save_readonly_with_password(UITestCase):
 xFileName.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
 xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": 
xFilePath}))
 xFileTypeCombo = xSaveDialog.getChild("file_type")
-select_by_text(xFileTypeCombo, "Word 2010-365 Document 
(.docx)")
+select_by_text(xFileTypeCombo, "Word 2010–365 Document 
(.docx)")
 xPasswordCheckButton = xSaveDialog.getChild("password")
 xPasswordCheckButton.executeAction("CLICK", tuple())
 xOpen = xSaveDialog.getChild("open")
diff --git a/sw/qa/uitest/writer_tests7/tdf131936.py 
b/sw/qa/uitest/writer_tests7/tdf131936.py
index c7bf9e13cd83..2d929c07d993 100644
--- a/sw/qa/uitest/writer_tests7/tdf131936.py
+++ b/sw/qa/uitest/writer_tests7/tdf131936.py
@@ -18,7 +18,7 @@ class tdf131936(UITestCase):
 with self.ui_test.execute_dialog_through_command(".uno:SaveAs", 
close_button="cancel") as xDialog:
 xFileTypeCombo = xDialog.getChild("file_type")
 state = get_state_as_dict(xFileTypeCombo)
-self.assertEqual(state["SelectEntryText"], "Word 2010-365 
Document (.docx)")
+self.assertEqual(state["SelectEntryText"], "Word 2010–365 
Document (.docx)")
 
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


[Libreoffice-commits] core.git: filter/source

2023-03-02 Thread Yomnasalama (via logerrit)
 filter/source/msfilter/msdffimp.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit badb7b6934182149c878d0917a81c0e414a9d922
Author: Yomnasalama 
AuthorDate: Thu Feb 9 17:53:35 2023 +0200
Commit: Hossein 
CommitDate: Thu Mar 2 09:48:56 2023 +

tdf#114441: replace sal_uLong with sal_uInt8 as all of them are small 
constants

The constants are now of type sal_uInt8 as all of them are small and
will not exceed the limit. Also, they are not going to change after that
in the code.

Change-Id: I81d144bffe5c381f9280a4c364462e33b3a9a8b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146721
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index afbc0a43869e..df90eb859c8f 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3889,9 +3889,9 @@ rtl::Reference SvxMSDffManager::ImportGraphic( 
SvStream& rSt, SfxItem
 }
 if (bOk && DFF_msofbtBSE == aHd.nRecType)
 {
-const sal_uLong nSkipBLIPLen = 20;
-const sal_uLong nSkipShapePos = 4;
-const sal_uLong nSkipBLIP = 4;
+const sal_uInt8 nSkipBLIPLen = 20;
+const sal_uInt8 nSkipShapePos = 4;
+const sal_uInt8 nSkipBLIP = 4;
 const sal_uLong nSkip =
 nSkipBLIPLen + 4 + nSkipShapePos + 4 + nSkipBLIP;
 


[Libreoffice-commits] core.git: filter/source

2023-02-24 Thread Noel Grandin (via logerrit)
 filter/source/pdf/pdfexport.cxx |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit c3178e3ad6a6faf1ea66898672e173b0008bce5c
Author: Noel Grandin 
AuthorDate: Thu Feb 23 15:46:48 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 24 12:00:34 2023 +

BaseMutex->std::mutex in PDFErrorRequest

Change-Id: Iae9c6fa3da9547d233470168aff3cda6270739cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147589
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 9d97f2134f41..9d0971074dcd 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -37,8 +37,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 
 #include "pdfexport.hxx"
@@ -1090,10 +1089,9 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 namespace
 {
 
-typedef cppu::WeakComponentImplHelper< task::XInteractionRequest > 
PDFErrorRequestBase;
+typedef comphelper::WeakComponentImplHelper< task::XInteractionRequest > 
PDFErrorRequestBase;
 
-class PDFErrorRequest : private cppu::BaseMutex,
-public PDFErrorRequestBase
+class PDFErrorRequest : public PDFErrorRequestBase
 {
 task::PDFExportException maExc;
 public:
@@ -1106,7 +1104,6 @@ public:
 
 
 PDFErrorRequest::PDFErrorRequest( task::PDFExportException aExc ) :
-PDFErrorRequestBase( m_aMutex ),
 maExc(std::move( aExc ))
 {
 }
@@ -1114,7 +,7 @@ PDFErrorRequest::PDFErrorRequest( 
task::PDFExportException aExc ) :
 
 uno::Any SAL_CALL PDFErrorRequest::getRequest()
 {
-osl::MutexGuard const guard( m_aMutex );
+std::unique_lock guard( m_aMutex );
 
 uno::Any aRet;
 aRet <<= maExc;


[Libreoffice-commits] core.git: filter/source

2023-02-22 Thread Noel Grandin (via logerrit)
 filter/source/config/cache/configflush.cxx |   38 ++---
 filter/source/config/cache/configflush.hxx |   11 +++-
 2 files changed, 13 insertions(+), 36 deletions(-)

New commits:
commit f80e93a4241091ef1686e3850cd11c2b25d99b71
Author: Noel Grandin 
AuthorDate: Wed Feb 22 11:23:53 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 22 13:44:11 2023 +

BaseMutex->std::mutex in ConfigFlush

Change-Id: Ia8c5d5cc6ea52ed385ae4ea3e860f2cc88d06377
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147456
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/config/cache/configflush.cxx 
b/filter/source/config/cache/configflush.cxx
index 34ac28782b79..ed4da6d71185 100644
--- a/filter/source/config/cache/configflush.cxx
+++ b/filter/source/config/cache/configflush.cxx
@@ -26,7 +26,6 @@
 namespace filter::config{
 
 ConfigFlush::ConfigFlush()
-: m_lListener(m_aMutex)
 {
 }
 
@@ -57,46 +56,25 @@ void SAL_CALL ConfigFlush::refresh()
 // and is threadsafe by itself.
 // Further it's not a good idea to hold the own lock
 // if an outside object is called :-)
-css::lang::EventObject aSource(static_cast< 
css::util::XRefreshable* >(this));
-comphelper::OInterfaceContainerHelper2* pContainer = 
m_lListener.getContainer(cppu::UnoType::get());
-if (!pContainer)
+std::unique_lock g(m_aMutex);
+if (!m_aRefreshListeners.getLength(g))
 return;
-
-comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer);
-while (pIterator.hasMoreElements())
-{
-try
-{
-// ... this pointer can be interesting to find out, where will be 
called as listener
-// Don't optimize it to a direct iterator cast :-)
-css::util::XRefreshListener* pListener = 
static_cast(pIterator.next());
-pListener->refreshed(aSource);
-}
-catch(const css::uno::Exception&)
-{
-// ignore any "damaged" flush listener!
-// May its remote reference is broken ...
-pIterator.remove();
-}
-}
+css::lang::EventObject aSource(static_cast< css::util::XRefreshable* 
>(this));
+m_aRefreshListeners.notifyEach(g, ::util::XRefreshListener::refreshed, 
aSource);
 }
 
 
 void SAL_CALL ConfigFlush::addRefreshListener(const css::uno::Reference< 
css::util::XRefreshListener >& xListener)
 {
-// no locks necessary
-// used helper lives if we live and is threadsafe by itself ...
-m_lListener.addInterface(cppu::UnoType::get(),
- xListener);
+std::unique_lock g(m_aMutex);
+m_aRefreshListeners.addInterface(g, xListener);
 }
 
 
 void SAL_CALL ConfigFlush::removeRefreshListener(const css::uno::Reference< 
css::util::XRefreshListener >& xListener)
 {
-// no locks necessary
-// used helper lives if we live and is threadsafe by itself ...
-
m_lListener.removeInterface(cppu::UnoType::get(),
-xListener);
+std::unique_lock g(m_aMutex);
+m_aRefreshListeners.removeInterface(g, xListener);
 }
 
 
diff --git a/filter/source/config/cache/configflush.hxx 
b/filter/source/config/cache/configflush.hxx
index d033516733ac..ba20c9e9d505 100644
--- a/filter/source/config/cache/configflush.hxx
+++ b/filter/source/config/cache/configflush.hxx
@@ -20,9 +20,8 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
 
 
 namespace filter::config {
@@ -34,14 +33,14 @@ namespace filter::config {
 @descr  Such refresh listener will be called in case the
 type/filter configuration will be changed at runtime.
  */
-class ConfigFlush final : public cppu::BaseMutex
-  , public ::cppu::WeakImplHelper<
+class ConfigFlush final : public ::cppu::WeakImplHelper<
 css::util::XRefreshable,
 css::lang::XServiceInfo
   >
 {
-/** @short  holds all listener, which are registered at this instance. 
*/
-comphelper::OMultiTypeInterfaceContainerHelper2 m_lListener;
+std::mutex m_aMutex;
+/** @short  holds all listener, which are registered at this instance. */
+comphelper::OInterfaceContainerHelper4 
m_aRefreshListeners;
 
 
 // native interface


[Libreoffice-commits] core.git: filter/source

2023-02-22 Thread Noel Grandin (via logerrit)
 filter/source/config/cache/basecontainer.cxx |4 
 filter/source/config/cache/constant.hxx  |6 --
 2 files changed, 10 deletions(-)

New commits:
commit 0c14b1ba0d560c1de120d2562da6b24db9802149
Author: Noel Grandin 
AuthorDate: Tue Feb 21 14:00:48 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 22 09:02:56 2023 +

LOAD_IMPLICIT has been active

since
commit c847b9430e26f98664f42c8fd4c28dc0433174b2
Author: Oliver Bolte 
Date:   Thu Apr 29 12:38:50 2004 +

Change-Id: I496e5d52fae29274e4782f700dc391a86a50eb72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147403
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/config/cache/basecontainer.cxx 
b/filter/source/config/cache/basecontainer.cxx
index aa8ccd2d562a..7937eb19ab6b 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -27,8 +27,6 @@
 #include 
 #include 
 
-#define LOAD_IMPLICIT
-
 namespace filter::config{
 
 BaseContainer::BaseContainer()
@@ -59,7 +57,6 @@ void BaseContainer::init(const OUString&
 
 void BaseContainer::impl_loadOnDemand(std::unique_lock& /*rGuard*/)
 {
-#ifdef LOAD_IMPLICIT
 // A generic container needs all items of a set of our cache!
 // Of course it can block for a while, till the cache is really filled.
 // Note: don't load all sets supported by the cache here!
@@ -85,7 +82,6 @@ void 
BaseContainer::impl_loadOnDemand(std::unique_lock& /*rGuard*/)
 }
 
 GetTheFilterCache().load(eRequiredState);
-#endif
 }
 
 
diff --git a/filter/source/config/cache/constant.hxx 
b/filter/source/config/cache/constant.hxx
index 86e6e6de985c..a6277b179691 100644
--- a/filter/source/config/cache/constant.hxx
+++ b/filter/source/config/cache/constant.hxx
@@ -20,12 +20,6 @@
 
 #include 
 
-/*  disable impl_loadOnDemand function of BaseContainer for certain
-functions, where it the feature "impl_loadItemOnDemand() of class 
FilterCache
-can be used instead of loadAll()!*/
-// #define LOAD_IMPLICIT
-
-
 /** @short  used to identify a some generic item properties against the
 configuration API and can be used at all name containers
 (based on this filtercache) too.


[Libreoffice-commits] core.git: filter/source

2023-02-21 Thread Noel Grandin (via logerrit)
 filter/source/config/cache/basecontainer.cxx |  131 ++-
 filter/source/config/cache/basecontainer.hxx |   14 +-
 filter/source/config/cache/contenthandlerfactory.cxx |2 
 filter/source/config/cache/filterfactory.cxx |   18 +-
 filter/source/config/cache/frameloaderfactory.cxx|2 
 filter/source/config/cache/typedetection.cxx |   79 +--
 filter/source/config/cache/typedetection.hxx |   14 +-
 7 files changed, 108 insertions(+), 152 deletions(-)

New commits:
commit c060e7851bd6238ad6f4bdf0997c958c561cf8cf
Author: Noel Grandin 
AuthorDate: Tue Feb 21 13:59:13 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 22 07:50:16 2023 +

osl::Mutex->std::mutex in BaseContainer

Change-Id: I66fcebb897446a5839ebde03e8e0a91d75a5e57c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147402
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/config/cache/basecontainer.cxx 
b/filter/source/config/cache/basecontainer.cxx
index 0dee9d4ba25a..aa8ccd2d562a 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -33,7 +33,6 @@ namespace filter::config{
 
 BaseContainer::BaseContainer()
 : m_eType()
-, m_lListener  (m_aMutex)
 {
 GetTheFilterCache().load(FilterCache::E_CONTAINS_STANDARD);
 }
@@ -49,7 +48,7 @@ void BaseContainer::init(const OUString&
FilterCache::EItemType  
eType  )
 {
 // SAFE ->
-osl::MutexGuard aLock(m_aMutex);
+std::unique_lock aLock(m_aMutex);
 
 m_sImplementationName = sImplementationName;
 m_lServiceNames   = lServiceNames  ;
@@ -58,12 +57,9 @@ void BaseContainer::init(const OUString&
 }
 
 
-void BaseContainer::impl_loadOnDemand()
+void BaseContainer::impl_loadOnDemand(std::unique_lock& /*rGuard*/)
 {
 #ifdef LOAD_IMPLICIT
-// SAFE ->
-osl::MutexGuard aLock(m_aMutex);
-
 // A generic container needs all items of a set of our cache!
 // Of course it can block for a while, till the cache is really filled.
 // Note: don't load all sets supported by the cache here!
@@ -89,33 +85,26 @@ void BaseContainer::impl_loadOnDemand()
 }
 
 GetTheFilterCache().load(eRequiredState);
-// <- SAFE
 #endif
 }
 
 
-void BaseContainer::impl_initFlushMode()
+void BaseContainer::impl_initFlushMode(std::unique_lock& 
/*rGuard*/)
 {
-// SAFE ->
-osl::MutexGuard aLock(m_aMutex);
 if (!m_pFlushCache)
 m_pFlushCache = GetTheFilterCache().clone();
 if (!m_pFlushCache)
 throw css::uno::RuntimeException( "Can not create write copy of 
internal used cache on demand.",
 static_cast< OWeakObject* >(this));
-// <- SAFE
 }
 
 
-FilterCache* BaseContainer::impl_getWorkingCache() const
+FilterCache* BaseContainer::impl_getWorkingCache(std::unique_lock& 
/*rGuard*/) const
 {
-// SAFE ->
-osl::MutexGuard aLock(m_aMutex);
 if (m_pFlushCache)
 return m_pFlushCache.get();
 else
 return ();
-// <- SAFE
 }
 
 
@@ -154,15 +143,15 @@ void SAL_CALL BaseContainer::insertByName(const OUString& 
sItem ,
 throw css::lang::IllegalArgumentException(ex.Message, static_cast< 
css::container::XNameContainer* >(this), 2);
 }
 
-impl_loadOnDemand();
-
 // SAFE -> --
-osl::MutexGuard aLock(m_aMutex);
+std::unique_lock aLock(m_aMutex);
+
+impl_loadOnDemand(aLock);
 
 // create write copy of used cache on demand ...
-impl_initFlushMode();
+impl_initFlushMode(aLock);
 
-FilterCache* pCache = impl_getWorkingCache();
+FilterCache* pCache = impl_getWorkingCache(aLock);
 if (pCache->hasItem(m_eType, sItem))
 throw css::container::ElementExistException(OUString(), static_cast< 
css::container::XNameContainer* >(this));
 pCache->setItem(m_eType, sItem, aItem);
@@ -172,15 +161,15 @@ void SAL_CALL BaseContainer::insertByName(const OUString& 
sItem ,
 
 void SAL_CALL BaseContainer::removeByName(const OUString& sItem)
 {
-impl_loadOnDemand();
-
 // SAFE -> --
-osl::MutexGuard aLock(m_aMutex);
+std::unique_lock aLock(m_aMutex);
+
+impl_loadOnDemand(aLock);
 
 // create write copy of used cache on demand ...
-impl_initFlushMode();
+impl_initFlushMode(aLock);
 
-FilterCache* pCache = impl_getWorkingCache();
+FilterCache* pCache = impl_getWorkingCache(aLock);
 pCache->removeItem(m_eType, sItem); // throw exceptions automatically
 // <- SAFE --
 }
@@ -204,15 +193,15 @@ void SAL_CALL BaseContainer::replaceByName(const 
OUString& sItem ,
 throw css::lang::IllegalArgumentException(ex.Message, static_cast< 
css::container::XNameContainer* >(this), 2);
 }
 
-impl_loadOnDemand();
-
 // SAFE -> --
-

[Libreoffice-commits] core.git: filter/source

2023-02-20 Thread Noel Grandin (via logerrit)
 filter/source/config/cache/filtercache.cxx |  224 +
 filter/source/config/cache/filtercache.hxx |   41 +++--
 2 files changed, 126 insertions(+), 139 deletions(-)

New commits:
commit 15405dc68b2e88b53585578567da13e3e99962db
Author: Noel Grandin 
AuthorDate: Mon Feb 20 15:43:41 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 20 17:40:10 2023 +

osl::Mutex->std::mutex in FilterCache

Change-Id: I5cdfe5397235eef276fdf77a4bf83bebdc96438b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147338
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/config/cache/filtercache.cxx 
b/filter/source/config/cache/filtercache.cxx
index 5a2a59875953..aa0eff534cb4 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -119,7 +119,7 @@ FilterCache::~FilterCache()
 std::unique_ptr FilterCache::clone() const
 {
 // SAFE -> --
-osl::MutexGuard aLock(m_aMutex);
+std::unique_lock aGuard(m_aMutex);
 
 auto pClone = std::make_unique();
 
@@ -151,7 +151,7 @@ std::unique_ptr FilterCache::clone() const
 void FilterCache::takeOver(const FilterCache& rClone)
 {
 // SAFE -> --
-osl::MutexGuard aLock(m_aMutex);
+std::unique_lock aGuard(m_aMutex);
 
 // a)
 // Don't copy the configuration access points here!
@@ -192,14 +192,14 @@ void FilterCache::takeOver(const FilterCache& rClone)
 // Because we can't be sure, that changed filters on one clone
 // and changed types of another clone work together.
 // But here we can check against the later changes...
-impl_validateAndOptimize();
+impl_validateAndOptimize(aGuard);
 // <- SAFE --
 }
 
 void FilterCache::load(EFillState eRequired)
 {
 // SAFE -> --
-osl::MutexGuard aLock(m_aMutex);
+std::unique_lock aGuard(m_aMutex);
 
 // check if required fill state is already reached ...
 // There is nothing to do then.
@@ -217,28 +217,28 @@ void FilterCache::load(EFillState eRequired)
 //office document with a minimal set of values.
 if (m_eFillState == E_CONTAINS_NOTHING)
 {
-impl_getDirectCFGValue(CFGDIRECTKEY_OFFICELOCALE) >>= m_sActLocale;
+impl_getDirectCFGValue(aGuard, CFGDIRECTKEY_OFFICELOCALE) >>= 
m_sActLocale;
 if (m_sActLocale.isEmpty())
 {
 m_sActLocale = DEFAULT_OFFICELOCALE;
 }
 
 // Support the old configuration support. Read it only one times 
during office runtime!
-impl_readOldFormat();
+impl_readOldFormat(aGuard);
 }
 
 
 // b) If the required fill state was not reached
 //but std values was already loaded ...
 //we must load some further missing items.
-impl_load(eRequired);
+impl_load(aGuard, eRequired);
 // <- SAFE
 }
 
 bool FilterCache::isFillState(FilterCache::EFillState eState) const
 {
 // SAFE ->
-osl::MutexGuard aLock(m_aMutex);
+std::unique_lock aGuard(m_aMutex);
 return ((m_eFillState & eState) == eState);
 // <- SAFE
 }
@@ -249,12 +249,12 @@ std::vector 
FilterCache::getMatchingItemsByProps(  EItemType  eTyp
   o3tl::span< const 
css::beans::NamedValue > lEProps) const
 {
 // SAFE ->
-osl::MutexGuard aLock(m_aMutex);
+std::unique_lock aGuard(m_aMutex);
 
 // search for right list
 // An exception is thrown - "eType" is unknown.
 // => rList will be valid everytimes next line is reached.
-const CacheItemList& rList = impl_getItemList(eType);
+const CacheItemList& rList = impl_getItemList(aGuard, eType);
 
 std::vector lKeys;
 lKeys.reserve(rList.size());
@@ -280,12 +280,12 @@ std::vector 
FilterCache::getMatchingItemsByProps(  EItemType  eTyp
 bool FilterCache::hasItems(EItemType eType) const
 {
 // SAFE ->
-osl::MutexGuard aLock(m_aMutex);
+std::unique_lock aGuard(m_aMutex);
 
 // search for right list
 // An exception is thrown - "eType" is unknown.
 // => rList will be valid everytimes next line is reached.
-const CacheItemList& rList = impl_getItemList(eType);
+const CacheItemList& rList = impl_getItemList(aGuard, eType);
 
 return !rList.empty();
 // <- SAFE
@@ -295,12 +295,17 @@ bool FilterCache::hasItems(EItemType eType) const
 std::vector FilterCache::getItemNames(EItemType eType) const
 {
 // SAFE ->
-osl::MutexGuard aLock(m_aMutex);
+std::unique_lock aGuard(m_aMutex);
+return getItemNames(aGuard, eType);
+// <- SAFE
+}
 
+std::vector FilterCache::getItemNames(std::unique_lock& 
rGuard, EItemType eType) const
+{
 // search for right list
 // An exception is thrown - "eType" is unknown.
 // => rList will be valid everytimes next line is reached.
-const CacheItemList& rList = impl_getItemList(eType);

[Libreoffice-commits] core.git: filter/source offapi/com offapi/UnoApi_offapi.mk

2023-02-15 Thread Stephan Bergmann (via logerrit)
 filter/source/xsltfilter/XSLTFilter.cxx   |6 +++--
 offapi/UnoApi_offapi.mk   |1 
 offapi/com/sun/star/xml/xslt/XSLT2Transformer.idl |   23 --
 3 files changed, 4 insertions(+), 26 deletions(-)

New commits:
commit d22f3b8c787b93c38925adf92af542362dbda3e6
Author: Stephan Bergmann 
AuthorDate: Wed Feb 15 08:28:47 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Feb 15 08:44:21 2023 +

Remove css.xml.xslt.XSLT2Transformer not implemented by LO

(see f4238ed900cdfa65d447fbef81b2e8ae95095a4e "Revert 
'XSLT2Transformer::create
should always succeed'": "LO does not ship this service, it's only provided 
by
Saxon extension")

Change-Id: I8ff8c9e4bd0eae7055dcb4fc83a04ea41310b9a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147038
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/filter/source/xsltfilter/XSLTFilter.cxx 
b/filter/source/xsltfilter/XSLTFilter.cxx
index e3be62221468..44f9ce4d8172 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -65,7 +65,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -234,7 +233,10 @@ namespace XSLT
 {
 try
 {
-xTransformer = xslt::XSLT2Transformer::create(m_xContext, 
rArgs);
+xTransformer.set(
+
m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+"com.sun.star.xml.xslt.XSLT2Transformer", rArgs, 
m_xContext),
+css::uno::UNO_QUERY_THROW);
 }
 catch (const Exception&)
 {
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index e56e1dcf7754..5a592600797e 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -484,7 +484,6 @@ $(eval $(call 
gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/xml/xpath,\
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/xml/xslt,\
XSLTTransformer \
-   XSLT2Transformer \
 ))
 
 
diff --git a/offapi/com/sun/star/xml/xslt/XSLT2Transformer.idl 
b/offapi/com/sun/star/xml/xslt/XSLT2Transformer.idl
deleted file mode 100644
index f42a9ba4a036..
--- a/offapi/com/sun/star/xml/xslt/XSLT2Transformer.idl
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-module com { module sun { module star { module xml { module xslt {
-
-/** Get XSLT filter transformer supporting XSLT 2.0.
-
-@since LibreOffice 4.0
- */
-service XSLT2Transformer : XXSLTTransformer
-{
-create([in] sequence args);
-};
-
-}; }; }; }; };
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: filter/source

2023-02-14 Thread Stephan Bergmann (via logerrit)
 filter/source/xsltfilter/XSLTFilter.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit f4238ed900cdfa65d447fbef81b2e8ae95095a4e
Author: Stephan Bergmann 
AuthorDate: Tue Feb 14 09:46:43 2023 +
Commit: Stephan Bergmann 
CommitDate: Tue Feb 14 13:21:30 2023 +

Revert "XSLT2Transformer::create should always succeed"

This reverts commit 304ebfad5193c857e4edf18cb05d61b6ccc1f7d0.  As mst 
pointed
out on IRC, "LO does not ship this service, it's only provided by Saxon
extension".

Change-Id: Iafb416f3a3385345fd74cf76af4e9f600ff8eb79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146975
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/filter/source/xsltfilter/XSLTFilter.cxx 
b/filter/source/xsltfilter/XSLTFilter.cxx
index a48edd6d30cb..e3be62221468 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -232,7 +232,17 @@ namespace XSLT
 // service name there)
 if (rTransformer.toBoolean() || rTransformer.startsWith("com.sun."))
 {
-xTransformer = xslt::XSLT2Transformer::create(m_xContext, rArgs);
+try
+{
+xTransformer = xslt::XSLT2Transformer::create(m_xContext, 
rArgs);
+}
+catch (const Exception&)
+{
+// TODO: put a dialog telling about the need to install
+// xslt2-transformer extension here
+SAL_WARN("filter.xslt", "could not create XSLT 2.0 
transformer");
+throw;
+}
 }
 else
 {


[Libreoffice-commits] core.git: filter/source

2023-02-13 Thread Stephan Bergmann (via logerrit)
 filter/source/xsltfilter/XSLTFilter.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 9a466b75e373396cf8e9d21481b79ef3fd97c066
Author: Stephan Bergmann 
AuthorDate: Mon Feb 13 22:25:18 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 14 06:54:10 2023 +

Simplify code a bit

("instantiation of XSLT 2.0 transformer service failed" would mean that it
throws an exception, not that xTransformer would be null)

Change-Id: I8994c4b8d1c7ade8d5c7ef93569315d45fc7265d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146950
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/filter/source/xsltfilter/XSLTFilter.cxx 
b/filter/source/xsltfilter/XSLTFilter.cxx
index 334f2dd4b905..a48edd6d30cb 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -234,10 +234,7 @@ namespace XSLT
 {
 xTransformer = xslt::XSLT2Transformer::create(m_xContext, rArgs);
 }
-
-// instantiation of XSLT 2.0 transformer service failed, or the
-// filter does not need it
-if (!xTransformer.is())
+else
 {
 xTransformer = xslt::XSLTTransformer::create(m_xContext, rArgs);
 }


[Libreoffice-commits] core.git: filter/source

2023-02-13 Thread Stephan Bergmann (via logerrit)
 filter/source/xsltfilter/XSLTFilter.cxx |   27 ++-
 1 file changed, 10 insertions(+), 17 deletions(-)

New commits:
commit a2db1a1a4a1655034c27a64c1d67751752575856
Author: Stephan Bergmann 
AuthorDate: Mon Feb 13 22:27:22 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 14 06:53:54 2023 +

Remove an unhelpful try/catch

The theMacroExpander operations should never throw, so better leave 
uncaught any
exceptions that would happen after all, rather than silently swallowing 
them.

Change-Id: Ic5160a69e7cd7412c91ae3589b3dc89f6fe4c43b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146951
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/filter/source/xsltfilter/XSLTFilter.cxx 
b/filter/source/xsltfilter/XSLTFilter.cxx
index 8fe3d767bd4b..334f2dd4b905 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -208,23 +208,16 @@ namespace XSLT
 OUString
 XSLTFilter::expandUrl(const OUString& sUrl)
 {
-try
-{
-OUString sPreparedURL(sUrl);
-if 
(sPreparedURL.startsWithIgnoreAsciiCase("vnd.sun.star.expand:", ))
-{
-sPreparedURL = rtl::Uri::decode(sPreparedURL, 
rtl_UriDecodeWithCharset,
-RTL_TEXTENCODING_UTF8);
-css::uno::Reference
-xMacroExpander = theMacroExpander::get(m_xContext);
-sPreparedURL = xMacroExpander->expandMacros(sPreparedURL);
-}
-return sPreparedURL;
-}
-catch (const Exception&)
-{
-}
-return {};
+OUString sPreparedURL(sUrl);
+if (sPreparedURL.startsWithIgnoreAsciiCase("vnd.sun.star.expand:", 
))
+{
+sPreparedURL = rtl::Uri::decode(sPreparedURL, 
rtl_UriDecodeWithCharset,
+RTL_TEXTENCODING_UTF8);
+css::uno::Reference
+xMacroExpander = theMacroExpander::get(m_xContext);
+sPreparedURL = xMacroExpander->expandMacros(sPreparedURL);
+}
+return sPreparedURL;
 }
 
 css::uno::Reference


[Libreoffice-commits] core.git: filter/source include/filter sw/source writerfilter/source

2023-02-07 Thread Michael Stahl (via logerrit)
 filter/source/msfilter/util.cxx   |   19 +++
 include/filter/msfilter/util.hxx  |2 ++
 sw/source/filter/ww8/wrtw8sty.cxx |   15 +--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   15 ++-
 4 files changed, 24 insertions(+), 27 deletions(-)

New commits:
commit 0fafc03c24996ccd53dbf76eaab372779cfbca90
Author: Michael Stahl 
AuthorDate: Tue Feb 7 14:12:54 2023 +0100
Commit: Michael Stahl 
CommitDate: Tue Feb 7 15:17:30 2023 +

tdf#153083 writerfilter,sw: consolidate StyleName->StyleId in msfilter

Turns out there was already a function MSWordStyles::CreateStyleId()
doing the same thing as FilterChars(), presumably better.

Change-Id: Idd0129c753841b86bd026e1300aa57a56721c89e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146609
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index aea2f816bde9..32783f2c42f8 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -311,6 +312,24 @@ const ApiPaperSize& 
PaperSizeConv::getApiSizeForMSPaperSizeIndex( sal_Int32 nMSO
 return spPaperSizeTable[ nMSOPaperIndex ];
 }
 
+OUString CreateDOCXStyleId(std::u16string_view const aName)
+{
+OUStringBuffer aStyleIdBuf(aName.size());
+for (size_t i = 0; i < aName.size(); ++i)
+{
+sal_Unicode nChar = aName[i];
+if (rtl::isAsciiAlphanumeric(nChar) || nChar == '-')
+{
+// first letter should be uppercase
+if (aStyleIdBuf.isEmpty())
+aStyleIdBuf.append(char(rtl::toAsciiUpperCase(nChar)));
+else
+aStyleIdBuf.append(char(nChar));
+}
+}
+return aStyleIdBuf.makeStringAndClear();
+}
+
 std::u16string_view findQuotedText( std::u16string_view rCommand,
 const char* cStartQuote, const sal_Unicode uEndQuote )
 {
diff --git a/include/filter/msfilter/util.hxx b/include/filter/msfilter/util.hxx
index 3dd7c88843d0..b9b92ba930ef 100644
--- a/include/filter/msfilter/util.hxx
+++ b/include/filter/msfilter/util.hxx
@@ -79,6 +79,8 @@ public:
 static const ApiPaperSize& getApiSizeForMSPaperSizeIndex( sal_Int32 
nMSOPaperIndex );
 };
 
+MSFILTER_DLLPUBLIC OUString CreateDOCXStyleId(std::u16string_view aName);
+
 /**
  * Finds the quoted text in a field instruction text.
  *
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 2954a94c239c..c520cd867772 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -423,20 +423,7 @@ void MSWordStyles::BuildWwNames()
 
 OString MSWordStyles::CreateStyleId(std::u16string_view aName)
 {
-OStringBuffer aStyleIdBuf(aName.size());
-for (size_t i = 0; i < aName.size(); ++i)
-{
-sal_Unicode nChar = aName[i];
-if (rtl::isAsciiAlphanumeric(nChar) || nChar == '-')
-{
-// first letter should be uppercase
-if (aStyleIdBuf.isEmpty())
-aStyleIdBuf.append(char(rtl::toAsciiUpperCase(nChar)));
-else
-aStyleIdBuf.append(char(nChar));
-}
-}
-return aStyleIdBuf.makeStringAndClear();
+return OUStringToOString(msfilter::util::CreateDOCXStyleId(aName), 
RTL_TEXTENCODING_UTF8);
 }
 
 void MSWordStyles::BuildStyleIds()
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 8c424e12dda8..485a9399a7c7 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -89,7 +89,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -6139,19 +6138,9 @@ DomainMapper_Impl::StartIndexSectionChecked(const 
OUString& sServiceName)
  Hopefully this works and a complete map of >100 built-in style names
  localised to all languages isn't needed.
 */
-static auto FilterChars(OUString const& rStyleName) -> OUString
+static auto FilterChars(std::u16string_view const& rStyleName) -> OUString
 {
-OUStringBuffer ret;
-sal_Int32 index(0);
-while (index < rStyleName.getLength())
-{
-auto const c(rStyleName.iterateCodePoints());
-if (rtl::isAsciiAlphanumeric(c))
-{
-ret.appendUtf32(c);
-}
-}
-return ret.makeStringAndClear();
+return msfilter::util::CreateDOCXStyleId(rStyleName);
 }
 
 OUString DomainMapper_Impl::ConvertTOCStyleName(OUString const& rTOCStyleName)


[Libreoffice-commits] core.git: filter/source include/vcl vcl/inc vcl/source

2023-01-31 Thread Tomaž Vajngerl (via logerrit)
 filter/source/pdf/pdfexport.cxx   |2 +-
 include/vcl/pdfwriter.hxx |2 +-
 vcl/inc/pdf/pdfwriter_impl.hxx|3 ++-
 vcl/source/gdi/pdfwriter.cxx  |4 ++--
 vcl/source/gdi/pdfwriter_impl.cxx |   36 +++-
 5 files changed, 37 insertions(+), 10 deletions(-)

New commits:
commit 9740331d8bc56a9b6fbe3e4c1b26fb97f6639cc6
Author: Tomaž Vajngerl 
AuthorDate: Sat Jan 28 19:28:06 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed Feb 1 02:11:05 2023 +

tdf#66580 write more metadata to embedded and attached files

Change-Id: I6f40fd98b48893d01d29a806877821c561688897
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146288
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 7e710dabd928..9d97f2134f41 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -935,7 +935,7 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 else if (aSrcMimetype == 
"application/vnd.oasis.opendocument.graphics")
 aExt = ".odg";
 std::unique_ptr pStream(new 
PDFExportStreamDoc(mxSrcDoc, aPreparedPermissionPassword));
-aPDFWriter.AddAttachedFile("Original" + aExt, aSrcMimetype, 
std::move(pStream));
+aPDFWriter.AddAttachedFile("Original" + aExt, aSrcMimetype, 
u"Embedded original document of this PDF file", std::move(pStream));
 }
 
 if ( pOut )
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 80b71237138e..366cd6714412 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -1210,7 +1210,7 @@ The following structure describes the permissions used in 
PDF security
 @param pStream
 the interface to the additional stream
 */
-void AddAttachedFile(OUString const& rFileName, const OUString& rMimeType, 
std::unique_ptr pStream);
+void AddAttachedFile(OUString const& rFileName, OUString const& rMimeType, 
OUString const& rDescription, std::unique_ptr pStream);
 
 /// Write rString as a PDF hex string into rBuffer.
 static void AppendUnicodeTextString(const OUString& rString, 
OStringBuffer& rBuffer);
diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx
index 32917315f66c..4e10204433cb 100644
--- a/vcl/inc/pdf/pdfwriter_impl.hxx
+++ b/vcl/inc/pdf/pdfwriter_impl.hxx
@@ -669,6 +669,7 @@ struct PDFDocumentAttachedFile
 {
 OUString maFilename;
 OUString maMimeType;
+OUString maDescription;
 sal_Int32 mnEmbeddedFileObjectId;
 sal_Int32 mnObjectId;
 };
@@ -1330,7 +1331,7 @@ public:
 sal_Int32 createControl( const PDFWriter::AnyWidget& rControl, sal_Int32 
nPageNr = -1 );
 
 // attached file
-void addDocumentAttachedFile(OUString const& rFileName, OUString const& 
rMimeType, std::unique_ptr rStream);
+void addDocumentAttachedFile(OUString const& rFileName, OUString const& 
rMimeType, OUString const& rDescription, std::unique_ptr 
rStream);
 
 sal_Int32 addEmbeddedFile(BinaryDataContainer const & rDataContainer);
 sal_Int32 addEmbeddedFile(std::unique_ptr rStream, 
OUString const& rMimeType);
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 7d53f45c4699..2582b392b1ae 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -443,9 +443,9 @@ PDFOutputStream::~PDFOutputStream()
 {
 }
 
-void PDFWriter::AddAttachedFile(OUString const& rFileName, OUString const& 
rMimeType, std::unique_ptr pStream)
+void PDFWriter::AddAttachedFile(OUString const& rFileName, OUString const& 
rMimeType, OUString const& rDescription, std::unique_ptr 
pStream)
 {
-xImplementation->addDocumentAttachedFile(rFileName, rMimeType, 
std::move(pStream));
+xImplementation->addDocumentAttachedFile(rFileName, rMimeType, 
rDescription, std::move(pStream));
 }
 
 std::set< PDFWriter::ErrorCode > const & PDFWriter::GetErrors() const
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 2a87f8cb4e23..8be74da9e1c5 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -3423,12 +3423,13 @@ bool PDFWriterImpl::appendDest( sal_Int32 nDestID, 
OStringBuffer& rBuffer )
 return true;
 }
 
-void PDFWriterImpl::addDocumentAttachedFile(OUString const& rFileName, 
OUString const& rMimeType, std::unique_ptr rStream)
+void PDFWriterImpl::addDocumentAttachedFile(OUString const& rFileName, 
OUString const& rMimeType, OUString const& rDescription, 
std::unique_ptr rStream)
 {
 sal_Int32 nObjectID = addEmbeddedFile(std::move(rStream), rMimeType);
 auto& rAttachedFile = m_aDocumentAttachedFiles.emplace_back();
 rAttachedFile.maFilename = rFileName;
 rAttachedFile.maMimeType = rMimeType;
+rAttachedFile.maDescription = rDescription;
 rAttachedFile.mnEmbeddedFileObjectId = 

[Libreoffice-commits] core.git: filter/source include/vcl vcl/inc vcl/source

2023-01-24 Thread Tomaž Vajngerl (via logerrit)
 filter/source/pdf/pdfexport.cxx   |   32 ++--
 include/vcl/pdfwriter.hxx |   18 +-
 vcl/inc/pdf/pdfwriter_impl.hxx|   33 
 vcl/source/gdi/pdfwriter.cxx  |4 
 vcl/source/gdi/pdfwriter_impl.cxx |  266 +++---
 5 files changed, 194 insertions(+), 159 deletions(-)

New commits:
commit e052f6e1d49a5289411b31561d6e310bf414d896
Author: Tomaž Vajngerl 
AuthorDate: Mon Jan 23 12:33:39 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Jan 24 10:50:49 2023 +

tdf#66580 write ODF document as an attachment in hybrid mode

This changes the hybrid mode so that the ODF document is written
as an PDF compatible file attachment into the PDF document. It also
keeps writing the /AdditionalStreams element into the trailer to
keep backwards compatibility for now.

Change-Id: Ica31159cfbd591c6741e3da62c42d1fefd085696
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146053
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 338463f184f8..7e710dabd928 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -312,19 +313,16 @@ void PDFExportStreamDoc::write( const Reference< 
XOutputStream >& xStream )
 if( !xStore.is() )
 return;
 
-Sequence< beans::PropertyValue > aArgs( 2 + 
(m_aPreparedPassword.hasElements() ? 1 : 0) );
-aArgs.getArray()[0].Name = "FilterName";
-aArgs.getArray()[1].Name = "OutputStream";
-aArgs.getArray()[1].Value <<= xStream;
-if( m_aPreparedPassword.hasElements() )
-{
-aArgs.getArray()[2].Name = "EncryptionData";
-aArgs.getArray()[2].Value <<= m_aPreparedPassword;
-}
+std::vector aArgs {
+comphelper::makePropertyValue("FilterName", OUString()),
+comphelper::makePropertyValue("OutputStream", xStream),
+};
+if (m_aPreparedPassword.hasElements())
+aArgs.push_back(comphelper::makePropertyValue("EncryptionData", 
m_aPreparedPassword));
 
 try
 {
-xStore->storeToURL( "private:stream", aArgs );
+xStore->storeToURL("private:stream", 
comphelper::containerToSequence(aArgs));
 }
 catch( const IOException& )
 {
@@ -927,9 +925,17 @@ bool PDFExport::Export( const OUString& rFile, const 
Sequence< PropertyValue >&
 // export stream
 // get mimetype
 OUString aSrcMimetype = getMimetypeForDocument( mxContext, 
mxSrcDoc );
-aPDFWriter.AddStream( aSrcMimetype,
-   new PDFExportStreamDoc( mxSrcDoc, 
aPreparedPermissionPassword )
-   );
+OUString aExt;
+if (aSrcMimetype == "application/vnd.oasis.opendocument.text")
+aExt = ".odt";
+else if (aSrcMimetype == 
"application/vnd.oasis.opendocument.presentation")
+aExt = ".odp";
+else if (aSrcMimetype == 
"application/vnd.oasis.opendocument.spreadsheet")
+aExt = ".ods";
+else if (aSrcMimetype == 
"application/vnd.oasis.opendocument.graphics")
+aExt = ".odg";
+std::unique_ptr pStream(new 
PDFExportStreamDoc(mxSrcDoc, aPreparedPermissionPassword));
+aPDFWriter.AddAttachedFile("Original" + aExt, aSrcMimetype, 
std::move(pStream));
 }
 
 if ( pOut )
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index f98f2c231261..80b71237138e 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -1193,24 +1193,24 @@ The following structure describes the permissions used 
in PDF security
  */
 sal_Int32 CreateControl( const AnyWidget& rControlType );
 
-/** Inserts an additional stream to the PDF file
+/** Attaches an additional file to the PDF file
 
-This function adds an arbitrary stream to the produced PDF file. May be 
called
-any time before Emit(). The stream will be written during
-Emit by calling the PDFOutputStream Object's write
-method. After the call the PDFOutputStream will be deleted.
+This function adds an arbitrary stream that represents an attached file
+in the PDF file.
 
-All additional streams and their mimetypes will be entered into an array
-in the trailer dictionary.
+This also adds an additional stream array entry (with the mimetype) in
+the trailer dictionary for backwards compatibility.
+
+@param rFileName
+the filename of the additional file as presented in the stream
 
 @param rMimeType
 the mimetype of the stream
 
 @param pStream
 the interface to the additional stream
-
 */
-void AddStream( const OUString& rMimeType, PDFOutputStream* pStream );
+void 

[Libreoffice-commits] core.git: filter/source include/sfx2 sfx2/source vcl/jsdialog

2023-01-19 Thread NickWingate (via logerrit)
 filter/source/pdf/impdialog.cxx |   73 
 filter/source/pdf/impdialog.hxx |4 ++
 include/sfx2/passwd.hxx |6 +++
 sfx2/source/dialog/passwd.cxx   |   30 
 vcl/jsdialog/enabled.cxx|1 
 5 files changed, 78 insertions(+), 36 deletions(-)

New commits:
commit 7ebe5e19fb379c88b8e455693a23fd9036c1b517
Author: NickWingate 
AuthorDate: Wed Dec 28 17:27:31 2022 +
Commit: Andras Timar 
CommitDate: Thu Jan 19 12:48:06 2023 +

Make PDFExport Password Subdialog Async

Dialog in File>Export As PDF>Security>Set Password
Close subdialog when parent dialog is closed

Signed-off-by: NickWingate 
Change-Id: I9db8459309f2806ed47f9f932e0bde246400b2dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144854
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145759
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 4a03de89fdef..2516342cde70 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1171,6 +1171,10 @@ 
ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(weld::Container* pPage, weld::Dialo
 
 ImpPDFTabSecurityPage::~ImpPDFTabSecurityPage()
 {
+if (mpPasswordDialog)
+mpPasswordDialog->response(RET_CANCEL);
+if (mpUnsupportedMsgDialog)
+mpUnsupportedMsgDialog->response(RET_CANCEL);
 }
 
 std::unique_ptr ImpPDFTabSecurityPage::Create(weld::Container* 
pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet)
@@ -1261,40 +1265,51 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const  
ImpPDFTabDialog* pParent
 
 IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl, weld::Button&, void)
 {
-SfxPasswordDialog aPwdDialog(m_xContainer.get(), );
-aPwdDialog.SetMinLen(0);
-aPwdDialog.ShowMinLengthText(false);
-aPwdDialog.ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | 
SfxShowExtras::CONFIRM2 );
-aPwdDialog.set_title(msStrSetPwd);
-aPwdDialog.SetGroup2Text(msOwnerPwdTitle);
-aPwdDialog.AllowAsciiOnly();
-if (aPwdDialog.run() == RET_OK)  // OK issued get password and set it
-{
-OUString aUserPW(aPwdDialog.GetPassword());
-OUString aOwnerPW(aPwdDialog.GetPassword2());
+if(mpPasswordDialog)
+mpPasswordDialog->response(RET_CANCEL);
 
-mbHaveUserPassword = !aUserPW.isEmpty();
-mbHaveOwnerPassword = !aOwnerPW.isEmpty();
+mpPasswordDialog = std::make_shared(m_xContainer.get(), 
);
 
-mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, 
aUserPW );
-if (!mxPreparedPasswords.is()) {
-OUString msg;
-ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); 
//TODO: handle failure
-std::unique_ptr(
-Application::CreateMessageDialog(
-GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, 
msg))
-->run();
-return;
-}
+mpPasswordDialog->SetMinLen(0);
+mpPasswordDialog->ShowMinLengthText(false);
+mpPasswordDialog->ShowExtras( SfxShowExtras::CONFIRM | 
SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 );
+mpPasswordDialog->set_title(msStrSetPwd);
+mpPasswordDialog->SetGroup2Text(msOwnerPwdTitle);
+mpPasswordDialog->AllowAsciiOnly();
+
+mpPasswordDialog->PreRun();
 
-if( mbHaveOwnerPassword )
+weld::DialogController::runAsync(mpPasswordDialog, [this](sal_Int32 
response){
+if (response == RET_OK)
 {
-maPreparedOwnerPassword = 
comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW );
+OUString aUserPW(mpPasswordDialog->GetPassword());
+OUString aOwnerPW(mpPasswordDialog->GetPassword2());
+
+mbHaveUserPassword = !aUserPW.isEmpty();
+mbHaveOwnerPassword = !aOwnerPW.isEmpty();
+
+mxPreparedPasswords = vcl::PDFWriter::InitEncryption( aOwnerPW, 
aUserPW );
+if (!mxPreparedPasswords.is())
+{
+OUString msg;
+ErrorHandler::GetErrorString(ERRCODE_IO_NOTSUPPORTED, msg); 
//TODO: handle failure
+mpUnsupportedMsgDialog = std::shared_ptr(
+Application::CreateMessageDialog(
+GetFrameWeld(), VclMessageType::Error, VclButtonsType::Ok, 
msg));
+
+mpUnsupportedMsgDialog->runAsync(mpUnsupportedMsgDialog, 
[](sal_Int32){ });
+return;
+}
+
+if( mbHaveOwnerPassword )
+maPreparedOwnerPassword = 
comphelper::OStorageHelper::CreatePackageEncryptionData( aOwnerPW );
+else
+maPreparedOwnerPassword = Sequence< NamedValue >();
 }
-else
-maPreparedOwnerPassword = Sequence< NamedValue >();
-}
-

[Libreoffice-commits] core.git: filter/source include/filter include/oox include/sax oox/source sax/source sc/source

2023-01-14 Thread Justin Luth (via logerrit)
 filter/source/msfilter/eschesdo.cxx  |   18 +++---
 filter/source/msfilter/eschesdo.hxx  |2 +-
 include/filter/msfilter/escherex.hxx |2 +-
 include/oox/export/vmlexport.hxx |2 +-
 include/sax/fshelper.hxx |2 ++
 oox/source/export/vmlexport.cxx  |   11 +--
 sax/source/tools/fastserializer.hxx  |6 --
 sax/source/tools/fshelper.cxx|4 
 sc/source/filter/excel/xeescher.cxx  |4 +++-
 9 files changed, 36 insertions(+), 15 deletions(-)

New commits:
commit d50eca2a30bdabdc1735c590d6ec1913c6dd22fd
Author: Justin Luth 
AuthorDate: Thu Jan 12 11:18:55 2023 -0500
Commit: Justin Luth 
CommitDate: Sun Jan 15 02:09:06 2023 +

tdf#117266 sc oox: export vml button with a correct name

Without a correctly formatted ID, LO was unable to import
the shape into the spreadsheet. Now at least the button
shows up and can be pressed.

MS Word already showed the button before the patch,
so nothing there has changed. That suggests that our
problem may be more during import.

This code path is also followed by DOC and DOCX formats,
but they do completely different things with the results.
This is super nasty code...

Change-Id: I383736a7de9c3e94b427d5747e5949c0348dcecd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145509
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/filter/source/msfilter/eschesdo.cxx 
b/filter/source/msfilter/eschesdo.cxx
index fe16862df69a..8c39297f1e59 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -430,13 +430,17 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( 
ImplEESdrObject& rObj,
 }
 
 mpEscherEx->OpenContainer( ESCHER_SpContainer );
-if(bInline)
+nShapeType = bInline ? ESCHER_ShpInst_PictureFrame : 
ESCHER_ShpInst_HostControl;
+const ShapeFlag nFlags = ShapeFlag::HaveShapeProperty | 
ShapeFlag::HaveAnchor;
+nShapeID = rObj.GetShapeId();
+if (nShapeID)
 {
-addShape( ESCHER_ShpInst_PictureFrame, 
ShapeFlag::HaveShapeProperty | ShapeFlag::HaveAnchor );
+mpEscherEx->AddShape(nShapeType, nFlags, nShapeID );
+rSolverContainer.AddShape(rObj.GetShapeRef(), nShapeID);
 }
 else
 {
-addShape( ESCHER_ShpInst_HostControl, 
ShapeFlag::HaveShapeProperty | ShapeFlag::HaveAnchor );
+addShape(nShapeType, nFlags);
 }
 }
 else
@@ -946,9 +950,9 @@ void EscherEx::AddUnoShapes( const Reference< XShapes >& 
rxShapes, bool ooxmlExp
 mpImplEESdrWriter->ImplWriteCurrentPage(ooxmlExport);
 }
 
-sal_uInt32 EscherEx::AddSdrObject( const SdrObject& rObj, bool ooxmlExport )
+sal_uInt32 EscherEx::AddSdrObject(const SdrObject& rObj, bool ooxmlExport, 
sal_uInt32 nId)
 {
-ImplEESdrObject aObj( *mpImplEESdrWriter, rObj, mbOOXML );
+ImplEESdrObject aObj(*mpImplEESdrWriter, rObj, mbOOXML , nId);
 if( aObj.IsValid() )
 return mpImplEESdrWriter->ImplWriteTheShape( aObj, ooxmlExport );
 return 0;
@@ -995,8 +999,8 @@ const SdrObject* EscherEx::GetSdrObject( const Reference< 
XShape >& rShape )
 
 
 ImplEESdrObject::ImplEESdrObject( ImplEESdrWriter& rEx,
-const SdrObject& rObj, bool bOOXML ) :
-mnShapeId( 0 ),
+  const SdrObject& rObj, bool bOOXML, 
sal_uInt32 nId) :
+mnShapeId(nId),
 mnTextSize( 0 ),
 mnAngle( 0 ),
 mbValid( false ),
diff --git a/filter/source/msfilter/eschesdo.hxx 
b/filter/source/msfilter/eschesdo.hxx
index cf46f49b6bee..ae3fe91ec1cd 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -45,7 +45,7 @@ class ImplEESdrObject
 public:
 css::uno::Reference< css::beans::XPropertySet >   mXPropSet;
 
-ImplEESdrObject( ImplEESdrWriter& rEx, const SdrObject& rObj, bool bOOXML 
);
+ImplEESdrObject(ImplEESdrWriter& rEx, const SdrObject& rObj, bool bOOXML, 
sal_uInt32 nId = 0);
 ImplEESdrObject( const css::uno::Reference< css::drawing::XShape >& rShape 
);
 ~ImplEESdrObject();
 
diff --git a/include/filter/msfilter/escherex.hxx 
b/include/filter/msfilter/escherex.hxx
index ab8c30d7b2c4..d6727bce2c12 100644
--- a/include/filter/msfilter/escherex.hxx
+++ b/include/filter/msfilter/escherex.hxx
@@ -1162,7 +1162,7 @@ public:
 voidAddUnoShapes( const css::uno::Reference< css::drawing::XShapes >& 
rxShapes, bool ooxmlExport = false );
 
 /// returns the ShapeID
-sal_uInt32  AddSdrObject( const SdrObject& rObj, bool ooxmlExport = false 
);
+sal_uInt32  AddSdrObject(const SdrObject& rObj, bool ooxmlExport = false, 
sal_uInt32 nId = 0);
 virtual void  AddSdrObjectVMLObject( const SdrObject& 

[Libreoffice-commits] core.git: filter/source

2022-12-19 Thread Andras Timar (via logerrit)
 filter/source/pdf/impdialog.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 241cd824fdd4bf02f393633c1e19d24f2f35f1c0
Author: Andras Timar 
AuthorDate: Wed Dec 14 20:33:18 2022 +0100
Commit: Andras Timar 
CommitDate: Tue Dec 20 06:40:49 2022 +

lok: hide 'View PDF after export' checkbox in PDF export dialog

Change-Id: I866e4765ba88ca6c93375c9fecd51f22b79ce72e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144535
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 2d8a366ae868..4a03de89fdef 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -632,7 +632,15 @@ void 
ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
 
 mxCbExportNotes->set_active( pParent->mbExportNotes );
 mxCbExportNotesInMargin->set_active( pParent->mbExportNotesInMargin );
-mxCbViewPDF->set_active( pParent->mbViewPDF);
+if (comphelper::LibreOfficeKit::isActive())
+{
+mxCbViewPDF->hide();
+mxCbViewPDF->set_active(false);
+}
+else
+{
+   mxCbViewPDF->set_active(pParent->mbViewPDF);
+}
 
 if ( mbIsPresentation )
 {


[Libreoffice-commits] core.git: filter/source

2022-12-19 Thread Szymon Kłos (via logerrit)
 filter/source/pdf/impdialog.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 63eed8ff31311fc266791df48cc03a644f665b11
Author: Szymon Kłos 
AuthorDate: Wed Dec 14 09:18:11 2022 +0100
Commit: Andras Timar 
CommitDate: Tue Dec 20 06:40:11 2022 +

lok: hide signatures in PDF export dialog

Change-Id: Idd67e7ffe4dffc89555d75773501908165cbdd7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144149
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144513
Tested-by: Jenkins

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index a02412ac6caa..2d8a366ae868 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -250,7 +251,10 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, 
const Sequence< Property
 
 // queue the tab pages for later creation (created when first shown)
 AddTabPage("general", ImpPDFTabGeneralPage::Create, nullptr );
-AddTabPage("digitalsignatures", ImpPDFTabSigningPage::Create, nullptr);
+if (comphelper::LibreOfficeKit::isActive())
+m_xTabCtrl->remove_page("digitalsignatures");
+else
+AddTabPage("digitalsignatures", ImpPDFTabSigningPage::Create, nullptr);
 AddTabPage("security", ImpPDFTabSecurityPage::Create, nullptr);
 AddTabPage("links", ImpPDFTabLinksPage::Create, nullptr);
 AddTabPage("userinterface", ImpPDFTabViewerPage::Create, nullptr);


[Libreoffice-commits] core.git: filter/source include/LibreOfficeKit include/sfx2 include/svtools libreofficekit/source offapi/com sfx2/inc sfx2/source vcl/jsdialog

2022-12-19 Thread NickWingate (via logerrit)
 filter/source/pdf/impdialog.cxx  |7 
 filter/source/pdf/impdialog.hxx  |2 
 filter/source/pdf/pdfdialog.cxx  |   24 ++
 filter/source/pdf/pdfdialog.hxx  |   13 +
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   10 +
 include/sfx2/viewsh.hxx  |6 
 include/svtools/genericasyncunodialog.hxx|  132 ++
 libreofficekit/source/gtk/lokdocview.cxx |1 
 offapi/com/sun/star/document/PDFDialog.idl   |1 
 sfx2/inc/guisaveas.hxx   |   32 +++
 sfx2/source/doc/guisaveas.cxx|  246 +++
 sfx2/source/doc/objserv.cxx  |   15 +
 sfx2/source/view/ipclient.cxx|3 
 vcl/jsdialog/enabled.cxx |9 
 14 files changed, 419 insertions(+), 82 deletions(-)

New commits:
commit 89f5912ad2eee786508414791653a017206a7c04
Author: NickWingate 
AuthorDate: Thu Sep 22 09:02:42 2022 +0100
Commit: Andras Timar 
CommitDate: Tue Dec 20 03:11:16 2022 +

Async PDFExport dialog and parent methods

Filter dialogs are all called generically from
guisaveas.cxx in GUIStoreModel()

Signed-off-by: NickWingate 
Change-Id: Idfbe85c09f84d4a7cf3f00b9704d5af94868a051
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140403
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144511
Tested-by: Jenkins

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index fd68322f1a23..a02412ac6caa 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -541,6 +541,8 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(weld::Container* 
pPage, weld::DialogC
 
 ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage()
 {
+if (mxPasswordUnusedWarnDialog)
+mxPasswordUnusedWarnDialog->response(RET_CANCEL);
 }
 
 void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent)
@@ -871,10 +873,11 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, 
TogglePDFVersionOrUniversalAccessibilityHa
 // if a password was set, inform the user that this will not be used
 if (pSecPage && pSecPage->hasPassword())
 {
-std::unique_ptr 
xBox(Application::CreateMessageDialog(m_xContainer.get(),
+mxPasswordUnusedWarnDialog =
+
std::shared_ptr(Application::CreateMessageDialog(m_xContainer.get(),
   VclMessageType::Warning, 
VclButtonsType::Ok,
   
FilterResId(STR_WARN_PASSWORD_PDFA)));
-xBox->run();
+mxPasswordUnusedWarnDialog->runAsync(mxPasswordUnusedWarnDialog, 
[] (sal_uInt32){ });
 }
 }
 else
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 828422bdc63e..d0d63bccc86b 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -232,6 +232,8 @@ class ImpPDFTabGeneralPage : public SfxTabPage
 
 DECL_LINK(TogglePDFVersionOrUniversalAccessibilityHandle, 
weld::Toggleable&, void);
 
+std::shared_ptr mxPasswordUnusedWarnDialog;
+
 public:
 
 ImpPDFTabGeneralPage(weld::Container* pPage, weld::DialogController* 
pController, const SfxItemSet& rSet);
diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx
index 7c3e5dda1956..c036fc747b2a 100644
--- a/filter/source/pdf/pdfdialog.cxx
+++ b/filter/source/pdf/pdfdialog.cxx
@@ -62,6 +62,13 @@ std::unique_ptr 
PDFDialog::createDialog(const css::uno::
 return nullptr;
 }
 
+std::shared_ptr PDFDialog::createAsyncDialog(const 
css::uno::Reference& rParent)
+{
+if( mxSrcDoc.is() )
+return 
std::make_shared(Application::GetFrameWeld(rParent), 
maFilterData, mxSrcDoc);
+return nullptr;
+}
+
 void PDFDialog::executedDialog( sal_Int16 nExecutionResult )
 {
 if (nExecutionResult && m_xDialog)
@@ -69,6 +76,23 @@ void PDFDialog::executedDialog( sal_Int16 nExecutionResult )
 destroyDialog();
 }
 
+void PDFDialog::runAsync(const css::uno::Reference< 
css::ui::dialogs::XDialogClosedListener >& xListener)
+{
+SfxTabDialogController::runAsync(m_xAsyncDialog, [this, 
xListener](sal_Int32 nResponse) {
+executedAsyncDialog( m_xAsyncDialog, nResponse );
+css::ui::dialogs::DialogClosedEvent aEvent;
+aEvent.DialogResult = nResponse;
+xListener->dialogClosed( aEvent );
+destroyAsyncDialog();
+});
+}
+
+void PDFDialog::executedAsyncDialog( std::shared_ptr 
xAsyncDialog, sal_Int32 nExecutionResult )
+{
+if (nExecutionResult && xAsyncDialog)
+maFilterData = 
static_cast(xAsyncDialog.get())->GetFilterData();
+}
+
 Reference< XPropertySetInfo > SAL_CALL PDFDialog::getPropertySetInfo()
 {
 Reference< XPropertySetInfo >  xInfo( createPropertySetInfo( 
getInfoHelper() ) );
diff --git 

[Libreoffice-commits] core.git: filter/source include/filter

2022-12-19 Thread Caolán McNamara (via logerrit)
 filter/source/msfilter/msdffimp.cxx  |   38 ++-
 include/filter/msfilter/msdffimp.hxx |2 +
 2 files changed, 39 insertions(+), 1 deletion(-)

New commits:
commit d968061f008b954f55ab9a4dd51efd5d0844b543
Author: Caolán McNamara 
AuthorDate: Mon Dec 19 11:04:59 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Dec 19 16:37:15 2022 +

crashtesting: asserts with outsized object positions

seen during import of:
forums/forum-mso-en4-187408.xls
forums/forum-mso-en4-187900.xls
forums/forum-mso-en4-187890.xls

Change-Id: Id15e9c1ea98d761225d41850b9b2aa58d9c9e407
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144466
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/msfilter/msdffimp.cxx 
b/filter/source/msfilter/msdffimp.cxx
index fe5cd766811b..cdcad2778f6f 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -54,8 +54,9 @@
 // SvxItem-Mapping. Is needed to successfully include the SvxItem-Header
 #include 
 #include 
-#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3152,7 +3153,22 @@ bool CompareSvxMSDffShapeInfoByTxBxComp::operator() (
 void SvxMSDffManager::Scale( sal_Int32& rVal ) const
 {
 if ( bNeedMap )
+{
+if (rVal > nMaxAllowedVal)
+{
+SAL_WARN("filter.ms", "Cannot scale value: " << rVal);
+rVal = SAL_MAX_INT32;
+return;
+}
+else if (rVal < nMinAllowedVal)
+{
+SAL_WARN("filter.ms", "Cannot scale value: " << rVal);
+rVal = SAL_MAX_INT32;
+return;
+}
+
 rVal = BigMulDiv( rVal, nMapMul, nMapDiv );
+}
 }
 
 void SvxMSDffManager::Scale( Point& rPos ) const
@@ -3235,6 +3251,26 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, 
tools::Long nApplicationScale)
 nMapMul = nMapDiv = nMapXOfs = nMapYOfs = nEmuMul = nEmuDiv = nPntMul 
= nPntDiv = 0;
 bNeedMap = false;
 }
+
+if (bNeedMap)
+{
+assert(nMapMul > nMapDiv);
+
+BigInt aMinVal(SAL_MIN_INT32);
+aMinVal /= nMapMul;
+aMinVal *= nMapDiv;
+nMinAllowedVal = aMinVal;
+
+BigInt aMaxVal(SAL_MAX_INT32);
+aMaxVal /= nMapMul;
+aMaxVal *= nMapDiv;
+nMaxAllowedVal = aMaxVal;
+}
+else
+{
+nMinAllowedVal = SAL_MIN_INT32;
+nMaxAllowedVal = SAL_MAX_INT32;
+}
 }
 
 bool SvxMSDffManager::SeekToShape( SvStream& rSt, SvxMSDffClientData* /* 
pClientData */, sal_uInt32 nId ) const
diff --git a/include/filter/msfilter/msdffimp.hxx 
b/include/filter/msfilter/msdffimp.hxx
index da1dc29fe442..7f2c5a2763d0 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -455,6 +455,8 @@ protected:
 tools::LongnPntMul;
 tools::LongnPntDiv;
 boolbNeedMap;
+sal_Int32   nMinAllowedVal;
+sal_Int32   nMaxAllowedVal;
 sal_uInt32  nSvxMSDffSettings;
 sal_uInt32  nSvxMSDffOLEConvFlags;
 


[Libreoffice-commits] core.git: filter/source

2022-11-24 Thread Stephan Bergmann (via logerrit)
 filter/source/xsltfilter/XSLTFilter.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8467aa93e2038b3030e1add94e0ca6cc4ad44032
Author: Stephan Bergmann 
AuthorDate: Wed Nov 23 15:59:08 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Nov 24 10:54:25 2022 +0100

Replace a dynamic_cast with UNO_QUERY

Change-Id: Id50f09150fc2c235787c51361d00416119e11937
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143201
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/filter/source/xsltfilter/XSLTFilter.cxx 
b/filter/source/xsltfilter/XSLTFilter.cxx
index 0eb4c863b24f..8ebbd874ed1e 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -366,8 +366,8 @@ namespace XSLT
 aInput.sPublicId = aURL;
 aInput.aInputStream = pipein;
 
-css::uno::Reference< css::xml::sax::XFastParser > 
xFastParser = dynamic_cast<
-css::xml::sax::XFastParser* >( xHandler.get() );
+css::uno::Reference< css::xml::sax::XFastParser > 
xFastParser(
+xHandler, css::uno::UNO_QUERY );
 
 // transform
 m_tcontrol->start();


[Libreoffice-commits] core.git: filter/source

2022-11-22 Thread Caolán McNamara (via logerrit)
 filter/source/pdf/impdialog.cxx |6 --
 filter/source/pdf/impdialog.hxx |1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 5d9b8c367e70ac0a11f368ea702967ee4e0d5f06
Author: Caolán McNamara 
AuthorDate: Mon Nov 21 17:03:00 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 22 14:13:29 2022 +0100

tdf#152150 make AccessibilityCheckDialog modal when child of modal pdf 
dialog

Change-Id: If6ff13d17a5ead40d9694ea861dc8946c201147e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143044
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 746302877ae9..16b4b8a00616 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -52,7 +52,6 @@ ImpPDFTabDialog::ImpPDFTabDialog(weld::Window* pParent, const 
Sequence< Property
 const Reference< XComponent >& rxDoc)
 : SfxTabDialogController(pParent, "filter/ui/pdfoptionsdialog.ui", 
"PdfOptionsDialog"),
 mrDoc(rxDoc),
-mpParent(pParent),
 maConfigItem( u"Office.Common/Filter/PDF/Export/",  ),
 maConfigI18N( u"Office.Common/I18N/CTL/" ),
 mbIsPresentation( false ),
@@ -319,9 +318,10 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, OkHdl, weld::Button&, 
void)
 if (!aCollection.getIssues().empty())
 {
 mpAccessibilityCheckDialog = 
std::make_shared(
-mpParent, aCollection, [pShell]() -> 
sfx::AccessibilityIssueCollection {
+m_xDialog.get(), aCollection, [pShell]() -> 
sfx::AccessibilityIssueCollection {
 return pShell->runAccessibilityCheck();
 });
+mpAccessibilityCheckDialog->getDialog()->set_modal(true);
 weld::DialogController::runAsync(mpAccessibilityCheckDialog, 
[this](sal_Int32 retValue){
 m_xDialog->response(retValue);
 });
@@ -348,6 +348,8 @@ ImpPDFTabDialog::~ImpPDFTabDialog()
 maConfigI18N.WriteModifiedConfig();
 if (mpAccessibilityCheckDialog)
 {
+// restore set_modal to its original state
+mpAccessibilityCheckDialog->getDialog()->set_modal(false);
 mpAccessibilityCheckDialog->response(RET_CANCEL);
 }
 }
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 5063f91ee635..9dc97d653e37 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -59,7 +59,6 @@ class ImpPDFTabLinksPage;
 class ImpPDFTabDialog final : public SfxTabDialogController
 {
 css::uno::Reference mrDoc;
-weld::Window* mpParent;
 
 FilterConfigItemmaConfigItem;
 FilterConfigItemmaConfigI18N;


[Libreoffice-commits] core.git: filter/source sd/qa

2022-11-22 Thread Marco Cecchetti (via logerrit)
 filter/source/svg/presentation_engine.js |  141 ---
 filter/source/svg/svgexport.cxx  |   12 +-
 filter/source/svg/svgwriter.cxx  |   41 +++--
 sd/qa/unit/SVGExportTests.cxx|   18 +--
 4 files changed, 86 insertions(+), 126 deletions(-)

New commits:
commit 7dd9790b89da12b1eeb635ee590fec04c4f20e0b
Author: Marco Cecchetti 
AuthorDate: Mon Nov 21 16:43:34 2022 +0100
Commit: Andras Timar 
CommitDate: Tue Nov 22 12:15:41 2022 +0100

svg export filter: text fields not handled correctly

New solution for fixing text field issues:

- small text field are not substituted with the right content because
the placeholder text span several lines
- copy of standard text fields embedded in the default master page are
not substitute with the right content.

Change-Id: Ifc8773f1ba41f9d0fe6f6ef3982cb64a514fcec7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143045
Reviewed-by: Andras Timar 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143051
Tested-by: Jenkins

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index c7cef8edd87f..08fdb283d60b 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -4464,13 +4464,13 @@ var aOOOAttrTextAdjust = 'text-adjust';
 // element class names
 var aClipPathGroupClassName = 'ClipPathGroup';
 var aPageClassName = 'Page';
-var aSlideNumberClassName = 'Slide_Number';
-var aDateTimeClassName = 'Date/Time';
+var aSlideNumberClassName = 'PageNumber';
+var aDateTimeClassName = 'DateTime';
 var aFooterClassName = 'Footer';
 var aHeaderClassName = 'Header';
 var aDateClassName = 'Date';
 var aTimeClassName = 'Time';
-var aSlideNameClassName='SlideName';
+var aSlideNameClassName='PageName';
 
 // Creating a namespace dictionary.
 var NSS = {};
@@ -4785,15 +4785,6 @@ function getRandomInt( nMax )
 return Math.floor( Math.random() * nMax );
 }
 
-function isTextFieldElement( aElement ) // eslint-disable-line no-unused-vars
-{
-var sClassName = aElement.getAttribute( 'class' );
-return ( sClassName === aSlideNumberClassName ) ||
-   ( sClassName === aFooterClassName ) ||
-   ( sClassName === aHeaderClassName ) ||
-   ( sClassName === aDateTimeClassName );
-}
-
 
 /*
  ** Debug Utilities **
@@ -5192,10 +5183,11 @@ initPlaceholderElements : function()
 for( ; i < aPlaceholderList.length; ++i )
 {
 var aPlaceholderElem = aPlaceholderList[i];
-var sContent = aPlaceholderElem.textContent;
-if( sContent === '' )
+var sClass = aPlaceholderElem.getAttribute('class');
+var sFieldType = sClass.split(' ')[1];
+if( sFieldType ===  aDateClassName)
 aPlaceholderElem.textContent = new Date().toLocaleDateString();
-else if( sContent === '' )
+else if( sFieldType === aTimeClassName )
 aPlaceholderElem.textContent = new Date().toLocaleTimeString();
 }
 },
@@ -5376,53 +5368,43 @@ getSlideAnimationsRoot : function()
 
 }; // end MetaSlide prototype
 
-function getTextFieldType ( elem )
+function removeRedundantParagraphFromTextFieldShape( aObject )
 {
-var sFieldType = null;
-var sClass = elem.getAttribute('class');
-if( sClass == 'TextShape' )
+var aTextElem = getElementByClassName( aObject, 'SVGTextShape' );
+if( aTextElem )
 {
-var aPlaceholderElement = getElementByClassName( elem, 
'PlaceholderText' );
-if (aPlaceholderElement)
+var aPlaceholderElement = getElementsByClassName(aTextElem, 
'PlaceholderText');
+if( aPlaceholderElement )
 {
-var sContent = aPlaceholderElement.textContent
-if (sContent === '')
-sFieldType = aSlideNumberClassName;
-else if (sContent === '')
-sFieldType = aDateTimeClassName;
-else if (sContent === '')
-sFieldType = aDateClassName;
-else if (sContent === '')
-sFieldType = aTimeClassName;
-else if (sContent === '')
-sFieldType = aSlideNameClassName;
-else if (sContent === '')
-sFieldType = aFooterClassName;
-else if (sContent === '')
-sFieldType = aHeaderClassName;
+var aTextParagraphSet = getElementsByClassName(aTextElem, 
'TextParagraph');
+// When the text field width is too small, the placeholder text 
spans several lines.
+// We remove all text lines but the first one which is used as a 
placeholder.
+// This is a workaround but it should work in the majority of 
cases.
+// A complete solution needs to support svg text wrapping.
+if( aTextParagraphSet.length > 1 )
+{
+var i = 

[Libreoffice-commits] core.git: filter/source

2022-11-22 Thread Marco Cecchetti (via logerrit)
 filter/source/svg/presentation_engine.js |   37 +++
 1 file changed, 37 insertions(+)

New commits:
commit bbe4161818e2ec6652ec443a67951b318c9f0e21
Author: Marco Cecchetti 
AuthorDate: Tue Nov 15 10:56:15 2022 +0100
Commit: Andras Timar 
CommitDate: Tue Nov 22 12:15:24 2022 +0100

svg export filter: when a text field is too small, its content is wrong

When the text field width is too small, the placeholder text spans
several lines.
That stopped the js engine to substitute the text field placeholder
with the right content.
This is a workaround but it should work in the majority of cases.
A complete solution needs to support svg text wrapping.

Change-Id: Ide52e08acd35b3764b8abc600e4b467acea0a248
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142760
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143050
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index 160f5515caf4..c7cef8edd87f 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5401,6 +5401,29 @@ function getTextFieldType ( elem )
 else if (sContent === '')
 sFieldType = aHeaderClassName;
 }
+
+if( sFieldType )
+return sFieldType;
+
+var aTextPortionElement = getElementByClassName( elem, 'TextPortion' );
+if( aTextPortionElement )
+{
+var sContent = aTextPortionElement.textContent
+if( sContent.indexOf( '' ) != -1 )
+sFieldType = aSlideNumberClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aDateTimeClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aDateClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aTimeClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aSlideNameClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aFooterClassName;
+else if( sContent.indexOf( '' ) != -1 )
+sFieldType = aHeaderClassName;
+}
 }
 return sFieldType;
 }
@@ -5610,6 +5633,20 @@ PlaceholderShape.prototype.init = function()
 var aTextElem = getElementByClassName( aTextFieldElement, 
'SVGTextShape' );
 if( aTextElem )
 {
+var aTextParagraphSet = getElementsByClassName( aTextElem, 
'TextParagraph' );
+// When the text field width is too small, the placeholder text 
spans several lines.
+// We remove all text lines but the first one which is used as a 
placeholder.
+// This is a workaround but it should work in the majority of 
cases.
+// A complete solution needs to support svg text wrapping.
+if( aTextParagraphSet.length > 1 )
+{
+var i = aTextParagraphSet.length;
+while( i > 1 )
+{
+aTextElem.removeChild(aTextParagraphSet[i-1]);
+--i;
+}
+}
 var aPlaceholderElement = getElementByClassName(aTextElem, 
'PlaceholderText');
 if( aPlaceholderElement )
 {


[Libreoffice-commits] core.git: filter/source

2022-11-22 Thread Marco Cecchetti (via logerrit)
 filter/source/svg/presentation_engine.js |   25 +++-
 filter/source/svg/svgexport.cxx  |   46 +--
 2 files changed, 37 insertions(+), 34 deletions(-)

New commits:
commit 0abbef139f3147a9728fb22133bc2350d28b555e
Author: Marco Cecchetti 
AuthorDate: Mon Nov 14 18:18:23 2022 +0100
Commit: Andras Timar 
CommitDate: Tue Nov 22 12:15:07 2022 +0100

svg export filter: footer was not replaced with the right content

When a user create a copy of the footer text field which can be
included in a master page, the copy content was kept to the text
placeholder instead of being substituted with the right content.

Change-Id: I411349026e41d49b606cdae5d13d990d0fa0b07c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142759
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Marco Cecchetti 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143049
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index 1e22be233b7a..160f5515caf4 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5388,12 +5388,18 @@ function getTextFieldType ( elem )
 var sContent = aPlaceholderElement.textContent
 if (sContent === '')
 sFieldType = aSlideNumberClassName;
+else if (sContent === '')
+sFieldType = aDateTimeClassName;
 else if (sContent === '')
 sFieldType = aDateClassName;
 else if (sContent === '')
 sFieldType = aTimeClassName;
 else if (sContent === '')
 sFieldType = aSlideNameClassName;
+else if (sContent === '')
+sFieldType = aFooterClassName;
+else if (sContent === '')
+sFieldType = aHeaderClassName;
 }
 }
 return sFieldType;
@@ -5401,8 +5407,8 @@ function getTextFieldType ( elem )
 
 function isTextFieldByClassName ( sClassName )
 {
-return sClassName === aDateTimeClassName || sClassName === aFooterClassName
-|| sClassName === aHeaderClassName || sClassName.indexOf( 
aSlideNumberClassName ) == 0
+return sClassName.indexOf( aDateTimeClassName ) == 0 || 
sClassName.indexOf( aFooterClassName ) == 0
+|| sClassName.indexOf( aHeaderClassName ) == 0 || sClassName.indexOf( 
aSlideNumberClassName ) == 0
 || sClassName.indexOf( aDateClassName ) == 0 || sClassName.indexOf( 
aTimeClassName ) == 0
 || sClassName.indexOf( aSlideNameClassName ) == 0;
 }
@@ -5882,7 +5888,10 @@ MasterPageView.prototype.createElement = function()
aTextFieldHandlerSet, 
sMasterSlideId );
 }
 }
-else if( sId.indexOf( aDateClassName ) == 0
+else if( sId.indexOf( aDateTimeClassName ) == 0
+|| sId.indexOf( aFooterClassName ) == 0
+|| sId.indexOf( aHeaderClassName ) == 0
+|| sId.indexOf( aDateClassName ) == 0
 || sId.indexOf( aTimeClassName ) == 0
 || sId.indexOf( aSlideNameClassName ) == 0 )
 {
@@ -5922,21 +5931,21 @@ MasterPageView.prototype.initTextFieldHandler =
 if( aPlaceholderShape  && aPlaceholderShape.isValid()
 && aTextFieldContentProvider )
 {
-var sTextFieldContentProviderId = aTextFieldContentProvider.sId;
+var sTextFiedHandlerKey = aTextFieldContentProvider.sId + '.' + sId;
 // We create only one single TextFieldHandler object (and so one only
 // text field clone) per master slide and text content.
-if ( !aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFieldContentProviderId ] )
+if ( !aTextFieldHandlerSet[ sMasterSlideId ][ sTextFiedHandlerKey ] )
 {
-aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFieldContentProviderId ] =
+aTextFieldHandlerSet[ sMasterSlideId ][ sTextFiedHandlerKey ] =
 new TextFieldHandler( aPlaceholderShape,
   aTextFieldContentProvider );
-aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFieldContentProviderId ];
+aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFiedHandlerKey ];
 aTextFieldHandler.update();
 aTextFieldHandler.appendTo( aDefsElement );
 }
 else
 {
-aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFieldContentProviderId ];
+aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ 
sTextFiedHandlerKey ];
 }
 sRefId = aTextFieldHandler.sId;
 }
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index fbf48565823a..ee80602c21ff 100644
--- a/filter/source/svg/svgexport.cxx
+++ 

[Libreoffice-commits] core.git: filter/source

2022-11-22 Thread Mike Kaganski (via logerrit)
 filter/source/svg/gentoken.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit aa0c9eb6bd91126eebe1eb2444b024572b740a6a
Author: Mike Kaganski 
AuthorDate: Tue Nov 22 12:10:14 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Nov 22 12:05:08 2022 +0100

tokens.gperf: Use LF line endings also on Windows

This fixes the warnings during the build:

  
C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/workdir/CustomTarget/filter/source/svg/tokens.gperf:9:
 warning: junk after %% is ignored
  unsupported language option C++
  , defaulting to ANSI-C
  
C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/workdir/CustomTarget/filter/source/svg/tokens.gperf:2:
 junk after declaration

This is https://savannah.gnu.org/bugs/?53732, and is expected to be fixed in

http://git.savannah.gnu.org/gitweb/?p=gperf.git;a=commitdiff;h=13c9383b10872525688ef2b4daab090037ea3576
However, the last gperf release is still 3.1 from 2017, and has not that fix
included. Since we use Python 3.x, it is OK to just use 'newline' argument
in the open call.

Change-Id: I33585d1cc698eb55e353adbc684a83c1e0156507
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143095
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/filter/source/svg/gentoken.py b/filter/source/svg/gentoken.py
index c78d066d7c97..2ef75fe5dd80 100644
--- a/filter/source/svg/gentoken.py
+++ b/filter/source/svg/gentoken.py
@@ -37,7 +37,7 @@ with open(tokenfile_name) as tokenfile:
tokens[arr[0]] = arr[1].upper()
 
 hxx = open(hxx_name, 'w')
-gperf = open(gperf_name, 'w')
+gperf = open(gperf_name, 'w', newline='\n')
 
 gperf.write(gperf_header)
 


[Libreoffice-commits] core.git: filter/source include/svx include/vcl svx/source svx/uiconfig sw/source

2022-11-18 Thread Samuel Mehrbrodt (via logerrit)
 filter/source/pdf/impdialog.cxx|5 -
 include/svx/AccessibilityCheckDialog.hxx   |9 -
 include/vcl/weld.hxx   |3 ++-
 svx/source/dialog/AccessibilityCheckDialog.cxx |   25 ++---
 svx/uiconfig/ui/accessibilitycheckdialog.ui|   20 +---
 sw/source/uibase/shells/basesh.cxx |9 -
 6 files changed, 61 insertions(+), 10 deletions(-)

New commits:
commit 950bd818eb37e79c2276ce919f90d177255d5520
Author: Samuel Mehrbrodt 
AuthorDate: Mon Nov 14 16:23:30 2022 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Fri Nov 18 09:06:55 2022 +0100

tdf#148999 Add rescan button to PDF a11y check dialog

Change-Id: I772f529ea4bd225701b9864ad9156c573f41484c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142715
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index eaa3385ab16f..2287dc8665dc 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -318,7 +318,10 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, OkHdl, weld::Button&, 
void)
 sfx::AccessibilityIssueCollection aCollection = 
pShell->runAccessibilityCheck();
 if (!aCollection.getIssues().empty())
 {
-mpAccessibilityCheckDialog = 
std::make_shared(mpParent, aCollection);
+mpAccessibilityCheckDialog = 
std::make_shared(
+mpParent, aCollection, [pShell]() -> 
sfx::AccessibilityIssueCollection {
+return pShell->runAccessibilityCheck();
+});
 weld::DialogController::runAsync(mpAccessibilityCheckDialog, 
[this](sal_Int32 retValue){
 m_xDialog->response(retValue);
 });
diff --git a/include/svx/AccessibilityCheckDialog.hxx 
b/include/svx/AccessibilityCheckDialog.hxx
index 53fcdaf4a031..f2e3c567351b 100644
--- a/include/svx/AccessibilityCheckDialog.hxx
+++ b/include/svx/AccessibilityCheckDialog.hxx
@@ -41,14 +41,21 @@ class SVX_DLLPUBLIC AccessibilityCheckDialog final : public 
weld::GenericDialogC
 {
 private:
 sfx::AccessibilityIssueCollection m_aIssueCollection;
+std::function m_getIssueCollection;
 std::vector> 
m_aAccessibilityCheckEntries;
 
 // Controls
 std::unique_ptr m_xAccessibilityCheckBox;
+std::unique_ptr m_xRescanBtn;
+
+DECL_LINK(RescanButtonClicked, weld::Button&, void);
+
+void populateIssues();
 
 public:
 AccessibilityCheckDialog(weld::Window* pParent,
- sfx::AccessibilityIssueCollection 
rIssueCollection);
+ sfx::AccessibilityIssueCollection 
rIssueCollection,
+ 
std::function getIssueCollection);
 virtual ~AccessibilityCheckDialog() override;
 };
 
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index adbd35d85df6..b024bc33c4af 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -361,7 +361,8 @@ protected:
 void signal_container_focus_changed() { 
m_aContainerFocusChangedHdl.Call(*this); }
 
 public:
-// remove and add in one go
+// remove from old container and add to new container in one go
+// new container can be null to just remove from old container
 virtual void move(weld::Widget* pWidget, weld::Container* pNewParent) = 0;
 // create an XWindow as a child of this container. The XWindow is
 // suitable to contain css::awt::XControl items
diff --git a/svx/source/dialog/AccessibilityCheckDialog.cxx 
b/svx/source/dialog/AccessibilityCheckDialog.cxx
index 136bafc265bf..ac34f7306da4 100644
--- a/svx/source/dialog/AccessibilityCheckDialog.cxx
+++ b/svx/source/dialog/AccessibilityCheckDialog.cxx
@@ -36,14 +36,25 @@ IMPL_LINK_NOARG(AccessibilityCheckEntry, GotoButtonClicked, 
weld::Button&, void)
 }
 
 AccessibilityCheckDialog::AccessibilityCheckDialog(
-weld::Window* pParent, sfx::AccessibilityIssueCollection aIssueCollection)
+weld::Window* pParent, sfx::AccessibilityIssueCollection aIssueCollection,
+std::function getIssueCollection)
 : GenericDialogController(pParent, "svx/ui/accessibilitycheckdialog.ui",
   "AccessibilityCheckDialog")
 , m_aIssueCollection(std::move(aIssueCollection))
+, m_getIssueCollection(getIssueCollection)
 , m_xAccessibilityCheckBox(m_xBuilder->weld_box("accessibilityCheckBox"))
+, m_xRescanBtn(m_xBuilder->weld_button("rescan"))
 {
-sal_Int32 i = 0;
+m_xRescanBtn->connect_clicked(LINK(this, AccessibilityCheckDialog, 
RescanButtonClicked));
+
+populateIssues();
+}
 
+AccessibilityCheckDialog::~AccessibilityCheckDialog() {}
+
+void AccessibilityCheckDialog::populateIssues()
+{
+sal_Int32 i = 0;
 for (std::shared_ptr const& pIssue : 
m_aIssueCollection.getIssues())
 {
 auto xEntry
@@ -53,7 +64,15 @@ 

[Libreoffice-commits] core.git: filter/source

2022-11-05 Thread Stephan Bergmann (via logerrit)
 filter/source/t602/t602filter.cxx |   19 +++
 1 file changed, 7 insertions(+), 12 deletions(-)

New commits:
commit d45d1e14d75b58323e3486c3ca3dfd2866e08bdb
Author: Stephan Bergmann 
AuthorDate: Sat Nov 5 15:58:27 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Sat Nov 5 18:27:01 2022 +0100

-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): filter

Change-Id: Ia69631701e2f1f5d61fda8ce6a7f7fc76ecc6e3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142326
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/filter/source/t602/t602filter.cxx 
b/filter/source/t602/t602filter.cxx
index f2c5ed49bd1a..f26875347023 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -20,8 +20,6 @@
 #include "t602filter.hxx"
 #include 
 
-#include 
-
 #include 
 #include 
 #include 
@@ -210,10 +208,8 @@ void T602ImportFilter::inschr(unsigned char ch)
 inschrdef(' ');
 pst.wasfdash = false;
 } else {
-char s[20];
-sprintf(s,"%i",pst.wasspace);
 if (mpAttrList)
-
mpAttrList->AddAttribute("text:c",OUString::createFromAscii(s));
+
mpAttrList->AddAttribute("text:c",OUString::number(pst.wasspace));
 Start_("text:s");
 End_("text:s");
 }
@@ -249,9 +245,8 @@ bool T602ImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >&
 Reference < XImporter > xImporter(mxHandler, UNO_QUERY);
 xImporter->setTargetDocument(mxDoc);
 
-char fs[32], fs2[32];
-sprintf(fs, "%ipt", inistruct::fontsize);
-sprintf(fs2,"%ipt", 2*inistruct::fontsize);
+auto const fs = OUString(OUString::number(inistruct::fontsize) + "pt");
+auto const fs2 = OUString(OUString::number(2*inistruct::fontsize) + "pt");
 
 mpAttrList = new SvXMLAttributeList;
 
@@ -293,7 +288,7 @@ bool T602ImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >&
 mpAttrList->AddAttribute("style:parent-style-name","Standard");
 Start_("style:style");
 mpAttrList->AddAttribute("style:font-name","Courier New");
-mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs));
+mpAttrList->AddAttribute("fo:font-size",fs);
 Start_("style:properties");
 End_("style:properties");
 End_("style:style");
@@ -304,7 +299,7 @@ bool T602ImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >&
 mpAttrList->AddAttribute("style:parent-style-name","Standard");
 Start_("style:style");
 mpAttrList->AddAttribute("style:font-name","Courier New");
-mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs));
+mpAttrList->AddAttribute("fo:font-size",fs);
 mpAttrList->AddAttribute("fo:break-before","page");
 Start_("style:properties");
 End_("style:properties");
@@ -350,7 +345,7 @@ bool T602ImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >&
 mpAttrList->AddAttribute("style:name","T5");
 mpAttrList->AddAttribute("style:family","text");
 Start_("style:style");
-mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs2));
+mpAttrList->AddAttribute("fo:font-size",fs2);
 mpAttrList->AddAttribute("fo:font-weight","bold");
 mpAttrList->AddAttribute("style:text-scale","50%");
 Start_("style:properties");
@@ -361,7 +356,7 @@ bool T602ImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >&
 mpAttrList->AddAttribute("style:name","T6");
 mpAttrList->AddAttribute("style:family","text");
 Start_("style:style");
-mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs2));
+mpAttrList->AddAttribute("fo:font-size",fs2);
 mpAttrList->AddAttribute("fo:font-weight","bold");
 Start_("style:properties");
 End_("style:properties");


[Libreoffice-commits] core.git: filter/source

2022-11-04 Thread Caolán McNamara (via logerrit)
 filter/source/msfilter/svdfppt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e126c98bf8ca4be6f4f8018446ab0d6060d731d5
Author: Caolán McNamara 
AuthorDate: Fri Nov 4 14:49:13 2022 +
Commit: Caolán McNamara 
CommitDate: Fri Nov 4 18:38:35 2022 +0100

ofz#53016 Undefined-shift

before commit 4b95451f859bac8e05956ce12df17f1ee410032d
Date:   Wed Sep 21 20:54:00 2022 +0200

split utl::TempFile into fast and named variants

which makes it easier to know what each variant requires
to stay on it's happy path

we closed the writable stream and got another readonly stream, after
that commit we have a read-write stream. With the "true" arg to
Storage it will Commit back to the underlying storage its contents
in its dtor. With a ReadOnly stream this failed and nothing happened,
with a read-write stream there is a write which didn't happen with a
read-only one.

Lets just use false here, we're not interested in keeping the contents.

"Direct" in this context is presumably analogous to the Compound
File Format "Direct mode":

"The mode in which files are accessed, either transacted or direct,
determines when changes are committed.

Transacted mode uses a two-phase commit operation to make changes to
objects in a compound file, thereby keeping both the old and the new
copies of the document available until the user chooses to either save
or undo the changes.

Direct mode incorporates changes to the document as they are made,
without the ability to later undo them.

For more information about access modes, see the OLE Programmer's 
Reference."

Change-Id: I1f710de227807073a6aff11a86d7cfaf6d380509
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142283
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index 3020083756a0..cb6381fb6fd3 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1855,7 +1855,7 @@ rtl::Reference SdrPowerPointImport::ImportOLE( 
sal_uInt32 nOLEId,
 if ( bSuccess )
 {
 pDest->Seek(0);
-Storage* pObjStor = new Storage(*pDest, true);
+Storage* pObjStor = new Storage(*pDest, false);
 tools::SvRef xObjStor( new SotStorage( pObjStor ) 
);
 if ( xObjStor.is() && !xObjStor->GetError() )
 {


[Libreoffice-commits] core.git: filter/source include/svx sd/qa svx/source

2022-11-04 Thread Ashod Nakashian (via logerrit)
 filter/source/svg/svgwriter.cxx   |   46 +++---
 include/svx/svdomedia.hxx |3 +
 sd/qa/unit/SVGExportTests.cxx |   35 +++
 sd/qa/unit/data/odp/slide-video-thumbnail.odp |binary
 svx/source/svdraw/svdomedia.cxx   |   10 +
 5 files changed, 90 insertions(+), 4 deletions(-)

New commits:
commit f994f4312d8e166e79b36f7bf0f8c41c3f1082f4
Author: Ashod Nakashian 
AuthorDate: Sun Oct 23 17:56:50 2022 -0400
Commit: Miklos Vajna 
CommitDate: Fri Nov 4 08:28:25 2022 +0100

svg: export embedded video

Change-Id: Ie5dcd1fb4abbaf53f48107e7def0f42daad24596
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142145
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index fb0193e15418..14e355f3916e 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -2997,12 +2998,49 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& 
rBmpEx,
 mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrWidth, 
OUString::number( aSz.Width() ) );
 mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrHeight, 
OUString::number( aSz.Height() ) );
 
-// the image must be scaled to aSz in a non-uniform way
-mrExport.AddAttribute( XML_NAMESPACE_NONE, "preserveAspectRatio", "none" );
+// If we have a media object (a video), export the video.
+// Also, use the image generated above as the video poster (thumbnail).
+SdrMediaObj* pMediaObj
+= pShape ? 
dynamic_cast(SdrObject::getSdrObjectFromXShape(*pShape)) : 
nullptr;
+const bool embedVideo = (pMediaObj && !pMediaObj->getTempURL().isEmpty());
 
-mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrXLinkHRef, 
aBuffer.makeStringAndClear() );
+if (!embedVideo)
 {
-SvXMLElementExport aElem( mrExport, XML_NAMESPACE_NONE, "image", true, 
true );
+// the image must be scaled to aSz in a non-uniform way
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "preserveAspectRatio", 
"none");
+
+mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrXLinkHRef, 
aBuffer.makeStringAndClear());
+
+SvXMLElementExport aElem(mrExport, XML_NAMESPACE_NONE, "image", true, 
true);
+}
+else
+{
+// http://www.w3.org/2000/svg; 
overflow="visible" width="499.6" height="374.37" x="705" y="333">
+// http://www.w3.org/1999/xhtml;>
+// 
+// 
+// 
+// 
+// 
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "xmlns", 
"http://www.w3.org/2000/svg;);
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "overflow", "visible");
+SvXMLElementExport aForeignObject(mrExport, XML_NAMESPACE_NONE, 
"foreignObject", true,
+  true);
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "xmlns", 
"http://www.w3.org/1999/xhtml;);
+SvXMLElementExport aBody(mrExport, XML_NAMESPACE_NONE, "body", true, 
true);
+
+mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrWidth, 
OUString::number(aSz.Width()));
+mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrHeight, 
OUString::number(aSz.Height()));
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "autoplay", "autoplay");
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "controls", "controls");
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "loop", "loop");
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "preload", "auto");
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "poster", 
aBuffer.makeStringAndClear());
+SvXMLElementExport aVideo(mrExport, XML_NAMESPACE_NONE, "video", true, 
true);
+
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "src", 
pMediaObj->getTempURL());
+mrExport.AddAttribute(XML_NAMESPACE_NONE, "type", "video/mp4"); 
//FIXME: set mime type.
+SvXMLElementExport aSource(mrExport, XML_NAMESPACE_NONE, "source", 
true, true);
 }
 }
 
diff --git a/include/svx/svdomedia.hxx b/include/svx/svdomedia.hxx
index 6199fcaffe5b..6f08611a7002 100644
--- a/include/svx/svdomedia.hxx
+++ b/include/svx/svdomedia.hxx
@@ -61,6 +61,9 @@ public:
 voidsetURL( const OUString& rURL, const 
OUString& rReferer, const OUString& rMimeType = OUString() );
 const OUString&  getURL() const;
 
+/// Returns the URL to the temporary extracted media file.
+const OUString&  getTempURL() const;
+
 voidsetMediaProperties( const 
::avmedia::MediaItem& rState );
 const ::avmedia::MediaItem& getMediaProperties() const;
 
diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index 9dfe60abfd82..1f973645142a 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ 

[Libreoffice-commits] core.git: filter/source include/vcl vcl/source

2022-10-25 Thread Noel Grandin (via logerrit)
 filter/source/pdf/pdffilter.cxx |5 +
 include/vcl/glyphitemcache.hxx  |7 +++
 vcl/source/gdi/impglyphitem.cxx |9 -
 3 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit d1b7d7a8d16d222536534ccf92576ed1eb05e1a8
Author: Noel Grandin 
AuthorDate: Tue Oct 25 11:16:47 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Oct 25 15:04:17 2022 +0200

tdf#126788 speed up export to pdf of complex table document

Shaves another 20% off the export time, bringing us to roughly the same
time as before commit
commit 4fc3466d23010d9553c31c662650072483b81588
Date:   Thu Apr 14 09:19:35 2022 +0200
do not cache layout glyphs if fallback is involved

Change-Id: Ic595d4be7b05d857f3328ec28d1ef1232203cb03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141798
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index 2d6f8743373f..f6596a3479e3 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -245,8 +246,12 @@ sal_Bool SAL_CALL PDFFilter::filter( const Sequence< 
PropertyValue >& rDescripto
 {
 FocusWindowWaitCursor aCur;
 
+SalLayoutGlyphsCache::self()->SetCacheGlyphsWhenDoingFallbackFonts(true);
+
 const bool bRet = implExport( rDescriptor );
 
+SalLayoutGlyphsCache::self()->SetCacheGlyphsWhenDoingFallbackFonts(false);
+
 return bRet;
 }
 
diff --git a/include/vcl/glyphitemcache.hxx b/include/vcl/glyphitemcache.hxx
index 6c151ffaabaf..6c4c1ea1294b 100644
--- a/include/vcl/glyphitemcache.hxx
+++ b/include/vcl/glyphitemcache.hxx
@@ -57,6 +57,12 @@ public:
const vcl::text::TextLayoutCache* 
layoutCache = nullptr);
 void clear();
 
+/// Normally, we cannot cache glyphs when doing font fallback, because the 
font fallbacks
+/// can cache during the lifetime of the cache, and they are not included 
in the cache key.
+/// But during some processes, we can turn this on, as long as we remember 
to turn it off
+/// at the end.
+void SetCacheGlyphsWhenDoingFallbackFonts(bool bOK);
+
 static SalLayoutGlyphsCache* self();
 SalLayoutGlyphsCache(int size) // needs to be public for 
vcl::DeleteOnDeinit
 : mCachedGlyphs(size)
@@ -102,6 +108,7 @@ private:
 SalLayoutGlyphs mLastTemporaryGlyphs;
 // If set, info about the last call which wanted a substring of the full 
text.
 std::optional mLastSubstringKey;
+bool mbCacheGlyphsWhenDoingFallbackFonts = false;
 
 SalLayoutGlyphsCache(const SalLayoutGlyphsCache&) = delete;
 SalLayoutGlyphsCache& operator=(const SalLayoutGlyphsCache&) = delete;
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index 016e7c9b9b39..526df693bf3c 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -452,7 +452,7 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr outputDevice, c
 {
 // TODO: Fallbacks do not work reliably (fallback font not 
included in the key),
 // so do not cache (but still return once, using the temporary 
without a key set).
-if (glyphs.Impl(1) != nullptr)
+if (!mbCacheGlyphsWhenDoingFallbackFonts && glyphs.Impl(1) != 
nullptr)
 {
 mLastTemporaryGlyphs = std::move(glyphs);
 mLastTemporaryKey.reset();
@@ -469,6 +469,13 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr outputDevice, c
 return nullptr;
 }
 
+void SalLayoutGlyphsCache::SetCacheGlyphsWhenDoingFallbackFonts(bool bOK)
+{
+mbCacheGlyphsWhenDoingFallbackFonts = bOK;
+if (!bOK)
+clear();
+}
+
 SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(
 const VclPtr& outputDevice, OUString t, sal_Int32 i, 
sal_Int32 l,
 tools::Long w)


[Libreoffice-commits] core.git: filter/source

2022-10-24 Thread Kevin Suo (via logerrit)
 filter/source/pdf/impdialog.cxx  |   22 ---
 filter/source/pdf/pdfexport.cxx  |4 --
 filter/source/t602/t602filter.cxx|   16 ++--
 filter/source/t602/t602filter.hxx|4 --
 filter/source/xsltdialog/xmlfiltercommon.hxx |2 -
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx |   38 ---
 filter/source/xsltdialog/xmlfiltertabdialog.cxx  |3 -
 7 files changed, 32 insertions(+), 57 deletions(-)

New commits:
commit 5e3e507b1a68f5b9883337f1e55c54c2fc9de9fc
Author: Kevin Suo 
AuthorDate: Mon Oct 24 10:42:05 2022 +0800
Commit: Noel Grandin 
CommitDate: Mon Oct 24 12:41:00 2022 +0200

Drop {PDFFilterResId, getResStr, XsltResId} and use FilterResId in "filter"

This is a followup to commit a97bae545d72d8b19f39aa9280c0f284c79d0f6c.

Previously different areas within the "filter" module used their own 
"*ResId" code
to get the translated string. They did the same thing without any 
difference in
purpose and implementation.

Unify this to use FilterResId instead.

Change-Id: Idccf74601a89b5786e1f61a04631436147710bb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141692
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index f5f128fbb508..eaa3385ab16f 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -24,7 +24,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -42,11 +41,6 @@
 #include 
 #include 
 
-static OUString PDFFilterResId(TranslateId aId)
-{
-return Translate::get(aId, Translate::Create("flt"));
-}
-
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
@@ -863,7 +857,7 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, 
TogglePDFVersionOrUniversalAccessibilityHa
 {
 std::unique_ptr 
xBox(Application::CreateMessageDialog(m_xContainer.get(),
   VclMessageType::Warning, 
VclButtonsType::Ok,
-  
PDFFilterResId(STR_WARN_PASSWORD_PDFA)));
+  
FilterResId(STR_WARN_PASSWORD_PDFA)));
 xBox->run();
 }
 }
@@ -1114,10 +1108,10 @@ void ImpPDFTabViewerPage::SetFilterConfigItem( const  
ImpPDFTabDialog* pParent )
 /// The Security preferences tab page
 ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet& i_rCoreSet)
 : SfxTabPage(pPage, pController, "filter/ui/pdfsecuritypage.ui", 
"PdfSecurityPage", _rCoreSet)
-, msUserPwdTitle( PDFFilterResId( STR_PDF_EXPORT_UDPWD ) )
+, msUserPwdTitle( FilterResId( STR_PDF_EXPORT_UDPWD ) )
 , mbHaveOwnerPassword( false )
 , mbHaveUserPassword( false )
-, msOwnerPwdTitle( PDFFilterResId( STR_PDF_EXPORT_ODPWD ) )
+, msOwnerPwdTitle( FilterResId( STR_PDF_EXPORT_ODPWD ) )
 , mxPbSetPwd(m_xBuilder->weld_button("setpassword"))
 , mxUserPwdSet(m_xBuilder->weld_widget("userpwdset"))
 , mxUserPwdUnset(m_xBuilder->weld_widget("userpwdunset"))
@@ -1485,19 +1479,19 @@ ImplErrorDialog::ImplErrorDialog(weld::Window* pParent, 
const std::setappend(PDFFilterResId(STR_WARN_TRANSP_PDFA), 
PDFFilterResId(STR_WARN_TRANSP_PDFA_SHORT), "dialog-warning");
+m_xErrors->append(FilterResId(STR_WARN_TRANSP_PDFA), 
FilterResId(STR_WARN_TRANSP_PDFA_SHORT), "dialog-warning");
 break;
 case vcl::PDFWriter::Warning_Transparency_Omitted_PDF13:
-m_xErrors->append(PDFFilterResId(STR_WARN_TRANSP_VERSION), 
PDFFilterResId(STR_WARN_TRANSP_VERSION_SHORT), "dialog-warning");
+m_xErrors->append(FilterResId(STR_WARN_TRANSP_VERSION), 
FilterResId(STR_WARN_TRANSP_VERSION_SHORT), "dialog-warning");
 break;
 case vcl::PDFWriter::Warning_FormAction_Omitted_PDFA:
-m_xErrors->append(PDFFilterResId(STR_WARN_FORMACTION_PDFA), 
PDFFilterResId(STR_WARN_FORMACTION_PDFA_SHORT), "dialog-warning");
+m_xErrors->append(FilterResId(STR_WARN_FORMACTION_PDFA), 
FilterResId(STR_WARN_FORMACTION_PDFA_SHORT), "dialog-warning");
 break;
 case vcl::PDFWriter::Warning_Transparency_Converted:
-m_xErrors->append(PDFFilterResId(STR_WARN_TRANSP_CONVERTED), 
PDFFilterResId(STR_WARN_TRANSP_CONVERTED_SHORT), "dialog-warning");
+m_xErrors->append(FilterResId(STR_WARN_TRANSP_CONVERTED), 
FilterResId(STR_WARN_TRANSP_CONVERTED_SHORT), "dialog-warning");
 break;
 case vcl::PDFWriter::Error_Signature_Failed:
-m_xErrors->append(PDFFilterResId(STR_ERR_PDF_EXPORT_ABORTED), 
PDFFilterResId(STR_ERR_SIGNATURE_FAILED), "dialog-error");
+m_xErrors->append(FilterResId(STR_ERR_PDF_EXPORT_ABORTED), 

[Libreoffice-commits] core.git: filter/source

2022-10-12 Thread Justin Luth (via logerrit)
 filter/source/msfilter/msvbahelper.cxx |   17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 1e0306be6c3a3bc50f11e7c7814aa8a029f8928d
Author: Justin Luth 
AuthorDate: Tue Oct 11 21:42:21 2022 -0400
Commit: Justin Luth 
CommitDate: Wed Oct 12 15:24:28 2022 +0200

tdf#148806 vba: IsCompiled is required for SbxFlagBits::Private

Two step approach:
-putting this here where I need it - fairly targeted.
-put it in FindMethod before returning,
 so that everything gets it in a valid state.

Of course the second will probably cause consternations,
but then when it gets reverted at least this will still work.

Change-Id: I8772f85c9b9ae6ed9a25ba7966b50519afe0d6ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141243
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/filter/source/msfilter/msvbahelper.cxx 
b/filter/source/msfilter/msvbahelper.cxx
index c7e84138f8dd..923aecb9c3dd 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -205,6 +205,11 @@ static bool hasMacro(SfxObjectShell const* pShell, const 
OUString& sLibrary, OUS
 if (!pModule)
 return false;
 SbMethod* pMeth = pModule->FindMethod(sMacro, SbxClassType::Method);
+
+// Must be compiled before we can trust SbxFlagBits::Private
+if (pMeth && bOnlyPublic && !pModule->IsCompiled())
+pModule->Compile();
+
 return pMeth && (!bOnlyPublic || !pMeth->IsSet(SbxFlagBits::Private));
 }
 
@@ -213,9 +218,17 @@ static bool hasMacro(SfxObjectShell const* pShell, const 
OUString& sLibrary, OUS
 SbMethod* pMeth = rModuleRef->FindMethod(sMacro, SbxClassType::Method);
 if (pMeth)
 {
-if ((bOnlyPublic && pMeth->IsSet(SbxFlagBits::Private))
-|| rModuleRef->GetName() == sSkipModule)
+if (rModuleRef->GetName() == sSkipModule)
 continue;
+
+if (bOnlyPublic)
+{
+if (!rModuleRef->IsCompiled())
+rModuleRef->Compile();
+
+if (pMeth->IsSet(SbxFlagBits::Private))
+continue;
+}
 sMod = rModuleRef->GetName();
 return true;
 }


[Libreoffice-commits] core.git: filter/source include/filter vbahelper/source

2022-10-11 Thread Justin Luth (via logerrit)
 filter/source/msfilter/msvbahelper.cxx |   13 ++
 include/filter/msfilter/msvbahelper.hxx|3 +-
 vbahelper/source/vbahelper/vbaeventshelperbase.cxx |   25 +++--
 3 files changed, 33 insertions(+), 8 deletions(-)

New commits:
commit ffc15725b58d0988b4e2ed836c5751223ad00984
Author: Justin Luth 
AuthorDate: Sat Oct 8 12:15:35 2022 -0400
Commit: Justin Luth 
CommitDate: Tue Oct 11 20:39:04 2022 +0200

tdf#148806 tdf#151393 xls vba: no Auto_Open from ThisWorksheet

Unlike Word, ThisWorksheet cannot hold auto-running
subroutines for Open/Close/New.

This fixes a LO 7.4 regression caused by
commit beb6c62e990599d91ac5d9183164c94d269027d3.

Change-Id: Idb8f72775d9392b306cb924ee776821272b12f3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141127
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/filter/source/msfilter/msvbahelper.cxx 
b/filter/source/msfilter/msvbahelper.cxx
index 59d34ca5cec1..c7e84138f8dd 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -172,7 +172,7 @@ static SfxObjectShell* findShellForUrl( const OUString& 
sMacroURLOrPath )
 // if sMod is empty and a macro is found then sMod is updated
 // if sMod is empty, only standard modules will be searched (no class, 
document, form modules)
 static bool hasMacro(SfxObjectShell const* pShell, const OUString& sLibrary, 
OUString& sMod,
- const OUString& sMacro, bool bOnlyPublic)
+ const OUString& sMacro, bool bOnlyPublic, const OUString& 
sSkipModule)
 {
 #if !HAVE_FEATURE_SCRIPTING
 (void) pShell;
@@ -180,6 +180,7 @@ static bool hasMacro(SfxObjectShell const* pShell, const 
OUString& sLibrary, OUS
 (void) sMod;
 (void) sMacro;
 (void) bOnlyPublic;
+(void) sSkipModule;
 #else
 if (sLibrary.isEmpty() || sMacro.isEmpty())
 return false;
@@ -212,7 +213,8 @@ static bool hasMacro(SfxObjectShell const* pShell, const 
OUString& sLibrary, OUS
 SbMethod* pMeth = rModuleRef->FindMethod(sMacro, SbxClassType::Method);
 if (pMeth)
 {
-if (bOnlyPublic && pMeth->IsSet(SbxFlagBits::Private))
+if ((bOnlyPublic && pMeth->IsSet(SbxFlagBits::Private))
+|| rModuleRef->GetName() == sSkipModule)
 continue;
 sMod = rModuleRef->GetName();
 return true;
@@ -263,7 +265,7 @@ static void parseMacro( const OUString& sMacro, OUString& 
sContainer, OUString&
 
 OUString resolveVBAMacro(SfxObjectShell const* pShell, const OUString& 
rLibName,
  const OUString& rModuleName, const OUString& 
rMacroName,
- bool bOnlyPublic)
+ bool bOnlyPublic, const OUString& sSkipModule)
 {
 #if !HAVE_FEATURE_SCRIPTING
 (void) pShell;
@@ -271,12 +273,13 @@ OUString resolveVBAMacro(SfxObjectShell const* pShell, 
const OUString& rLibName,
 (void) rModuleName;
 (void) rMacroName;
 (void) bOnlyPublic;
+(void) sSkipModule;
 #else
 if( pShell )
 {
 OUString aLibName = rLibName.isEmpty() ?  getDefaultProjectName( 
pShell ) : rLibName ;
 OUString aModuleName = rModuleName;
-if (hasMacro( pShell, aLibName, aModuleName, rMacroName, bOnlyPublic))
+if (hasMacro(pShell, aLibName, aModuleName, rMacroName, bOnlyPublic, 
sSkipModule))
 return aLibName + "." + aModuleName + "." + rMacroName;
 }
 #endif
@@ -447,7 +450,7 @@ MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, 
const OUString& Macro
 
 for (auto const& search : sSearchList)
 {
-aRes.mbFound = hasMacro(pShell, search, sModule, sProcedure, 
/*bOnlyPublic=*/false);
+aRes.mbFound = hasMacro(pShell, search, sModule, sProcedure, 
/*bOnlyPublic=*/false, "");
 if ( aRes.mbFound )
 {
 sContainer = search;
diff --git a/include/filter/msfilter/msvbahelper.hxx 
b/include/filter/msfilter/msvbahelper.hxx
index c1ad7fdae3a2..90f1f8a2b90f 100644
--- a/include/filter/msfilter/msvbahelper.hxx
+++ b/include/filter/msfilter/msvbahelper.hxx
@@ -60,7 +60,8 @@ MSFILTER_DLLPUBLIC OUString extractMacroName( 
std::u16string_view rMacroUrl );
 MSFILTER_DLLPUBLIC OUString getDefaultProjectName( SfxObjectShell const * 
pShell );
 MSFILTER_DLLPUBLIC OUString resolveVBAMacro(SfxObjectShell const* pShell, 
const OUString& rLibName,
 const OUString& rModuleName,
-const OUString& rMacroName, bool 
bOnlyPublic);
+const OUString& rMacroName, bool 
bOnlyPublic,
+const OUString& sSkipModule);
 MSFILTER_DLLPUBLIC MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, 
const OUString& rMacroName, bool bSearchGlobalTemplates = false );
 MSFILTER_DLLPUBLIC bool executeMacro( 

[Libreoffice-commits] core.git: filter/source

2022-10-11 Thread Justin Luth (via logerrit)
 filter/source/msfilter/msvbahelper.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 195cb01573cbc92545cbc84cbb7dd09bbb4ae692
Author: Justin Luth 
AuthorDate: Mon Oct 10 22:39:27 2022 -0400
Commit: Justin Luth 
CommitDate: Tue Oct 11 16:44:39 2022 +0200

tdf#148806 fix build for !HAVE_FEATURE_SCRIPTING

I noticed this on one function, but completely
missed it on the second one.

Change-Id: I6ca74485b0c40cec2b04003fe894159198186ebf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141220
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/filter/source/msfilter/msvbahelper.cxx 
b/filter/source/msfilter/msvbahelper.cxx
index a4e954531155..59d34ca5cec1 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -270,6 +270,7 @@ OUString resolveVBAMacro(SfxObjectShell const* pShell, 
const OUString& rLibName,
 (void) rLibName;
 (void) rModuleName;
 (void) rMacroName;
+(void) bOnlyPublic;
 #else
 if( pShell )
 {


[Libreoffice-commits] core.git: filter/source include/filter vbahelper/source

2022-10-10 Thread Justin Luth (via logerrit)
 filter/source/msfilter/msvbahelper.cxx |   16 +++-
 include/filter/msfilter/msvbahelper.hxx|4 +++-
 vbahelper/source/vbahelper/vbaeventshelperbase.cxx |   15 +--
 3 files changed, 27 insertions(+), 8 deletions(-)

New commits:
commit eaa38b0f9d672793af500222348a6cacd28910b0
Author: Justin Luth 
AuthorDate: Sat Oct 8 09:07:53 2022 -0400
Commit: Justin Luth 
CommitDate: Tue Oct 11 03:08:13 2022 +0200

tdf#148806 doc vba: only autoOpen PUBLIC macros

Note: this should NOT apply to Document_Open which normally
is a private subroutine and runs fine as private.

I tested and it DOES apply to all three version of AutoOpen:
-ThisDocument.AutoOpen,
-.AutoOpen,
-AutoOpen.Main

Note: this is different from Excel.
Private Auto_Open runs just fine there.

Change-Id: If10c8c90c35275c2b14dc2e15fb357674fc580b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141114
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/filter/source/msfilter/msvbahelper.cxx 
b/filter/source/msfilter/msvbahelper.cxx
index 674530d1cbb1..a4e954531155 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -171,13 +171,15 @@ static SfxObjectShell* findShellForUrl( const OUString& 
sMacroURLOrPath )
 // sMod can be empty ( but we really need the library to search in )
 // if sMod is empty and a macro is found then sMod is updated
 // if sMod is empty, only standard modules will be searched (no class, 
document, form modules)
-static bool hasMacro( SfxObjectShell const * pShell, const OUString& sLibrary, 
OUString& sMod, const OUString& sMacro )
+static bool hasMacro(SfxObjectShell const* pShell, const OUString& sLibrary, 
OUString& sMod,
+ const OUString& sMacro, bool bOnlyPublic)
 {
 #if !HAVE_FEATURE_SCRIPTING
 (void) pShell;
 (void) sLibrary;
 (void) sMod;
 (void) sMacro;
+(void) bOnlyPublic;
 #else
 if (sLibrary.isEmpty() || sMacro.isEmpty())
 return false;
@@ -202,7 +204,7 @@ static bool hasMacro( SfxObjectShell const * pShell, const 
OUString& sLibrary, O
 if (!pModule)
 return false;
 SbMethod* pMeth = pModule->FindMethod(sMacro, SbxClassType::Method);
-return pMeth;
+return pMeth && (!bOnlyPublic || !pMeth->IsSet(SbxFlagBits::Private));
 }
 
 for (auto const& rModuleRef : pBasic->GetModules())
@@ -210,6 +212,8 @@ static bool hasMacro( SfxObjectShell const * pShell, const 
OUString& sLibrary, O
 SbMethod* pMeth = rModuleRef->FindMethod(sMacro, SbxClassType::Method);
 if (pMeth)
 {
+if (bOnlyPublic && pMeth->IsSet(SbxFlagBits::Private))
+continue;
 sMod = rModuleRef->GetName();
 return true;
 }
@@ -257,7 +261,9 @@ static void parseMacro( const OUString& sMacro, OUString& 
sContainer, OUString&
 
 #endif
 
-OUString resolveVBAMacro( SfxObjectShell const * pShell, const OUString& 
rLibName, const OUString& rModuleName, const OUString& rMacroName )
+OUString resolveVBAMacro(SfxObjectShell const* pShell, const OUString& 
rLibName,
+ const OUString& rModuleName, const OUString& 
rMacroName,
+ bool bOnlyPublic)
 {
 #if !HAVE_FEATURE_SCRIPTING
 (void) pShell;
@@ -269,7 +275,7 @@ OUString resolveVBAMacro( SfxObjectShell const * pShell, 
const OUString& rLibNam
 {
 OUString aLibName = rLibName.isEmpty() ?  getDefaultProjectName( 
pShell ) : rLibName ;
 OUString aModuleName = rModuleName;
-if( hasMacro( pShell, aLibName, aModuleName, rMacroName ) )
+if (hasMacro( pShell, aLibName, aModuleName, rMacroName, bOnlyPublic))
 return aLibName + "." + aModuleName + "." + rMacroName;
 }
 #endif
@@ -440,7 +446,7 @@ MacroResolvedInfo resolveVBAMacro( SfxObjectShell* pShell, 
const OUString& Macro
 
 for (auto const& search : sSearchList)
 {
-aRes.mbFound = hasMacro( pShell, search, sModule, sProcedure );
+aRes.mbFound = hasMacro(pShell, search, sModule, sProcedure, 
/*bOnlyPublic=*/false);
 if ( aRes.mbFound )
 {
 sContainer = search;
diff --git a/include/filter/msfilter/msvbahelper.hxx 
b/include/filter/msfilter/msvbahelper.hxx
index 1568970eb697..c1ad7fdae3a2 100644
--- a/include/filter/msfilter/msvbahelper.hxx
+++ b/include/filter/msfilter/msvbahelper.hxx
@@ -58,7 +58,9 @@ struct MSFILTER_DLLPUBLIC MacroResolvedInfo
 MSFILTER_DLLPUBLIC OUString makeMacroURL( std::u16string_view sMacroName );
 MSFILTER_DLLPUBLIC OUString extractMacroName( std::u16string_view rMacroUrl );
 MSFILTER_DLLPUBLIC OUString getDefaultProjectName( SfxObjectShell const * 
pShell );
-MSFILTER_DLLPUBLIC OUString resolveVBAMacro( SfxObjectShell const * pShell, 
const OUString& rLibName, const OUString& rModuleName, const OUString& 
rMacroName );
+MSFILTER_DLLPUBLIC 

[Libreoffice-commits] core.git: filter/source

2022-10-08 Thread Justin Luth (via logerrit)
 filter/source/msfilter/msvbahelper.cxx |   63 -
 1 file changed, 31 insertions(+), 32 deletions(-)

New commits:
commit d72571fdd47c627efcd0dff92fbe8a9747f92932
Author: Justin Luth 
AuthorDate: Sat Oct 8 08:36:57 2022 -0400
Commit: Justin Luth 
CommitDate: Sun Oct 9 01:10:59 2022 +0200

related tdf#148806 flatten filter/source/msfilter/msvbahelper.cxx

I don't like mixing big formatting changes with logic changes.

Change-Id: Id2dbdfd751ac86918fe39d6627aa9ce15c794323
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141113
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/filter/source/msfilter/msvbahelper.cxx 
b/filter/source/msfilter/msvbahelper.cxx
index 95144adb6094..674530d1cbb1 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -179,40 +179,39 @@ static bool hasMacro( SfxObjectShell const * pShell, 
const OUString& sLibrary, O
 (void) sMod;
 (void) sMacro;
 #else
-if ( !sLibrary.isEmpty() && !sMacro.isEmpty() )
+if (sLibrary.isEmpty() || sMacro.isEmpty())
+return false;
+
+BasicManager* pBasicMgr = pShell->GetBasicManager();
+if (!pBasicMgr)
+return false;
+
+StarBASIC* pBasic = pBasicMgr->GetLib(sLibrary);
+if (!pBasic)
+{
+sal_uInt16 nId = pBasicMgr->GetLibId(sLibrary);
+pBasicMgr->LoadLib(nId);
+pBasic = pBasicMgr->GetLib(sLibrary);
+}
+if (!pBasic)
+return false;
+
+if (!sMod.isEmpty()) // we wish to find the macro is a specific module
+{
+SbModule* pModule = pBasic->FindModule(sMod);
+if (!pModule)
+return false;
+SbMethod* pMeth = pModule->FindMethod(sMacro, SbxClassType::Method);
+return pMeth;
+}
+
+for (auto const& rModuleRef : pBasic->GetModules())
 {
-BasicManager* pBasicMgr = pShell-> GetBasicManager();
-if ( pBasicMgr )
+SbMethod* pMeth = rModuleRef->FindMethod(sMacro, SbxClassType::Method);
+if (pMeth)
 {
-StarBASIC* pBasic = pBasicMgr->GetLib( sLibrary );
-if ( !pBasic )
-{
-sal_uInt16 nId = pBasicMgr->GetLibId( sLibrary );
-pBasicMgr->LoadLib( nId );
-pBasic = pBasicMgr->GetLib( sLibrary );
-}
-if ( pBasic )
-{
-if ( !sMod.isEmpty() ) // we wish to find the macro is a 
specific module
-{
-SbModule* pModule = pBasic->FindModule( sMod );
-if ( pModule && pModule->FindMethod( sMacro, 
SbxClassType::Method ))
-{
-return true;
-}
-}
-else
-{
-for (auto const& rModuleRef : pBasic->GetModules())
-{
-if (rModuleRef && rModuleRef->FindMethod(sMacro, 
SbxClassType::Method))
-{
-sMod = rModuleRef->GetName();
-return true;
-}
-}
-}
-}
+sMod = rModuleRef->GetName();
+return true;
 }
 }
 #endif


  1   2   3   4   5   6   7   8   9   10   >