[openoffice] 02/03: All scripts must be subject to checks

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 57221d74ec27db61efcf416a9f0e37ad824b5ccc
Author: Arrigo Marchiori 
AuthorDate: Tue Oct 19 20:24:17 2021 +0200

All scripts must be subject to checks

(cherry picked from commit fb9ad7aa17549019ccdd2762a97d104449abf45d)
---
 main/scripting/source/protocolhandler/scripthandler.cxx | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/main/scripting/source/protocolhandler/scripthandler.cxx 
b/main/scripting/source/protocolhandler/scripthandler.cxx
index fbb5a2f..1d8d267 100644
--- a/main/scripting/source/protocolhandler/scripthandler.cxx
+++ b/main/scripting/source/protocolhandler/scripthandler.cxx
@@ -163,11 +163,9 @@ void SAL_CALL 
ScriptProtocolHandler::dispatchWithNotification(
 rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
 bool bIsDocumentScript = ( xStringUri.indexOfAsciiL( 
RTL_CONSTASCII_STRINGPARAM( "document" ) ) !=-1 );
 
-if ( bIsDocumentScript )
-{
-// obtain the component for our security check
-Reference< XEmbeddedScripts > xDocumentScripts;
-if ( getScriptInvocation() )
+// obtain the component for our security check. We could check 
bIsDocumentScript but the "location" could be forged
+if ( getScriptInvocation() ) {
+Reference< XEmbeddedScripts > xDocumentScripts;
 xDocumentScripts.set( 
m_xScriptInvocation->getScriptContainer(), UNO_SET_THROW );
 
 OSL_ENSURE( xDocumentScripts.is(), 
"ScriptProtocolHandler::dispatchWithNotification: can't do the security check!" 
);


[openoffice] 03/03: Check if scripts are allowed, regardless of location

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 417e12810c61e06dae9a3df49a2e1860863ccceb
Author: Arrigo Marchiori 
AuthorDate: Sat Oct 23 14:26:30 2021 +0200

Check if scripts are allowed, regardless of location

(cherry picked and adapted from commit 
aea5254635d14376dd83e528769fd1dec8f7dbd7)
---
 main/sfx2/source/doc/objmisc.cxx | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/main/sfx2/source/doc/objmisc.cxx b/main/sfx2/source/doc/objmisc.cxx
index ebe26d8..ce2fe33 100644
--- a/main/sfx2/source/doc/objmisc.cxx
+++ b/main/sfx2/source/doc/objmisc.cxx
@@ -1695,16 +1695,13 @@ ErrCode SfxObjectShell::CallXScript( const Reference< 
XInterface >& _rxScriptCon
 OSL_TRACE( "in CallXScript" );
ErrCode nErr = ERRCODE_NONE;
 
-bool bIsDocumentScript = ( _rScriptURL.indexOfAsciiL( 
RTL_CONSTASCII_STRINGPARAM( "location=document" ) ) >= 0 );
-// TODO: we should parse the URL, and check whether there is a 
parameter with this name.
-// Otherwise, we might find too much.
-if ( bIsDocumentScript && !lcl_isScriptAccessAllowed_nothrow( 
_rxScriptContext ) )
-return ERRCODE_IO_ACCESSDENIED;
-
bool bCaughtException = false;
 Any aException;
 try
 {
+if ( !lcl_isScriptAccessAllowed_nothrow( _rxScriptContext ) )
+return ERRCODE_IO_ACCESSDENIED;
+
 // obtain/create a script provider
 Reference< provider::XScriptProvider > xScriptProvider;
 Reference< provider::XScriptProviderSupplier > xSPS( _rxScriptContext, 
UNO_QUERY );


[openoffice] branch AOO41X updated (fc33a8e -> 417e128)

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a change to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git.


from fc33a8e  Produce expat-2.2.13, derived from 2.4.7
 new b42dd17  Do not allow macros by default when there are none
 new 57221d7  All scripts must be subject to checks
 new 417e128  Check if scripts are allowed, regardless of location

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../source/protocolhandler/scripthandler.cxx   |  8 +--
 main/sfx2/source/doc/docmacromode.cxx  | 80 +++---
 main/sfx2/source/doc/objmisc.cxx   |  9 +--
 3 files changed, 60 insertions(+), 37 deletions(-)


[openoffice] 01/03: Do not allow macros by default when there are none

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit b42dd17c7ad2f25b3e10e8cdee9dd5292510f975
Author: Arrigo Marchiori 
AuthorDate: Tue Oct 19 20:23:01 2021 +0200

Do not allow macros by default when there are none

(cherry picked from commit 4018d3b8a14b17c2bbe7eaec1ac3a460adc072cb)
---
 main/sfx2/source/doc/docmacromode.cxx | 80 +++
 1 file changed, 54 insertions(+), 26 deletions(-)

diff --git a/main/sfx2/source/doc/docmacromode.cxx 
b/main/sfx2/source/doc/docmacromode.cxx
index f27893f..03b542c 100644
--- a/main/sfx2/source/doc/docmacromode.cxx
+++ b/main/sfx2/source/doc/docmacromode.cxx
@@ -159,27 +159,14 @@ namespace sfx2
 return sal_False;
 }
 
-   //
-sal_Bool DocumentMacroMode::adjustMacroMode( const Reference< 
XInteractionHandler >& rxInteraction )
+/** Change the indicated macro execution mode depending on the current 
macro security level.
+ *
+ * @param nMacroExecutionMode current execution mode (must be one of 
MacroExecMode::USE_XXX).
+ *
+ * Changes nMacroExecutionMode according to the current security options, 
if applicable.
+ */
+static void adjustMacroExecModeSecurity(sal_uInt16 )
 {
-sal_uInt16 nMacroExecutionMode = 
m_pData->m_rDocumentAccess.getCurrentMacroExecMode();
-
-if ( SvtSecurityOptions().IsMacroDisabled() )
-{
-// no macro should be executed at all
-lcl_showMacrosDisabledError( rxInteraction, 
m_pData->m_bMacroDisabledMessageShown );
-return disallowMacroExecution();
-}
-
-// get setting from configuration if required
-enum AutoConfirmation
-{
-eNoAutoConfirm,
-eAutoConfirmApprove,
-eAutoConfirmReject
-};
-AutoConfirmation eAutoConfirm( eNoAutoConfirm );
-
 if  (   ( nMacroExecutionMode == MacroExecMode::USE_CONFIG )
 ||  ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION )
 ||  ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_APPROVE_CONFIRMATION )
@@ -205,12 +192,36 @@ namespace sfx2
 nMacroExecutionMode = MacroExecMode::NEVER_EXECUTE;
 }
 
-if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION )
-eAutoConfirm = eAutoConfirmReject;
-else if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_APPROVE_CONFIRMATION )
-eAutoConfirm = eAutoConfirmApprove;
+}
+}
+
+   //
+sal_Bool DocumentMacroMode::adjustMacroMode( const Reference< 
XInteractionHandler >& rxInteraction )
+{
+sal_uInt16 nMacroExecutionMode = 
m_pData->m_rDocumentAccess.getCurrentMacroExecMode();
+
+if ( SvtSecurityOptions().IsMacroDisabled() )
+{
+// no macro should be executed at all
+lcl_showMacrosDisabledError( rxInteraction, 
m_pData->m_bMacroDisabledMessageShown );
+return disallowMacroExecution();
 }
 
+// get setting from configuration if required
+enum AutoConfirmation
+{
+eNoAutoConfirm,
+eAutoConfirmApprove,
+eAutoConfirmReject
+};
+AutoConfirmation eAutoConfirm( eNoAutoConfirm );
+
+adjustMacroExecModeSecurity(nMacroExecutionMode);
+if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION )
+eAutoConfirm = eAutoConfirmReject;
+else if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_APPROVE_CONFIRMATION )
+eAutoConfirm = eAutoConfirmApprove;
+
 if ( nMacroExecutionMode == MacroExecMode::NEVER_EXECUTE )
 return sal_False;
 
@@ -420,8 +431,25 @@ namespace sfx2
 }
 else if ( !isMacroExecutionDisallowed() )
 {
-// if macros will be added by the user later, the security 
check is obsolete
-bAllow = allowMacroExecution();
+// There are no macros (yet) but we want to be careful anyway
+sal_uInt16 nMacroExecutionMode = 
m_pData->m_rDocumentAccess.getCurrentMacroExecMode();
+adjustMacroExecModeSecurity(nMacroExecutionMode);
+switch (nMacroExecutionMode) {
+case MacroExecMode::NEVER_EXECUTE:
+case MacroExecMode::USE_CONFIG:
+case MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION:
+case MacroExecMode::FROM_LIST_NO_WARN:
+case MacroExecMode::FROM_LIST_AND_SIGNED_WARN:
+case MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN:
+bAllow = sal_False;
+

[openoffice] 05/05: Check if scripts are allowed, regardless of location

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 5aea3bf71c1cc083bd5dbc0ba7ff7d378a339319
Author: Arrigo Marchiori 
AuthorDate: Sat Oct 23 14:26:30 2021 +0200

Check if scripts are allowed, regardless of location

(cherry picked from commit aea5254635d14376dd83e528769fd1dec8f7dbd7)
---
 main/sfx2/source/doc/objmisc.cxx | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/main/sfx2/source/doc/objmisc.cxx b/main/sfx2/source/doc/objmisc.cxx
index 90c7c67..9144937 100644
--- a/main/sfx2/source/doc/objmisc.cxx
+++ b/main/sfx2/source/doc/objmisc.cxx
@@ -1707,9 +1707,7 @@ ErrCode SfxObjectShell::CallXScript( const Reference< 
XInterface >& _rxScriptCon
 xServiceManager->createInstance( rtl::OUString::createFromAscii(
 "com.sun.star.uri.UriReferenceFactory") ) , UNO_QUERY_THROW );
 Reference< uri::XVndSunStarScriptUrlReference > xScriptUri( 
xFac->parse( _rScriptURL ), UNO_QUERY_THROW );
-::rtl::OUString sLocation = xScriptUri->getParameter( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "location" ) ) );
-bool bIsDocumentScript = ( sLocation == ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "document" ) ) );
-if ( bIsDocumentScript && !lcl_isScriptAccessAllowed_nothrow( 
_rxScriptContext ) )
+if ( !lcl_isScriptAccessAllowed_nothrow( _rxScriptContext ) )
 return ERRCODE_IO_ACCESSDENIED;
 
 // obtain/create a script provider


[openoffice] 04/05: All scripts must be subject to checks

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 2545873645e2f6d0aeefa0e500a216d74040610e
Author: Arrigo Marchiori 
AuthorDate: Tue Oct 19 20:24:17 2021 +0200

All scripts must be subject to checks

(cherry picked from commit fb9ad7aa17549019ccdd2762a97d104449abf45d)
---
 main/scripting/source/protocolhandler/scripthandler.cxx | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/main/scripting/source/protocolhandler/scripthandler.cxx 
b/main/scripting/source/protocolhandler/scripthandler.cxx
index d064fde..85643ee 100644
--- a/main/scripting/source/protocolhandler/scripthandler.cxx
+++ b/main/scripting/source/protocolhandler/scripthandler.cxx
@@ -166,11 +166,9 @@ void SAL_CALL 
ScriptProtocolHandler::dispatchWithNotification(
 ::rtl::OUString sLocation = xScriptUri->getParameter( 
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "location" ) ) );
 bool bIsDocumentScript = ( sLocation == ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "document" ) ) );
 
-if ( bIsDocumentScript )
-{
-// obtain the component for our security check
-Reference< XEmbeddedScripts > xDocumentScripts;
-if ( getScriptInvocation() )
+// obtain the component for our security check. We could check 
bIsDocumentScript but the "location" could be forged
+if ( getScriptInvocation() ) {
+Reference< XEmbeddedScripts > xDocumentScripts;
 xDocumentScripts.set( 
m_xScriptInvocation->getScriptContainer(), UNO_SET_THROW );
 
 OSL_ENSURE( xDocumentScripts.is(), 
"ScriptProtocolHandler::dispatchWithNotification: can't do the security check!" 
);


[openoffice] 02/05: Produce expat-2.2.13, derived from 2.4.7

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 804fb957cd5ee43efe8001da727033b297a199d8
Author: Arrigo Marchiori 
AuthorDate: Wed Mar 9 21:11:35 2022 +0100

Produce expat-2.2.13, derived from 2.4.7

(cherry picked from commit 84b800346361a798f2dacc3e03dc6b4a6358f3cf)
---
 main/expat/expat-2.2.10.patch | 888 +-
 1 file changed, 786 insertions(+), 102 deletions(-)

diff --git a/main/expat/expat-2.2.10.patch b/main/expat/expat-2.2.10.patch
index b6413d6..0de7936 100644
--- a/main/expat/expat-2.2.10.patch
+++ b/main/expat/expat-2.2.10.patch
@@ -360,7 +360,7 @@ diff -ru misc/expat-2.2.10/doc/xmlwf.xml 
misc/build/expat-2.2.10/doc/xmlwf.xml

 diff -ru misc/expat-2.2.10/lib/expat.h misc/build/expat-2.2.10/lib/expat.h
 --- misc/expat-2.2.10/lib/expat.h  2020-10-03 17:14:57.0 +0200
-+++ misc/build/expat-2.2.10/lib/expat.h2022-03-05 12:25:27.583396678 
+0100
 misc/build/expat-2.2.10/lib/expat.h2022-03-09 20:25:36.712575539 
+0100
 @@ -115,7 +115,10 @@
XML_ERROR_RESERVED_PREFIX_XMLNS,
XML_ERROR_RESERVED_NAMESPACE_URI,
@@ -408,7 +408,7 @@ diff -ru misc/expat-2.2.10/lib/expat.h 
misc/build/expat-2.2.10/lib/expat.h
  #define XML_MAJOR_VERSION 2
  #define XML_MINOR_VERSION 2
 -#define XML_MICRO_VERSION 10
-+#define XML_MICRO_VERSION 12
++#define XML_MICRO_VERSION 13
  
  #ifdef __cplusplus
  }
@@ -520,7 +520,7 @@ diff -ru misc/expat-2.2.10/lib/Makefile.in 
misc/build/expat-2.2.10/lib/Makefile.
  srcdir = @srcdir@
 diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
 --- misc/expat-2.2.10/lib/xmlparse.c   2020-10-03 17:14:57.0 +0200
-+++ misc/build/expat-2.2.10/lib/xmlparse.c 2022-03-05 12:25:27.583396678 
+0100
 misc/build/expat-2.2.10/lib/xmlparse.c 2022-03-09 20:25:36.712575539 
+0100
 @@ -47,6 +47,7 @@
  #include  /* UINT_MAX */
  #include   /* fprintf */
@@ -540,6 +540,15 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  #elif defined(HAVE_EXPAT_CONFIG_H)
  #  include 
  #endif /* ndef _WIN32 */
+@@ -116,7 +121,7 @@
+   * BSD / macOS (including <10.7) (arc4random): HAVE_ARC4RANDOM, \
+   * libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, \
+   * libbsd (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, \
+-  * Linux (including <3.17) / BSD / macOS (including <10.7) 
(/dev/urandom): XML_DEV_URANDOM, \
++  * Linux (including <3.17) / BSD / macOS (including <10.7) / Solaris >=8 
(/dev/urandom): XML_DEV_URANDOM, \
+   * Windows >=Vista (rand_s): _WIN32. \
+ \
+ If insist on not using any of these, bypass this error by defining \
 @@ -382,6 +387,31 @@
XML_Bool betweenDecl; /* WFC: PE Between Declarations */
  } OPEN_INTERNAL_ENTITY;
@@ -672,7 +681,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  };
  
  #define MALLOC(parser, s) (parser->m_mem.malloc_fcn((s)))
-@@ -640,6 +708,7 @@
+@@ -640,9 +708,11 @@
  XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) {
XML_Char tmp[2];
*tmp = nsSep;
@@ -680,7 +689,11 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
return XML_ParserCreate_MM(encodingName, NULL, tmp);
  }
  
-@@ -809,9 +878,8 @@
++// "xml=http://www.w3.org/XML/1998/namespace;
+ static const XML_Char implicitContext[]
+ = {ASCII_x, ASCII_m, ASCII_l,  ASCII_EQUALS, ASCII_h,
+ASCII_t, ASCII_t, ASCII_p,  ASCII_COLON,  ASCII_SLASH,
+@@ -809,9 +879,8 @@
  
  static unsigned long
  ENTROPY_DEBUG(const char *label, unsigned long entropy) {
@@ -692,7 +705,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  (int)sizeof(entropy) * 2, entropy, (unsigned 
long)sizeof(entropy));
}
return entropy;
-@@ -855,7 +923,7 @@
+@@ -855,7 +924,7 @@
  return ENTROPY_DEBUG("fallback(4)", entropy * 2147483647);
} else {
  return ENTROPY_DEBUG("fallback(8)",
@@ -701,7 +714,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
}
  #endif
  }
-@@ -1073,6 +1141,18 @@
+@@ -1073,6 +1142,18 @@
parser->m_paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
  #endif
parser->m_hash_secret_salt = 0;
@@ -720,7 +733,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  }
  
  /* moves list of bindings to m_freeBindingList */
-@@ -1255,6 +1335,7 @@
+@@ -1255,6 +1336,7 @@
if (parser->m_ns) {
  XML_Char tmp[2];
  *tmp = parser->m_namespaceSeparator;
@@ -728,7 +741,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  parser = parserCreate(encodingName, >m_mem, tmp, newDtd);
} else {
  parser = parserCreate(encodingName, >m_mem, NULL, newDtd);
-@@ -1893,6 +1974,12 @@

[openoffice] branch AOO42X updated (c7c1ab4 -> 5aea3bf)

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a change to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git.


from c7c1ab4  Fixed typos, removed whitespace
 new 9bd0941  Upgrade expat-2.2.10 into 2.2.12
 new 804fb95  Produce expat-2.2.13, derived from 2.4.7
 new 7f7da15  Do not allow macros by default when there are none
 new 2545873  All scripts must be subject to checks
 new 5aea3bf  Check if scripts are allowed, regardless of location

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 main/expat/expat-2.2.10.patch  | 4188 
 main/expat/expat-2.2.11.patch  | 2745 -
 main/expat/makefile.mk |2 +-
 .../source/protocolhandler/scripthandler.cxx   |8 +-
 main/sfx2/source/doc/docmacromode.cxx  |   80 +-
 main/sfx2/source/doc/objmisc.cxx   |4 +-
 6 files changed, 4247 insertions(+), 2780 deletions(-)
 delete mode 100644 main/expat/expat-2.2.11.patch


[openoffice] 03/05: Do not allow macros by default when there are none

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 7f7da15fdecd4210d1c7dd58e7ea673770d63612
Author: Arrigo Marchiori 
AuthorDate: Tue Oct 19 20:23:01 2021 +0200

Do not allow macros by default when there are none

(cherry picked from commit 4018d3b8a14b17c2bbe7eaec1ac3a460adc072cb)
---
 main/sfx2/source/doc/docmacromode.cxx | 80 +++
 1 file changed, 54 insertions(+), 26 deletions(-)

diff --git a/main/sfx2/source/doc/docmacromode.cxx 
b/main/sfx2/source/doc/docmacromode.cxx
index 291d0bc..5aca779 100644
--- a/main/sfx2/source/doc/docmacromode.cxx
+++ b/main/sfx2/source/doc/docmacromode.cxx
@@ -159,27 +159,14 @@ namespace sfx2
 return sal_False;
 }
 
-   //
-sal_Bool DocumentMacroMode::adjustMacroMode( const Reference< 
XInteractionHandler >& rxInteraction )
+/** Change the indicated macro execution mode depending on the current 
macro security level.
+ *
+ * @param nMacroExecutionMode current execution mode (must be one of 
MacroExecMode::USE_XXX).
+ *
+ * Changes nMacroExecutionMode according to the current security options, 
if applicable.
+ */
+static void adjustMacroExecModeSecurity(sal_uInt16 )
 {
-sal_uInt16 nMacroExecutionMode = 
m_pData->m_rDocumentAccess.getCurrentMacroExecMode();
-
-if ( SvtSecurityOptions().IsMacroDisabled() )
-{
-// no macro should be executed at all
-lcl_showMacrosDisabledError( rxInteraction, 
m_pData->m_bMacroDisabledMessageShown );
-return disallowMacroExecution();
-}
-
-// get setting from configuration if required
-enum AutoConfirmation
-{
-eNoAutoConfirm,
-eAutoConfirmApprove,
-eAutoConfirmReject
-};
-AutoConfirmation eAutoConfirm( eNoAutoConfirm );
-
 if  (   ( nMacroExecutionMode == MacroExecMode::USE_CONFIG )
 ||  ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION )
 ||  ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_APPROVE_CONFIRMATION )
@@ -205,12 +192,36 @@ namespace sfx2
 nMacroExecutionMode = MacroExecMode::NEVER_EXECUTE;
 }
 
-if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION )
-eAutoConfirm = eAutoConfirmReject;
-else if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_APPROVE_CONFIRMATION )
-eAutoConfirm = eAutoConfirmApprove;
+}
+}
+
+   //
+sal_Bool DocumentMacroMode::adjustMacroMode( const Reference< 
XInteractionHandler >& rxInteraction )
+{
+sal_uInt16 nMacroExecutionMode = 
m_pData->m_rDocumentAccess.getCurrentMacroExecMode();
+
+if ( SvtSecurityOptions().IsMacroDisabled() )
+{
+// no macro should be executed at all
+lcl_showMacrosDisabledError( rxInteraction, 
m_pData->m_bMacroDisabledMessageShown );
+return disallowMacroExecution();
 }
 
+// get setting from configuration if required
+enum AutoConfirmation
+{
+eNoAutoConfirm,
+eAutoConfirmApprove,
+eAutoConfirmReject
+};
+AutoConfirmation eAutoConfirm( eNoAutoConfirm );
+
+adjustMacroExecModeSecurity(nMacroExecutionMode);
+if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION )
+eAutoConfirm = eAutoConfirmReject;
+else if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_APPROVE_CONFIRMATION )
+eAutoConfirm = eAutoConfirmApprove;
+
 if ( nMacroExecutionMode == MacroExecMode::NEVER_EXECUTE )
 return sal_False;
 
@@ -420,8 +431,25 @@ namespace sfx2
 }
 else if ( !isMacroExecutionDisallowed() )
 {
-// if macros will be added by the user later, the security 
check is obsolete
-bAllow = allowMacroExecution();
+// There are no macros (yet) but we want to be careful anyway
+sal_uInt16 nMacroExecutionMode = 
m_pData->m_rDocumentAccess.getCurrentMacroExecMode();
+adjustMacroExecModeSecurity(nMacroExecutionMode);
+switch (nMacroExecutionMode) {
+case MacroExecMode::NEVER_EXECUTE:
+case MacroExecMode::USE_CONFIG:
+case MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION:
+case MacroExecMode::FROM_LIST_NO_WARN:
+case MacroExecMode::FROM_LIST_AND_SIGNED_WARN:
+case MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN:
+bAllow = sal_False;
+

[openoffice] 02/02: Produce expat-2.2.13, derived from 2.4.7

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit fc33a8e79fbea019c341dc93e167863910b03cf9
Author: Arrigo Marchiori 
AuthorDate: Wed Mar 9 21:11:35 2022 +0100

Produce expat-2.2.13, derived from 2.4.7

(cherry picked from commit 6027210f9c9f69912774bd8cb8d0c1709c8a875e)
---
 main/expat/expat-2.2.10.patch | 888 +-
 1 file changed, 786 insertions(+), 102 deletions(-)

diff --git a/main/expat/expat-2.2.10.patch b/main/expat/expat-2.2.10.patch
index b6413d6..0de7936 100644
--- a/main/expat/expat-2.2.10.patch
+++ b/main/expat/expat-2.2.10.patch
@@ -360,7 +360,7 @@ diff -ru misc/expat-2.2.10/doc/xmlwf.xml 
misc/build/expat-2.2.10/doc/xmlwf.xml

 diff -ru misc/expat-2.2.10/lib/expat.h misc/build/expat-2.2.10/lib/expat.h
 --- misc/expat-2.2.10/lib/expat.h  2020-10-03 17:14:57.0 +0200
-+++ misc/build/expat-2.2.10/lib/expat.h2022-03-05 12:25:27.583396678 
+0100
 misc/build/expat-2.2.10/lib/expat.h2022-03-09 20:25:36.712575539 
+0100
 @@ -115,7 +115,10 @@
XML_ERROR_RESERVED_PREFIX_XMLNS,
XML_ERROR_RESERVED_NAMESPACE_URI,
@@ -408,7 +408,7 @@ diff -ru misc/expat-2.2.10/lib/expat.h 
misc/build/expat-2.2.10/lib/expat.h
  #define XML_MAJOR_VERSION 2
  #define XML_MINOR_VERSION 2
 -#define XML_MICRO_VERSION 10
-+#define XML_MICRO_VERSION 12
++#define XML_MICRO_VERSION 13
  
  #ifdef __cplusplus
  }
@@ -520,7 +520,7 @@ diff -ru misc/expat-2.2.10/lib/Makefile.in 
misc/build/expat-2.2.10/lib/Makefile.
  srcdir = @srcdir@
 diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
 --- misc/expat-2.2.10/lib/xmlparse.c   2020-10-03 17:14:57.0 +0200
-+++ misc/build/expat-2.2.10/lib/xmlparse.c 2022-03-05 12:25:27.583396678 
+0100
 misc/build/expat-2.2.10/lib/xmlparse.c 2022-03-09 20:25:36.712575539 
+0100
 @@ -47,6 +47,7 @@
  #include  /* UINT_MAX */
  #include   /* fprintf */
@@ -540,6 +540,15 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  #elif defined(HAVE_EXPAT_CONFIG_H)
  #  include 
  #endif /* ndef _WIN32 */
+@@ -116,7 +121,7 @@
+   * BSD / macOS (including <10.7) (arc4random): HAVE_ARC4RANDOM, \
+   * libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, \
+   * libbsd (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, \
+-  * Linux (including <3.17) / BSD / macOS (including <10.7) 
(/dev/urandom): XML_DEV_URANDOM, \
++  * Linux (including <3.17) / BSD / macOS (including <10.7) / Solaris >=8 
(/dev/urandom): XML_DEV_URANDOM, \
+   * Windows >=Vista (rand_s): _WIN32. \
+ \
+ If insist on not using any of these, bypass this error by defining \
 @@ -382,6 +387,31 @@
XML_Bool betweenDecl; /* WFC: PE Between Declarations */
  } OPEN_INTERNAL_ENTITY;
@@ -672,7 +681,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  };
  
  #define MALLOC(parser, s) (parser->m_mem.malloc_fcn((s)))
-@@ -640,6 +708,7 @@
+@@ -640,9 +708,11 @@
  XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) {
XML_Char tmp[2];
*tmp = nsSep;
@@ -680,7 +689,11 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
return XML_ParserCreate_MM(encodingName, NULL, tmp);
  }
  
-@@ -809,9 +878,8 @@
++// "xml=http://www.w3.org/XML/1998/namespace;
+ static const XML_Char implicitContext[]
+ = {ASCII_x, ASCII_m, ASCII_l,  ASCII_EQUALS, ASCII_h,
+ASCII_t, ASCII_t, ASCII_p,  ASCII_COLON,  ASCII_SLASH,
+@@ -809,9 +879,8 @@
  
  static unsigned long
  ENTROPY_DEBUG(const char *label, unsigned long entropy) {
@@ -692,7 +705,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  (int)sizeof(entropy) * 2, entropy, (unsigned 
long)sizeof(entropy));
}
return entropy;
-@@ -855,7 +923,7 @@
+@@ -855,7 +924,7 @@
  return ENTROPY_DEBUG("fallback(4)", entropy * 2147483647);
} else {
  return ENTROPY_DEBUG("fallback(8)",
@@ -701,7 +714,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
}
  #endif
  }
-@@ -1073,6 +1141,18 @@
+@@ -1073,6 +1142,18 @@
parser->m_paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
  #endif
parser->m_hash_secret_salt = 0;
@@ -720,7 +733,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  }
  
  /* moves list of bindings to m_freeBindingList */
-@@ -1255,6 +1335,7 @@
+@@ -1255,6 +1336,7 @@
if (parser->m_ns) {
  XML_Char tmp[2];
  *tmp = parser->m_namespaceSeparator;
@@ -728,7 +741,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  parser = parserCreate(encodingName, >m_mem, tmp, newDtd);
} else {
  parser = parserCreate(encodingName, >m_mem, NULL, newDtd);
-@@ -1893,6 +1974,12 @@

[openoffice] branch AOO41X updated (85aaee6 -> fc33a8e)

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a change to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git.


from 85aaee6  Changed graphic (About) for this release
 new 1cc17f6  Upgrade expat-2.2.10 into 2.2.12
 new fc33a8e  Produce expat-2.2.13, derived from 2.4.7

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 main/expat/expat-2.2.10.patch | 4188 +
 main/expat/expat-2.2.11.patch | 2745 ---
 main/expat/makefile.mk|2 +-
 3 files changed, 4189 insertions(+), 2746 deletions(-)
 delete mode 100644 main/expat/expat-2.2.11.patch


[openoffice] 02/03: All scripts must be subject to checks

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit fb9ad7aa17549019ccdd2762a97d104449abf45d
Author: Arrigo Marchiori 
AuthorDate: Tue Oct 19 20:24:17 2021 +0200

All scripts must be subject to checks
---
 main/scripting/source/protocolhandler/scripthandler.cxx | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/main/scripting/source/protocolhandler/scripthandler.cxx 
b/main/scripting/source/protocolhandler/scripthandler.cxx
index d064fde..85643ee 100644
--- a/main/scripting/source/protocolhandler/scripthandler.cxx
+++ b/main/scripting/source/protocolhandler/scripthandler.cxx
@@ -166,11 +166,9 @@ void SAL_CALL 
ScriptProtocolHandler::dispatchWithNotification(
 ::rtl::OUString sLocation = xScriptUri->getParameter( 
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "location" ) ) );
 bool bIsDocumentScript = ( sLocation == ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "document" ) ) );
 
-if ( bIsDocumentScript )
-{
-// obtain the component for our security check
-Reference< XEmbeddedScripts > xDocumentScripts;
-if ( getScriptInvocation() )
+// obtain the component for our security check. We could check 
bIsDocumentScript but the "location" could be forged
+if ( getScriptInvocation() ) {
+Reference< XEmbeddedScripts > xDocumentScripts;
 xDocumentScripts.set( 
m_xScriptInvocation->getScriptContainer(), UNO_SET_THROW );
 
 OSL_ENSURE( xDocumentScripts.is(), 
"ScriptProtocolHandler::dispatchWithNotification: can't do the security check!" 
);


[openoffice] 01/03: Do not allow macros by default when there are none

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 4018d3b8a14b17c2bbe7eaec1ac3a460adc072cb
Author: Arrigo Marchiori 
AuthorDate: Tue Oct 19 20:23:01 2021 +0200

Do not allow macros by default when there are none
---
 main/sfx2/source/doc/docmacromode.cxx | 80 +++
 1 file changed, 54 insertions(+), 26 deletions(-)

diff --git a/main/sfx2/source/doc/docmacromode.cxx 
b/main/sfx2/source/doc/docmacromode.cxx
index 291d0bc..5aca779 100644
--- a/main/sfx2/source/doc/docmacromode.cxx
+++ b/main/sfx2/source/doc/docmacromode.cxx
@@ -159,27 +159,14 @@ namespace sfx2
 return sal_False;
 }
 
-   //
-sal_Bool DocumentMacroMode::adjustMacroMode( const Reference< 
XInteractionHandler >& rxInteraction )
+/** Change the indicated macro execution mode depending on the current 
macro security level.
+ *
+ * @param nMacroExecutionMode current execution mode (must be one of 
MacroExecMode::USE_XXX).
+ *
+ * Changes nMacroExecutionMode according to the current security options, 
if applicable.
+ */
+static void adjustMacroExecModeSecurity(sal_uInt16 )
 {
-sal_uInt16 nMacroExecutionMode = 
m_pData->m_rDocumentAccess.getCurrentMacroExecMode();
-
-if ( SvtSecurityOptions().IsMacroDisabled() )
-{
-// no macro should be executed at all
-lcl_showMacrosDisabledError( rxInteraction, 
m_pData->m_bMacroDisabledMessageShown );
-return disallowMacroExecution();
-}
-
-// get setting from configuration if required
-enum AutoConfirmation
-{
-eNoAutoConfirm,
-eAutoConfirmApprove,
-eAutoConfirmReject
-};
-AutoConfirmation eAutoConfirm( eNoAutoConfirm );
-
 if  (   ( nMacroExecutionMode == MacroExecMode::USE_CONFIG )
 ||  ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION )
 ||  ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_APPROVE_CONFIRMATION )
@@ -205,12 +192,36 @@ namespace sfx2
 nMacroExecutionMode = MacroExecMode::NEVER_EXECUTE;
 }
 
-if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION )
-eAutoConfirm = eAutoConfirmReject;
-else if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_APPROVE_CONFIRMATION )
-eAutoConfirm = eAutoConfirmApprove;
+}
+}
+
+   //
+sal_Bool DocumentMacroMode::adjustMacroMode( const Reference< 
XInteractionHandler >& rxInteraction )
+{
+sal_uInt16 nMacroExecutionMode = 
m_pData->m_rDocumentAccess.getCurrentMacroExecMode();
+
+if ( SvtSecurityOptions().IsMacroDisabled() )
+{
+// no macro should be executed at all
+lcl_showMacrosDisabledError( rxInteraction, 
m_pData->m_bMacroDisabledMessageShown );
+return disallowMacroExecution();
 }
 
+// get setting from configuration if required
+enum AutoConfirmation
+{
+eNoAutoConfirm,
+eAutoConfirmApprove,
+eAutoConfirmReject
+};
+AutoConfirmation eAutoConfirm( eNoAutoConfirm );
+
+adjustMacroExecModeSecurity(nMacroExecutionMode);
+if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION )
+eAutoConfirm = eAutoConfirmReject;
+else if ( nMacroExecutionMode == 
MacroExecMode::USE_CONFIG_APPROVE_CONFIRMATION )
+eAutoConfirm = eAutoConfirmApprove;
+
 if ( nMacroExecutionMode == MacroExecMode::NEVER_EXECUTE )
 return sal_False;
 
@@ -420,8 +431,25 @@ namespace sfx2
 }
 else if ( !isMacroExecutionDisallowed() )
 {
-// if macros will be added by the user later, the security 
check is obsolete
-bAllow = allowMacroExecution();
+// There are no macros (yet) but we want to be careful anyway
+sal_uInt16 nMacroExecutionMode = 
m_pData->m_rDocumentAccess.getCurrentMacroExecMode();
+adjustMacroExecModeSecurity(nMacroExecutionMode);
+switch (nMacroExecutionMode) {
+case MacroExecMode::NEVER_EXECUTE:
+case MacroExecMode::USE_CONFIG:
+case MacroExecMode::USE_CONFIG_REJECT_CONFIRMATION:
+case MacroExecMode::FROM_LIST_NO_WARN:
+case MacroExecMode::FROM_LIST_AND_SIGNED_WARN:
+case MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN:
+bAllow = sal_False;
+break;
+case MacroExecMode::FROM_LIST:
+case 

[openoffice] 03/03: Check if scripts are allowed, regardless of location

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit aea5254635d14376dd83e528769fd1dec8f7dbd7
Author: Arrigo Marchiori 
AuthorDate: Sat Oct 23 14:26:30 2021 +0200

Check if scripts are allowed, regardless of location
---
 main/sfx2/source/doc/objmisc.cxx | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/main/sfx2/source/doc/objmisc.cxx b/main/sfx2/source/doc/objmisc.cxx
index 90c7c67..9144937 100644
--- a/main/sfx2/source/doc/objmisc.cxx
+++ b/main/sfx2/source/doc/objmisc.cxx
@@ -1707,9 +1707,7 @@ ErrCode SfxObjectShell::CallXScript( const Reference< 
XInterface >& _rxScriptCon
 xServiceManager->createInstance( rtl::OUString::createFromAscii(
 "com.sun.star.uri.UriReferenceFactory") ) , UNO_QUERY_THROW );
 Reference< uri::XVndSunStarScriptUrlReference > xScriptUri( 
xFac->parse( _rScriptURL ), UNO_QUERY_THROW );
-::rtl::OUString sLocation = xScriptUri->getParameter( ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "location" ) ) );
-bool bIsDocumentScript = ( sLocation == ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "document" ) ) );
-if ( bIsDocumentScript && !lcl_isScriptAccessAllowed_nothrow( 
_rxScriptContext ) )
+if ( !lcl_isScriptAccessAllowed_nothrow( _rxScriptContext ) )
 return ERRCODE_IO_ACCESSDENIED;
 
 // obtain/create a script provider


[openoffice] branch trunk updated (84b8003 -> aea5254)

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git.


from 84b8003  Produce expat-2.2.13, derived from 2.4.7
 new 4018d3b  Do not allow macros by default when there are none
 new fb9ad7a  All scripts must be subject to checks
 new aea5254  Check if scripts are allowed, regardless of location

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../source/protocolhandler/scripthandler.cxx   |  8 +--
 main/sfx2/source/doc/docmacromode.cxx  | 80 +++---
 main/sfx2/source/doc/objmisc.cxx   |  4 +-
 3 files changed, 58 insertions(+), 34 deletions(-)


[openoffice] 02/02: Produce expat-2.2.13, derived from 2.4.7

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 84b800346361a798f2dacc3e03dc6b4a6358f3cf
Author: Arrigo Marchiori 
AuthorDate: Wed Mar 9 21:11:35 2022 +0100

Produce expat-2.2.13, derived from 2.4.7
---
 main/expat/expat-2.2.10.patch | 888 +-
 1 file changed, 786 insertions(+), 102 deletions(-)

diff --git a/main/expat/expat-2.2.10.patch b/main/expat/expat-2.2.10.patch
index b6413d6..0de7936 100644
--- a/main/expat/expat-2.2.10.patch
+++ b/main/expat/expat-2.2.10.patch
@@ -360,7 +360,7 @@ diff -ru misc/expat-2.2.10/doc/xmlwf.xml 
misc/build/expat-2.2.10/doc/xmlwf.xml

 diff -ru misc/expat-2.2.10/lib/expat.h misc/build/expat-2.2.10/lib/expat.h
 --- misc/expat-2.2.10/lib/expat.h  2020-10-03 17:14:57.0 +0200
-+++ misc/build/expat-2.2.10/lib/expat.h2022-03-05 12:25:27.583396678 
+0100
 misc/build/expat-2.2.10/lib/expat.h2022-03-09 20:25:36.712575539 
+0100
 @@ -115,7 +115,10 @@
XML_ERROR_RESERVED_PREFIX_XMLNS,
XML_ERROR_RESERVED_NAMESPACE_URI,
@@ -408,7 +408,7 @@ diff -ru misc/expat-2.2.10/lib/expat.h 
misc/build/expat-2.2.10/lib/expat.h
  #define XML_MAJOR_VERSION 2
  #define XML_MINOR_VERSION 2
 -#define XML_MICRO_VERSION 10
-+#define XML_MICRO_VERSION 12
++#define XML_MICRO_VERSION 13
  
  #ifdef __cplusplus
  }
@@ -520,7 +520,7 @@ diff -ru misc/expat-2.2.10/lib/Makefile.in 
misc/build/expat-2.2.10/lib/Makefile.
  srcdir = @srcdir@
 diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
 --- misc/expat-2.2.10/lib/xmlparse.c   2020-10-03 17:14:57.0 +0200
-+++ misc/build/expat-2.2.10/lib/xmlparse.c 2022-03-05 12:25:27.583396678 
+0100
 misc/build/expat-2.2.10/lib/xmlparse.c 2022-03-09 20:25:36.712575539 
+0100
 @@ -47,6 +47,7 @@
  #include  /* UINT_MAX */
  #include   /* fprintf */
@@ -540,6 +540,15 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  #elif defined(HAVE_EXPAT_CONFIG_H)
  #  include 
  #endif /* ndef _WIN32 */
+@@ -116,7 +121,7 @@
+   * BSD / macOS (including <10.7) (arc4random): HAVE_ARC4RANDOM, \
+   * libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, \
+   * libbsd (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, \
+-  * Linux (including <3.17) / BSD / macOS (including <10.7) 
(/dev/urandom): XML_DEV_URANDOM, \
++  * Linux (including <3.17) / BSD / macOS (including <10.7) / Solaris >=8 
(/dev/urandom): XML_DEV_URANDOM, \
+   * Windows >=Vista (rand_s): _WIN32. \
+ \
+ If insist on not using any of these, bypass this error by defining \
 @@ -382,6 +387,31 @@
XML_Bool betweenDecl; /* WFC: PE Between Declarations */
  } OPEN_INTERNAL_ENTITY;
@@ -672,7 +681,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  };
  
  #define MALLOC(parser, s) (parser->m_mem.malloc_fcn((s)))
-@@ -640,6 +708,7 @@
+@@ -640,9 +708,11 @@
  XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) {
XML_Char tmp[2];
*tmp = nsSep;
@@ -680,7 +689,11 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
return XML_ParserCreate_MM(encodingName, NULL, tmp);
  }
  
-@@ -809,9 +878,8 @@
++// "xml=http://www.w3.org/XML/1998/namespace;
+ static const XML_Char implicitContext[]
+ = {ASCII_x, ASCII_m, ASCII_l,  ASCII_EQUALS, ASCII_h,
+ASCII_t, ASCII_t, ASCII_p,  ASCII_COLON,  ASCII_SLASH,
+@@ -809,9 +879,8 @@
  
  static unsigned long
  ENTROPY_DEBUG(const char *label, unsigned long entropy) {
@@ -692,7 +705,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  (int)sizeof(entropy) * 2, entropy, (unsigned 
long)sizeof(entropy));
}
return entropy;
-@@ -855,7 +923,7 @@
+@@ -855,7 +924,7 @@
  return ENTROPY_DEBUG("fallback(4)", entropy * 2147483647);
} else {
  return ENTROPY_DEBUG("fallback(8)",
@@ -701,7 +714,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
}
  #endif
  }
-@@ -1073,6 +1141,18 @@
+@@ -1073,6 +1142,18 @@
parser->m_paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
  #endif
parser->m_hash_secret_salt = 0;
@@ -720,7 +733,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  }
  
  /* moves list of bindings to m_freeBindingList */
-@@ -1255,6 +1335,7 @@
+@@ -1255,6 +1336,7 @@
if (parser->m_ns) {
  XML_Char tmp[2];
  *tmp = parser->m_namespaceSeparator;
@@ -728,7 +741,7 @@ diff -ru misc/expat-2.2.10/lib/xmlparse.c 
misc/build/expat-2.2.10/lib/xmlparse.c
  parser = parserCreate(encodingName, >m_mem, tmp, newDtd);
} else {
  parser = parserCreate(encodingName, >m_mem, NULL, newDtd);
-@@ -1893,6 +1974,12 @@
+@@ -1893,6 +1975,12 @@
  parser->m_errorCode = XML_ERROR_FINISHED;
  

[openoffice] branch trunk updated (840d0e6 -> 84b8003)

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git.


from 840d0e6  Add "empty" and "not empty" autofilters
 new cbf2698  Upgrade expat-2.2.10 into 2.2.12
 new 84b8003  Produce expat-2.2.13, derived from 2.4.7

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 main/expat/expat-2.2.10.patch | 4188 +
 main/expat/expat-2.2.11.patch | 2745 ---
 main/expat/makefile.mk|2 +-
 3 files changed, 4189 insertions(+), 2746 deletions(-)
 delete mode 100644 main/expat/expat-2.2.11.patch


[openoffice] branch trunk updated: Add "empty" and "not empty" autofilters

2022-03-17 Thread ardovm
This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 840d0e6  Add "empty" and "not empty" autofilters
840d0e6 is described below

commit 840d0e68cbe2cd3d58c46665a26cd95f3fd8a17c
Author: Arrigo Marchiori 
AuthorDate: Wed Mar 16 21:55:52 2022 +0100

Add "empty" and "not empty" autofilters

Patch by Srinivasa Ragavan (sragavan), adapted to current sources

(cherry picked from commit e4261b3f576e1ecd15352e270e6c8ceccdfd4a13)
---
 main/sc/source/ui/view/gridwin.cxx | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/main/sc/source/ui/view/gridwin.cxx 
b/main/sc/source/ui/view/gridwin.cxx
index c40d38d..c343059 100644
--- a/main/sc/source/ui/view/gridwin.cxx
+++ b/main/sc/source/ui/view/gridwin.cxx
@@ -136,6 +136,8 @@ const sal_uInt8 SC_NESTEDBUTTON_UP   = 2;
 #define SC_AUTOFILTER_ALL  0
 #defineSC_AUTOFILTER_TOP10 1
 #defineSC_AUTOFILTER_CUSTOM2
+#define SC_AUTOFILTER_EMPTY 3
+#define SC_AUTOFILTER_NOTEMPTY  4
 
 // Modi fuer die FilterListBox
 enum ScFilterBoxMode
@@ -975,7 +977,7 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW 
nRow, sal_Bool bDataSele
long nMaxText = 0;
 
//  default entries
-static const sal_uInt16 nDefIDs[] = { SCSTR_ALLFILTER, 
SCSTR_TOP10FILTER, SCSTR_STDFILTER };
+static const sal_uInt16 nDefIDs[] = { SCSTR_ALLFILTER, 
SCSTR_TOP10FILTER, SCSTR_STDFILTER, SCSTR_EMPTY, SCSTR_NOTEMPTY };
const sal_uInt16 nDefCount = sizeof(nDefIDs) / 
sizeof(sal_uInt16);
for (i=0; iErase();
+rNewEntry.bQueryByString = sal_False;
+rNewEntry.eOp   = SC_EQUAL;
+rNewEntry.nVal  = SC_EMPTYFIELDS;
+}
+else if (nSel == SC_AUTOFILTER_NOTEMPTY)
+{
+rNewEntry.pStr->Erase();
+rNewEntry.bQueryByString = sal_False;
+rNewEntry.eOp   = SC_EQUAL;
+rNewEntry.nVal  = SC_NONEMPTYFIELDS;
+}
+else
{
rNewEntry.eOp   = SC_EQUAL;
*rNewEntry.pStr = aValue;


[openoffice] branch AOO42X updated: Fixed typos, removed whitespace

2022-03-17 Thread mseidel
This is an automated email from the ASF dual-hosted git repository.

mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO42X by this push:
 new c7c1ab4  Fixed typos, removed whitespace
c7c1ab4 is described below

commit c7c1ab4fba8302322bb616e6b3074304620e74d9
Author: mseidel 
AuthorDate: Thu Mar 17 13:33:38 2022 +0100

Fixed typos, removed whitespace

(cherry picked from commit 805551cc14ce732b210f2cf98871869a3d131bd9)
---
 main/vcl/source/window/brdwin.cxx | 236 +++---
 1 file changed, 118 insertions(+), 118 deletions(-)

diff --git a/main/vcl/source/window/brdwin.cxx 
b/main/vcl/source/window/brdwin.cxx
index 2b7e1d1..114b694 100644
--- a/main/vcl/source/window/brdwin.cxx
+++ b/main/vcl/source/window/brdwin.cxx
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  * 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
@@ -7,16 +7,16 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  */
 
 
@@ -57,9 +57,9 @@ static void ImplGetPinImage( sal_uInt16 nStyle, sal_Bool 
bPinIn, Image& rImage )
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maCtrlData.mpPinImgList )
{
-ResMgr* pResMgr = ImplGetResMgr();
+   ResMgr* pResMgr = ImplGetResMgr();
pSVData->maCtrlData.mpPinImgList = new ImageList();
-if( pResMgr )
+   if( pResMgr )
{
Color aMaskColor( 0x00, 0x00, 0xFF );

pSVData->maCtrlData.mpPinImgList->InsertFromHorizontalBitmap
@@ -126,13 +126,13 @@ static void ImplDrawBrdWinSymbolButton( OutputDevice* 
pDev,

const Rectangle& rRect,

SymbolType eSymbol, sal_uInt16 nState )
 {
-sal_Bool bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0;
-nState &= ~BUTTON_DRAW_HIGHLIGHT;
+   sal_Bool bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0;
+   nState &= ~BUTTON_DRAW_HIGHLIGHT;
 
Rectangle aTempRect;
-Window *pWin = dynamic_cast< Window* >(pDev);
-if( pWin )
-{
+   Window *pWin = dynamic_cast< Window* >(pDev);
+   if( pWin )
+   {
 if( bMouseOver )
 {
 // provide a bright background for selection effect
@@ -147,12 +147,12 @@ static void ImplDrawBrdWinSymbolButton( OutputDevice* 
pDev,
 aTempRect.nRight-=4;
 aTempRect.nTop+=3;
 aTempRect.nBottom-=4;
-}
-else
-{
-   DecorationView aDecoView( pDev );
-   aTempRect = aDecoView.DrawButton( rRect, nState|BUTTON_DRAW_FLAT );
-}
+   }
+   else
+   {
+   DecorationView aDecoView( pDev );
+   aTempRect = aDecoView.DrawButton( rRect, 
nState|BUTTON_DRAW_FLAT );
+   }
ImplDrawBrdWinSymbol( pDev, aTempRect, eSymbol );
 }
 
@@ -199,7 +199,7 @@ String ImplBorderWindowView::RequestHelp( const Point&, 
Rectangle& )
 
 Rectangle ImplBorderWindowView::GetMenuRect() const
 {
-return Rectangle();
+   return Rectangle();
 }
 
 // ---
@@ -271,12 +271,12 @@ sal_uInt16 ImplBorderWindowView::ImplHitTest( 
ImplBorderFrameData* pData, const
if ( nSizeWidth < 16 )
nSizeWidth = 16;
 
-// no corner resize for floating toolbars, which would lead to jumps 
while formatting
-// setting nSizeWidth = 0 will only return pure left,top,right,bottom
-if( pBorderWindow->GetStyle() & WB_OWNERDRAWDECORATION )
-nSizeWidth = 0;
+   // no corner resize for floating toolbars, which would lead to 
jumps while formatting
+   // setting nSizeWidth = 0 will only return pure 
left,top,right,bottom
+   if( pBorderWindow->GetStyle() & WB_OWNERDRAWDECORATION )
+   nSizeWidth = 0;
 
-if ( rPos.X() < pData->mnLeftBorder )
+   if ( rPos.X() < pData->mnLeftBorder )
{
if ( 

[openoffice] branch trunk updated: Fixed typos, removed whitespace

2022-03-17 Thread mseidel
This is an automated email from the ASF dual-hosted git repository.

mseidel pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 805551c  Fixed typos, removed whitespace
805551c is described below

commit 805551cc14ce732b210f2cf98871869a3d131bd9
Author: mseidel 
AuthorDate: Thu Mar 17 13:33:38 2022 +0100

Fixed typos, removed whitespace
---
 main/vcl/source/window/brdwin.cxx | 236 +++---
 1 file changed, 118 insertions(+), 118 deletions(-)

diff --git a/main/vcl/source/window/brdwin.cxx 
b/main/vcl/source/window/brdwin.cxx
index 2b7e1d1..114b694 100644
--- a/main/vcl/source/window/brdwin.cxx
+++ b/main/vcl/source/window/brdwin.cxx
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  * 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
@@ -7,16 +7,16 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  */
 
 
@@ -57,9 +57,9 @@ static void ImplGetPinImage( sal_uInt16 nStyle, sal_Bool 
bPinIn, Image& rImage )
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maCtrlData.mpPinImgList )
{
-ResMgr* pResMgr = ImplGetResMgr();
+   ResMgr* pResMgr = ImplGetResMgr();
pSVData->maCtrlData.mpPinImgList = new ImageList();
-if( pResMgr )
+   if( pResMgr )
{
Color aMaskColor( 0x00, 0x00, 0xFF );

pSVData->maCtrlData.mpPinImgList->InsertFromHorizontalBitmap
@@ -126,13 +126,13 @@ static void ImplDrawBrdWinSymbolButton( OutputDevice* 
pDev,

const Rectangle& rRect,

SymbolType eSymbol, sal_uInt16 nState )
 {
-sal_Bool bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0;
-nState &= ~BUTTON_DRAW_HIGHLIGHT;
+   sal_Bool bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0;
+   nState &= ~BUTTON_DRAW_HIGHLIGHT;
 
Rectangle aTempRect;
-Window *pWin = dynamic_cast< Window* >(pDev);
-if( pWin )
-{
+   Window *pWin = dynamic_cast< Window* >(pDev);
+   if( pWin )
+   {
 if( bMouseOver )
 {
 // provide a bright background for selection effect
@@ -147,12 +147,12 @@ static void ImplDrawBrdWinSymbolButton( OutputDevice* 
pDev,
 aTempRect.nRight-=4;
 aTempRect.nTop+=3;
 aTempRect.nBottom-=4;
-}
-else
-{
-   DecorationView aDecoView( pDev );
-   aTempRect = aDecoView.DrawButton( rRect, nState|BUTTON_DRAW_FLAT );
-}
+   }
+   else
+   {
+   DecorationView aDecoView( pDev );
+   aTempRect = aDecoView.DrawButton( rRect, 
nState|BUTTON_DRAW_FLAT );
+   }
ImplDrawBrdWinSymbol( pDev, aTempRect, eSymbol );
 }
 
@@ -199,7 +199,7 @@ String ImplBorderWindowView::RequestHelp( const Point&, 
Rectangle& )
 
 Rectangle ImplBorderWindowView::GetMenuRect() const
 {
-return Rectangle();
+   return Rectangle();
 }
 
 // ---
@@ -271,12 +271,12 @@ sal_uInt16 ImplBorderWindowView::ImplHitTest( 
ImplBorderFrameData* pData, const
if ( nSizeWidth < 16 )
nSizeWidth = 16;
 
-// no corner resize for floating toolbars, which would lead to jumps 
while formatting
-// setting nSizeWidth = 0 will only return pure left,top,right,bottom
-if( pBorderWindow->GetStyle() & WB_OWNERDRAWDECORATION )
-nSizeWidth = 0;
+   // no corner resize for floating toolbars, which would lead to 
jumps while formatting
+   // setting nSizeWidth = 0 will only return pure 
left,top,right,bottom
+   if( pBorderWindow->GetStyle() & WB_OWNERDRAWDECORATION )
+   nSizeWidth = 0;
 
-if ( rPos.X() < pData->mnLeftBorder )
+   if ( rPos.X() < pData->mnLeftBorder )
{
if ( rPos.Y() < nSizeWidth )
return 

[openoffice] 01/01: Merge pull request #142 from apache/bug35578

2022-03-17 Thread plino
This is an automated email from the ASF dual-hosted git repository.

plino pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 0a1dc6febe7dbb7b160a55503b5d35eb95d30504
Merge: aa7e5ae e4261b3
Author: Pedro Lino <34394465+pedl...@users.noreply.github.com>
AuthorDate: Thu Mar 17 11:18:40 2022 +

Merge pull request #142 from apache/bug35578

Add "empty" and "not empty" autofilters

 main/sc/source/ui/view/gridwin.cxx | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)


[openoffice] branch AOO42X updated (aa7e5ae -> 0a1dc6f)

2022-03-17 Thread plino
This is an automated email from the ASF dual-hosted git repository.

plino pushed a change to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git.


from aa7e5ae  Fixed typo (menue -> menu) and some more
 add e4261b3  Add "empty" and "not empty" autofilters
 new 0a1dc6f  Merge pull request #142 from apache/bug35578

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 main/sc/source/ui/view/gridwin.cxx | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)