core.git: idl/source solenv/gbuild starmath/inc starmath/source

2024-03-12 Thread Noel Grandin (via logerrit)
 idl/source/objects/types.cxx   |4 +---
 solenv/gbuild/extensions/pre_MergedLibsList.mk |2 --
 starmath/inc/mathml/xparsmlbase.hxx|8 
 starmath/source/mathml/export.cxx  |2 +-
 starmath/source/mathml/import.cxx  |4 ++--
 starmath/source/mathml/mathmlexport.cxx|2 +-
 starmath/source/mathml/mathmlimport.cxx|4 ++--
 starmath/source/mathml/xparsmlbase.cxx |   17 -
 8 files changed, 15 insertions(+), 28 deletions(-)

New commits:
commit 44a819a466fb553ff5dec97b258144fa75bbe7fd
Author: Noel Grandin 
AuthorDate: Tue Mar 12 17:42:17 2024 +0100
Commit: Noel Grandin 
CommitDate: Tue Mar 12 20:39:20 2024 +0100

Revert "add sm to --enable-mergelibs=more"

This reverts commit 87d3f768f3ecded1e1392442181edb287aed9e2e.

The unit test at
starmath/CppunitTest_starmath_qa_cppunit.mk
is doing
$(eval $(call gb_CppunitTest_use_library_objects,starmath_qa_cppunit,\
sm \
))
which it is using to access to all the internal functions of starmath.

Unfortunately that linking trick is just not compatible with the mergelib 
linking.

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

diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index 3228e1cce378..1089e929043c 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -249,9 +249,7 @@ void SvMetaType::WriteSfxItem(
 
 // write the implementation part
 rOutStm.WriteOString( "#ifdef SFX_TYPEMAP" ) << endl;
-rOutStm.WriteOString( "#if defined(_WIN32)" ) << endl;
-rOutStm.WriteOString( "__declspec(selectany)" ) << endl;
-rOutStm.WriteOString( "#else" ) << endl;
+rOutStm.WriteOString( "#if !defined(_WIN32) && 
(defined(DISABLE_DYNLOADING) && (defined(ANDROID) || defined(IOS) || 
defined(EMSCRIPTEN) || defined(LINUX)))" ) << endl;
 rOutStm.WriteOString( "__attribute__((__weak__))" ) << endl;
 rOutStm.WriteOString( "#endif" ) << endl;
 rOutStm.WriteOString( aTypeName ).WriteOString( aVarName )
diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk 
b/solenv/gbuild/extensions/pre_MergedLibsList.mk
index 5c4db5957080..2c2e59479465 100644
--- a/solenv/gbuild/extensions/pre_MergedLibsList.mk
+++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk
@@ -180,8 +180,6 @@ gb_MERGE_LIBRARY_LIST += \
sdbc2 \
$(call gb_Helper_optional,DBCONNECTIVITY,sdbt) \
slideshow \
-   sm \
-   smd \
$(if $(filter WNT,$(OS)), \
smplmail \
) \
diff --git a/starmath/inc/mathml/xparsmlbase.hxx 
b/starmath/inc/mathml/xparsmlbase.hxx
index 5c06482396ef..6c645a55e36c 100644
--- a/starmath/inc/mathml/xparsmlbase.hxx
+++ b/starmath/inc/mathml/xparsmlbase.hxx
@@ -39,15 +39,15 @@ constexpr sal_Int32 STARMATH_MATHMLHTML_ENTITY_NUMBER = 
2125;
   * Entity names for mathml. Example:  -> \u221E;
   * These ones are to be used on import.
   */
-const css::uno::Sequence<::css::beans::Pair<::rtl::OUString, ::rtl::OUString>>&
-getCustomMathmlHtmlEntities();
+const extern ::css::uno::Sequence<::css::beans::Pair<::rtl::OUString, 
::rtl::OUString>>
+icustomMathmlHtmlEntities;
 
 /**
   * Entity names for mathml. Example: "\u221E"; -> 
   * These ones are to be used on file export.
   */
-const css::uno::Sequence<::css::beans::Pair<::rtl::OUString, ::rtl::OUString>>&
-getCustomMathmlHtmlEntitiesExport();
+const extern ::css::uno::Sequence<::css::beans::Pair<::rtl::OUString, 
::rtl::OUString>>
+icustomMathmlHtmlEntitiesExport;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/mathml/export.cxx 
b/starmath/source/mathml/export.cxx
index 001a31434eaf..60328c89dabf 100644
--- a/starmath/source/mathml/export.cxx
+++ b/starmath/source/mathml/export.cxx
@@ -299,7 +299,7 @@ bool SmMLExportWrapper::WriteThroughComponentOS(const 
ReferencesetOutputStream(xOutputStream);
 if (m_bUseHTMLMLEntities)
-
xSaxWriter->setCustomEntityNames(starmathdatabase::getCustomMathmlHtmlEntitiesExport());
+
xSaxWriter->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntitiesExport);
 
 // prepare arguments (prepend doc handler to given arguments)
 Sequence aArgs{ Any(xSaxWriter), Any(rPropSet) };
diff --git a/starmath/source/mathml/import.cxx 
b/starmath/source/mathml/import.cxx
index ba1f59fa74f9..d857e56930d6 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -390,14 +390,14 @@ ErrCode SmMLImportWrapper::ReadThroughComponentIS(
 Reference 
xFastDocHandler(xFilter, UNO_QUERY);
 if (xFastParser)
 {
-
xFastParser->setCustomEntityNames(starmathdatabase::getCustomMathmlHtmlEntities());
+

core.git: idl/source solenv/gbuild starmath/inc starmath/source

2024-03-07 Thread Noel Grandin (via logerrit)
 idl/source/objects/types.cxx   |4 +++-
 solenv/gbuild/extensions/pre_MergedLibsList.mk |2 ++
 starmath/inc/mathml/xparsmlbase.hxx|8 
 starmath/source/mathml/export.cxx  |2 +-
 starmath/source/mathml/import.cxx  |4 ++--
 starmath/source/mathml/mathmlexport.cxx|2 +-
 starmath/source/mathml/mathmlimport.cxx|4 ++--
 starmath/source/mathml/xparsmlbase.cxx |   17 +
 8 files changed, 28 insertions(+), 15 deletions(-)

New commits:
commit 87d3f768f3ecded1e1392442181edb287aed9e2e
Author: Noel Grandin 
AuthorDate: Thu Mar 7 13:46:09 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 7 20:14:37 2024 +0100

add sm to --enable-mergelibs=more

Which means

(1) We need to extend the weak linkage magic for the sfx2 SFX_TYPEMAP
stuff. Just make it unconditional, since it makes no difference for the
individual items.

(2) The initialisation of global const Sequence data in starmath stops
working, because it runs too early. Use function-local static to
initialise it on-demand

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

diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index 1089e929043c..3228e1cce378 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -249,7 +249,9 @@ void SvMetaType::WriteSfxItem(
 
 // write the implementation part
 rOutStm.WriteOString( "#ifdef SFX_TYPEMAP" ) << endl;
-rOutStm.WriteOString( "#if !defined(_WIN32) && 
(defined(DISABLE_DYNLOADING) && (defined(ANDROID) || defined(IOS) || 
defined(EMSCRIPTEN) || defined(LINUX)))" ) << endl;
+rOutStm.WriteOString( "#if defined(_WIN32)" ) << endl;
+rOutStm.WriteOString( "__declspec(selectany)" ) << endl;
+rOutStm.WriteOString( "#else" ) << endl;
 rOutStm.WriteOString( "__attribute__((__weak__))" ) << endl;
 rOutStm.WriteOString( "#endif" ) << endl;
 rOutStm.WriteOString( aTypeName ).WriteOString( aVarName )
diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk 
b/solenv/gbuild/extensions/pre_MergedLibsList.mk
index aa925cbc91a8..e558790ed38f 100644
--- a/solenv/gbuild/extensions/pre_MergedLibsList.mk
+++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk
@@ -177,6 +177,8 @@ gb_MERGE_LIBRARY_LIST += \
sdbc2 \
$(call gb_Helper_optional,DBCONNECTIVITY,sdbt) \
slideshow \
+   sm \
+   smd \
$(if $(filter WNT,$(OS)), \
smplmail \
) \
diff --git a/starmath/inc/mathml/xparsmlbase.hxx 
b/starmath/inc/mathml/xparsmlbase.hxx
index 6c645a55e36c..5c06482396ef 100644
--- a/starmath/inc/mathml/xparsmlbase.hxx
+++ b/starmath/inc/mathml/xparsmlbase.hxx
@@ -39,15 +39,15 @@ constexpr sal_Int32 STARMATH_MATHMLHTML_ENTITY_NUMBER = 
2125;
   * Entity names for mathml. Example:  -> \u221E;
   * These ones are to be used on import.
   */
-const extern ::css::uno::Sequence<::css::beans::Pair<::rtl::OUString, 
::rtl::OUString>>
-icustomMathmlHtmlEntities;
+const css::uno::Sequence<::css::beans::Pair<::rtl::OUString, ::rtl::OUString>>&
+getCustomMathmlHtmlEntities();
 
 /**
   * Entity names for mathml. Example: "\u221E"; -> 
   * These ones are to be used on file export.
   */
-const extern ::css::uno::Sequence<::css::beans::Pair<::rtl::OUString, 
::rtl::OUString>>
-icustomMathmlHtmlEntitiesExport;
+const css::uno::Sequence<::css::beans::Pair<::rtl::OUString, ::rtl::OUString>>&
+getCustomMathmlHtmlEntitiesExport();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/mathml/export.cxx 
b/starmath/source/mathml/export.cxx
index 60328c89dabf..001a31434eaf 100644
--- a/starmath/source/mathml/export.cxx
+++ b/starmath/source/mathml/export.cxx
@@ -299,7 +299,7 @@ bool SmMLExportWrapper::WriteThroughComponentOS(const 
ReferencesetOutputStream(xOutputStream);
 if (m_bUseHTMLMLEntities)
-
xSaxWriter->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntitiesExport);
+
xSaxWriter->setCustomEntityNames(starmathdatabase::getCustomMathmlHtmlEntitiesExport());
 
 // prepare arguments (prepend doc handler to given arguments)
 Sequence aArgs{ Any(xSaxWriter), Any(rPropSet) };
diff --git a/starmath/source/mathml/import.cxx 
b/starmath/source/mathml/import.cxx
index d857e56930d6..ba1f59fa74f9 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -390,14 +390,14 @@ ErrCode SmMLImportWrapper::ReadThroughComponentIS(
 Reference 
xFastDocHandler(xFilter, UNO_QUERY);
 if (xFastParser)
 {
-
xFastParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities);
+
xFastParser->setCustomEntityNames(starmathdatabase::getCustomMathmlHtmlEntities());