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

2023-11-17 Thread Balazs Varga (via logerrit)
 include/unotools/compatibility.hxx   |   55 
 sw/source/ui/config/optcomp.cxx  |   18 -
 unotools/source/config/compatibility.cxx |   60 +++
 3 files changed, 132 insertions(+), 1 deletion(-)

New commits:
commit 35f59457ff434b7b97cad6ce1dbef6ff07f7bc96
Author: Balazs Varga 
AuthorDate: Thu Nov 16 17:03:39 2023 +0100
Commit: Balazs Varga 
CommitDate: Fri Nov 17 18:55:22 2023 +0100

tdf#158135 - UI: Part 30 - Unify lockdown behavior of Options dialog

for Writer - Compatibility Page.

Change-Id: Id9ad445b451b332314f72f54e183730097584a74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159513
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index 620d3c1c3fa4..9c2acefcf1d7 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -131,8 +132,50 @@ class SvtCompatibilityEntry
 setValue(rIdx, css::uno::Any(rValue));
 }
 
+bool getPropertyReadOnly(const Index rIdx) const
+{
+if (static_cast(rIdx) < getElementCount())
+{
+return m_aPropertyReadOnly.at(static_cast(rIdx));
+}
+else
+{
+/* Wrong index. */
+assert(false);
+return false;
+}
+}
+
+void setPropertyReadOnly(const Index rIdx, const bool bReadOnly)
+{
+if (static_cast(rIdx) < getElementCount())
+{
+m_aPropertyReadOnly.insert({ static_cast(rIdx), bReadOnly 
});
+}
+else
+{
+/* Wrong index. */
+assert(false);
+}
+}
+
+bool haveReadOnlyProperty() const
+{
+bool bRet = false;
+for (const auto& pair : m_aPropertyReadOnly)
+{
+if (pair.second == true)
+{
+bRet = true;
+break;
+}
+}
+return bRet;
+}
+
 private:
 std::vector m_aPropertyValue;
+std::map m_aPropertyReadOnly;
 };
 
 
/*-
@@ -183,6 +226,18 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions final : 
public utl::detail::Opt
 
*//*-*/
 std::vector< SvtCompatibilityEntry > GetList() const;
 
+
/*-
+@short  return property/option is readonly or not
+@descr  Call it to get the readonly status of default entry of
+compatibility options.
+@return Return true if the compatibility option is true, 
otherwise false.
+
+@onerrorWe return false.
+
*//*-*/
+bool GetPropertyReadOnly( SvtCompatibilityEntry::Index rIdx ) const;
+bool GetDefaultPropertyReadOnly( SvtCompatibilityEntry::Index rIdx ) 
const;
+bool HaveDefaultReadOnlyProperty() const;
+
 private:
 std::shared_ptr m_pImpl;
 
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index a1ea231d305c..1393b2864d95 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -216,7 +216,7 @@ void SwCompatibilityOptPage::InitControls( const 
SfxItemSet& rSet )
 rEntry.getValue( SvtCompatibilityEntry::Index::NoExtLeading 
),
 rEntry.getValue( 
SvtCompatibilityEntry::Index::UseLineSpacing ),
 rEntry.getValue( 
SvtCompatibilityEntry::Index::AddTableSpacing ),
-
rEntry.getValue(SvtCompatibilityEntry::Index::AddTableLineSpacing),
+rEntry.getValue( 
SvtCompatibilityEntry::Index::AddTableLineSpacing),
 rEntry.getValue( 
SvtCompatibilityEntry::Index::UseObjectPositioning ),
 rEntry.getValue( 
SvtCompatibilityEntry::Index::UseOurTextWrapping ),
 rEntry.getValue( 
SvtCompatibilityEntry::Index::ConsiderWrappingStyle ),
@@ -277,9 +277,11 @@ IMPL_LINK_NOARG(SwCompatibilityOptPage, UseAsDefaultHdl, 
weld::Button&, void)
 void SwCompatibilityOptPage::SetCurrentOptions( sal_uInt32 nOptions )
 {
 const int nCount = m_xOptionsLB->n_children();
+const OUString aOptionsName = m_xFormattingLB->get_active_text();
 OSL_ENSURE( nCount <= 32, "SwCompatibilityOptPage::Reset(): entry 
overflow" );
 for (int i = 0; i < nCount; ++i)
 {
+bool 

[Libreoffice-commits] core.git: include/unotools

2023-11-14 Thread Caolán McNamara (via logerrit)
 include/unotools/lingucfg.hxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 13898cc9fefe7227c2119d3996f13d67877b8a6d
Author: Caolán McNamara 
AuthorDate: Tue Nov 14 11:18:25 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 14 13:39:50 2023 +0100

cid#708565 Uninitialized scalar field

left overs since:

commit 9bb9ba6ae02692e65498bae4598e3b63bb65c02e
Date:   Mon Oct 2 12:33:34 2023 +0200

[API CHANGE] Remove deprecated IsSpellCapitalization

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

diff --git a/include/unotools/lingucfg.hxx b/include/unotools/lingucfg.hxx
index c924d7898764..2256daa24964 100644
--- a/include/unotools/lingucfg.hxx
+++ b/include/unotools/lingucfg.hxx
@@ -85,13 +85,11 @@ struct UNOTOOLS_DLLPUBLIC SvtLinguOptions
 // SpellChecker service specific options
 boolbIsSpellWithDigits,
 bIsSpellUpperCase,
-bIsSpellCapitalization,
 bIsSpellClosedCompound,
 bIsSpellHyphenatedCompound;
 
 boolbROIsSpellWithDigits,
 bROIsSpellUpperCase,
-bROIsSpellCapitalization,
 bROIsSpellClosedCompound,
 bROIsSpellHyphenatedCompound;
 


[Libreoffice-commits] core.git: include/unotools

2023-10-02 Thread Samuel Mehrbrodt (via logerrit)
 include/unotools/securityoptions.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 109eab34a6af708da551d220162eac0578e42449
Author: Samuel Mehrbrodt 
AuthorDate: Mon Sep 25 08:41:22 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Oct 2 08:31:29 2023 +0200

Mention correct config key

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

diff --git a/include/unotools/securityoptions.hxx 
b/include/unotools/securityoptions.hxx
index 0cae239c11cb..366317476fd2 100644
--- a/include/unotools/securityoptions.hxx
+++ b/include/unotools/securityoptions.hxx
@@ -92,7 +92,7 @@ namespace SvtSecurityOptions
 UNOTOOLS_DLLPUBLIC void SetSecureURLs( std::vector< OUString >&& 
seqURLList );
 
 
/*-
-@short  interface methods to get and set value of config key 
"org.openoffice.Office.Common/Security/Scripting/StarOfficeBasic"
+@short  interface methods to get and set value of config key 
"org.openoffice.Office.Common/Security/Scripting/MacroSecurityLevel"
 @descr  These value determines how StarOffice Basic scripts 
should be handled.
 It exist 3 different modes:
 0 = never execute


[Libreoffice-commits] core.git: include/unotools

2023-09-25 Thread Caolán McNamara (via logerrit)
 include/unotools/weakref.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7f75bfd0f6b1bf4debb69e96c114e453c62685f8
Author: Caolán McNamara 
AuthorDate: Mon Sep 25 15:40:27 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Sep 25 20:39:05 2023 +0200

Don't enable the requires clause for Clang 15

similar to 5831d5f03a5ea5b89984574ffe436f38500726da
Don't enable the requires clause for some Xcode Clang

Step #3 - "compile-honggfuzz-address-x86_64": checking whether Clang is new 
enough... yes (15.0.0)

In file included from 
libreoffice/core-clang/animations/source/animcore/animcore.cxx:20:
In file included from 
libreoffice/core-clang/workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/util/XCloneable.hpp:8:

libreoffice/core-clang/workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/XInterface.hpp:32:65:
 error: invalid application of 'sizeof' to an incomplete type 
'animcore::(anonymous namespace)::AnimationNode'
template inline constexpr auto isUnoInterfaceType = sizeof (T) 
&& IsUnoInterfaceType::value;
^~
libreoffice/core-clang/include/unotools/weakref.hxx:119:33: note: in 
instantiation of variable template specialization 
'cppu::detail::isUnoInterfaceType' requested here
requires(!cppu::detail::isUnoInterfaceType)
^
libreoffice/core-clang/animations/source/animcore/animcore.cxx:309:44: 
note: in instantiation of template class 
'unotools::WeakReference' 
requested here
unotools::WeakReference mxParent;
   ^
libreoffice/core-clang/animations/source/animcore/animcore.cxx:121:7: note: 
definition of 'animcore::(anonymous namespace)::AnimationNode' is not complete 
until the closing '}'
class AnimationNode final:  public AnimationNodeBase
  ^

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

diff --git a/include/unotools/weakref.hxx b/include/unotools/weakref.hxx
index 9679579feb1e..14ee6d424f62 100644
--- a/include/unotools/weakref.hxx
+++ b/include/unotools/weakref.hxx
@@ -115,7 +115,7 @@ public:
  @return hard reference or null, if the weakly referenced interface 
has gone
 */
 rtl::Reference SAL_CALL get() const
-#if __cplusplus >= 202002L && !(defined __clang__ && __clang_major__ <= 14)
+#if __cplusplus >= 202002L && !(defined __clang__ && __clang_major__ <= 15)
 requires(!cppu::detail::isUnoInterfaceType)
 #endif
 {


[Libreoffice-commits] core.git: include/unotools

2023-08-02 Thread Stephan Bergmann (via logerrit)
 include/unotools/weakref.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4e63159387b490e5ea49471f13c30ad60923e866
Author: Stephan Bergmann 
AuthorDate: Wed Aug 2 16:40:42 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Aug 2 18:47:03 2023 +0200

Make the Xcode workaround apply more broadly

...so that it should also work for
, which reports

> checking whether Xcode is new enough... yes (13.3.1)

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

diff --git a/include/unotools/weakref.hxx b/include/unotools/weakref.hxx
index 0c58774bb825..9679579feb1e 100644
--- a/include/unotools/weakref.hxx
+++ b/include/unotools/weakref.hxx
@@ -115,7 +115,7 @@ public:
  @return hard reference or null, if the weakly referenced interface 
has gone
 */
 rtl::Reference SAL_CALL get() const
-#if __cplusplus >= 202002L && !(defined __clang__ && __clang_major__ == 14)
+#if __cplusplus >= 202002L && !(defined __clang__ && __clang_major__ <= 14)
 requires(!cppu::detail::isUnoInterfaceType)
 #endif
 {


[Libreoffice-commits] core.git: include/unotools

2023-08-02 Thread Stephan Bergmann (via logerrit)
 include/unotools/weakref.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5831d5f03a5ea5b89984574ffe436f38500726da
Author: Stephan Bergmann 
AuthorDate: Tue Aug 1 15:37:45 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Aug 2 15:51:38 2023 +0200

Don't enable the requires clause for some Xcode Clang

...even when building with -std=c++20 (cf.
 "Bump baseline to C++20"), 
as
that causes

> In file included from animations/source/animcore/animcore.cxx:20:
> In file included from 
workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/util/XCloneable.hpp:8:
> 
workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/uno/XInterface.hpp:32:65:
 error: invalid application of 'sizeof' to an incomplete type 
'animcore::(anonymous namespace)::AnimationNode'
> template inline constexpr auto isUnoInterfaceType = sizeof 
(T) && IsUnoInterfaceType::value;
> ^~
> include/unotools/weakref.hxx:119:33: note: in instantiation of variable 
template specialization 'cppu::detail::isUnoInterfaceType' requested here
> requires(!cppu::detail::isUnoInterfaceType)
> ^
> animations/source/animcore/animcore.cxx:310:44: note: in instantiation of 
template class 'unotools::WeakReference' requested here
> unotools::WeakReference mxParent;
>^
> animations/source/animcore/animcore.cxx:122:7: note: definition of 
'animcore::(anonymous namespace)::AnimationNode' is not complete until the 
closing '}'
> class AnimationNode final:  public AnimationNodeBase
>   ^

at least with Xcode 14.3.1.

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

diff --git a/include/unotools/weakref.hxx b/include/unotools/weakref.hxx
index 1d9b29f82e70..0c58774bb825 100644
--- a/include/unotools/weakref.hxx
+++ b/include/unotools/weakref.hxx
@@ -115,7 +115,7 @@ public:
  @return hard reference or null, if the weakly referenced interface 
has gone
 */
 rtl::Reference SAL_CALL get() const
-#if __cplusplus >= 202002L
+#if __cplusplus >= 202002L && !(defined __clang__ && __clang_major__ == 14)
 requires(!cppu::detail::isUnoInterfaceType)
 #endif
 {


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

2023-06-23 Thread Baole Fang (via logerrit)
 include/unotools/charclass.hxx |4 
 sw/source/core/edit/autofmt.cxx|2 +-
 unotools/source/i18n/charclass.cxx |   17 +
 3 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit caab94a3e0387bde05538cff91ff13446f330785
Author: Baole Fang 
AuthorDate: Fri Jun 23 11:47:54 2023 -0400
Commit: خالد حسني 
CommitDate: Fri Jun 23 22:20:58 2023 +0200

tdf#142437: Fix word boundary detection in autocorrect

Marks (combining and spacing) were incorrectly considered word separators,
because isLetterNumeric() matches only for letters and numbers.

The new isBase() matches any character with BASE_FORM character class, 
which covers letters, numbers, and marks.

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

diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index 7cb35ba2a594..bc91aca63631 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -58,6 +58,9 @@ inline constexpr sal_Int32 nCharClassNumericTypeMask =
 css::i18n::KCharacterType::PRINTABLE |
 css::i18n::KCharacterType::BASE_FORM;
 
+inline constexpr sal_Int32 nCharClassBaseType =
+css::i18n::KCharacterType::BASE_FORM;
+
 class UNOTOOLS_DLLPUBLIC CharClass
 {
 LanguageTag maLanguageTag;
@@ -167,6 +170,7 @@ public:
 bool isDigit( const OUString& rStr, sal_Int32 nPos ) const;
 bool isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const;
 bool isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const;
+bool isBase( const OUString& rStr, sal_Int32 nPos ) const;
 bool isUpper( const OUString& rStr, sal_Int32 nPos ) const;
 bool isLetter( const OUString& rStr ) const;
 bool isNumeric( const OUString& rStr ) const;
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 2c9eb69ac16a..010e0b20b80e 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -2110,7 +2110,7 @@ void SwAutoFormat::AutoCorrect(TextFrameIndex nPos)
 bFirstSent = true;
 [[fallthrough]];
 default:
-if (!(rAppCC.isLetterNumeric(*pText, sal_Int32(nPos))
+if (!(rAppCC.isBase(*pText, sal_Int32(nPos))
 || '/' == cChar )) //  '/' should not be a word 
separator (e.g. '1/2' needs to be handled as one word for replacement)
 {
 --nPos; // revert ++nPos which was decremented in for 
loop
diff --git a/unotools/source/i18n/charclass.cxx 
b/unotools/source/i18n/charclass.cxx
index be3a9f4f0ee0..423f9530f2cb 100644
--- a/unotools/source/i18n/charclass.cxx
+++ b/unotools/source/i18n/charclass.cxx
@@ -253,6 +253,23 @@ bool CharClass::isLetterNumeric( const OUString& rStr ) 
const
 return false;
 }
 
+bool CharClass::isBase( const OUString& rStr, sal_Int32 nPos ) const
+{
+sal_Unicode c = rStr[nPos];
+if ( c < 128 )
+return rtl::isAsciiAlphanumeric( c );
+
+try
+{
+return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) & 
nCharClassBaseType ) != 0;
+}
+catch ( const Exception& )
+{
+TOOLS_WARN_EXCEPTION("unotools.i18n", "" );
+}
+return false;
+}
+
 bool CharClass::isUpper( const OUString& rStr, sal_Int32 nPos ) const
 {
 sal_Unicode c = rStr[nPos];


[Libreoffice-commits] core.git: include/unotools

2023-06-06 Thread Stephan Bergmann (via logerrit)
 include/unotools/historyoptions.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 244f9cf66bc36f229ccb5712bc8d80166b92266d
Author: Stephan Bergmann 
AuthorDate: Tue Jun 6 08:15:52 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jun 6 08:31:10 2023 +0200

Remove stray defaulted argument

...that, for unclear reasons, had been added to this declaration in
436f3f8eb5b45620842351a1f29ba49571043515 "tdf#38742 - Start Center: 
introduce
push pins to favorite documents", but without also adding it to the 
definition
in unotools/source/config/historyoptions.cxx, causing

> unotools/source/config/historyoptions.cxx:307:13: error: call to 'Clear' 
is ambiguous
>   307 | Clear(eHistory);
>   | ^
> include/unotools/historyoptions.hxx:47:29: note: candidate function
>47 | UNOTOOLS_DLLPUBLIC void Clear(EHistoryType eHistory, bool 
bClearPinned = false);
>   | ^
> unotools/source/config/historyoptions.cxx:71:6: note: candidate function
>71 | void Clear( EHistoryType eHistory )
>   |  ^

Change-Id: I7ad65d72be2c59da0ad6deaadefebf9662571433
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152637
Tested-by: Stephan Bergmann 
Reviewed-by: Stephan Bergmann 

diff --git a/include/unotools/historyoptions.hxx 
b/include/unotools/historyoptions.hxx
index 8cf1aa744e31..53b9fcdfa805 100644
--- a/include/unotools/historyoptions.hxx
+++ b/include/unotools/historyoptions.hxx
@@ -44,7 +44,7 @@ namespace SvtHistoryOptions
 
 @param  eHistory select right history.
 */
-UNOTOOLS_DLLPUBLIC void Clear(EHistoryType eHistory, bool bClearPinned = 
false);
+UNOTOOLS_DLLPUBLIC void Clear(EHistoryType eHistory);
 
 /** Return the complete specified history list.
 


[Libreoffice-commits] core.git: include/unotools officecfg/registry sw/inc sw/qa sw/source sw/uiconfig unotools/source

2023-04-04 Thread Vojtěch Doležal (via logerrit)
 include/unotools/compatibility.hxx|2 
 officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs |6 
 sw/inc/IDocumentSettingAccess.hxx |4 
 sw/qa/core/text/data/tdf41652_legacy.fodt |  300 
+
 sw/qa/core/text/data/tdf41652_variableNBSPdisabled.fodt   |  301 
++
 sw/qa/core/text/data/tdf41652_variableNBSPenabled.fodt|  301 
++
 sw/qa/core/text/text.cxx  |   71 ++
 sw/source/core/doc/DocumentSettingManager.cxx |   17 
 sw/source/core/inc/DocumentSettingManager.hxx |1 
 sw/source/core/text/porexp.cxx|   54 +
 sw/source/core/text/portxt.cxx|   10 
 sw/source/filter/xml/xmlimp.cxx   |3 
 sw/source/ui/config/optcomp.cxx   |   17 
 sw/source/uibase/uno/SwXDocumentSettings.cxx  |   18 
 sw/uiconfig/swriter/ui/optcompatpage.ui   |1 
 unotools/source/config/compatibility.cxx  |5 
 16 files changed, 1096 insertions(+), 15 deletions(-)

New commits:
commit 28675af84ae8e2342bd78be3696dc09de6ce5cc5
Author: Vojtěch Doležal 
AuthorDate: Sat Mar 25 13:01:30 2023 +0100
Commit: Miklos Vajna 
CommitDate: Tue Apr 4 08:23:18 2023 +0200

tdf#41652: Variable width NBSP

Adds a flag that when enabled (opt-in for both old and new documents) 
changes behaviour of NBSP to not be strictly fixed width.

This commit also implements this behaviour such that NBSP has always the 
width of a standard space (0x20) on the given line. This change is only 
noticeable when the paragraph is justified.

Lastly a tilde or a degree character is now shown in place of NBSP when 
nonprintable characters are enabled, since the gray field alone is not visible 
in many circumstances.

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

diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index 72017812ab8b..ed7b0f9d52f3 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -60,6 +60,8 @@ class SvtCompatibilityEntry
 MsWordTrailingBlanks,
 SubtractFlysAnchoredAtFlys,
 EmptyDbFieldHidesPara,
+UseVariableWidthNBSP,
+
 /// special entry: optcomp.cxx converts the other values to
 /// integers but not this one because it doesn't have its own
 /// checkbox, so keep it at the end!
diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
index 68b369ba09fc..fc0919ae2a3a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
@@ -128,6 +128,12 @@
 
 true
   
+  
+
+  Render NBSP as having variable size, instead of having a fixed 
size
+
+false
+  
 
   
   
diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index b392b43e378d..c05e5d54df4b 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -126,7 +126,9 @@ enum class DocumentSettingId
 NO_NUMBERING_SHOW_FOLLOWBY,
 // drop cap punctuation: smaller dashes, bullet, asterisks, quotation 
marks etc.
 // by extending the rounding box of the glyph to the baseline
-DROP_CAP_PUNCTUATION
+DROP_CAP_PUNCTUATION,
+// render NBSP as standard-space-width (prettier when justified)
+USE_VARIABLE_WIDTH_NBSP,
 };
 
 /** Provides access to settings of a document
diff --git a/sw/qa/core/text/data/tdf41652_legacy.fodt 
b/sw/qa/core/text/data/tdf41652_legacy.fodt
new file mode 100644
index ..07761f24be72
--- /dev/null
+++ b/sw/qa/core/text/data/tdf41652_legacy.fodt
@@ -0,0 +1,300 @@
+
+
+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" 

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

2022-12-30 Thread Noel Grandin (via logerrit)
 include/unotools/compatibility.hxx   |   11 ---
 sw/source/ui/config/optcomp.cxx  |   10 --
 unotools/source/config/compatibility.cxx |2 --
 3 files changed, 8 insertions(+), 15 deletions(-)

New commits:
commit c6f756e968bbb72522bd01dea283288a61a286a7
Author: Noel Grandin 
AuthorDate: Sat Dec 31 08:52:53 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Dec 31 07:49:03 2022 +

tdf#152676 Writer: Compatibility options no longer saved as default

regression from
commit 78adf246d5e99d0f5d91d2e03c1379b154289d8d
Date:   Mon Jul 26 10:54:36 2021 +0200
return SvtCompatibilityEntry from SvtCompatibilityOptions::GetList

where I mistakenly assumed that the bIsDefault flag in
SvtCompatibilityEntry was being set by the SvtCompatibilityOptions
code. Rather remove this field if it is not going to be maintained
properly.

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

diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index 73e77a598ec9..72017812ab8b 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -129,19 +129,8 @@ class SvtCompatibilityEntry
 setValue(rIdx, css::uno::Any(rValue));
 }
 
-bool isDefaultEntry() const
-{
-return m_bDefaultEntry;
-}
-
-void setDefaultEntry( bool rValue )
-{
-m_bDefaultEntry = rValue;
-}
-
 private:
 std::vector m_aPropertyValue;
-bool   m_bDefaultEntry;
 };
 
 
/*-
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 0ba1b147614c..d760e885a66e 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -205,10 +205,11 @@ void SwCompatibilityOptPage::InitControls( const 
SfxItemSet& rSet )
 {
 const OUString sEntryName = rEntry.getValue( 
SvtCompatibilityEntry::Index::Name );
 const bool bIsUserEntry= ( sEntryName == 
SvtCompatibilityEntry::USER_ENTRY_NAME );
+const bool bIsDefaultEntry = ( sEntryName == 
SvtCompatibilityEntry::DEFAULT_ENTRY_NAME );
 
 m_pImpl->m_aList.push_back( rEntry );
 
-if ( rEntry.isDefaultEntry() )
+if ( bIsDefaultEntry )
 continue;
 
 OUString sNewEntry;
@@ -260,7 +261,12 @@ IMPL_LINK_NOARG(SwCompatibilityOptPage, UseAsDefaultHdl, 
weld::Button&, void)
 return;
 
 auto pItem = std::find_if(m_pImpl->m_aList.begin(), m_pImpl->m_aList.end(),
-[](const SvtCompatibilityEntry& rItem) { return 
rItem.isDefaultEntry(); });
+[](const SvtCompatibilityEntry& rItem)
+{
+const OUString sEntryName = rItem.getValue( 
SvtCompatibilityEntry::Index::Name );
+const bool bIsDefaultEntry = ( sEntryName == 
SvtCompatibilityEntry::DEFAULT_ENTRY_NAME );
+return bIsDefaultEntry;
+});
 if (pItem != m_pImpl->m_aList.end())
 {
 const sal_Int32 nCount = m_xOptionsLB->n_children();
diff --git a/unotools/source/config/compatibility.cxx 
b/unotools/source/config/compatibility.cxx
index 4f0e1d2ac20c..eed01cce1c8b 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -65,8 +65,6 @@ SvtCompatibilityEntry::SvtCompatibilityEntry()
 setValue( Index::SubtractFlysAnchoredAtFlys, false );
 setValue( Index::EmptyDbFieldHidesPara, true );
 setValue( Index::AddTableLineSpacing, false );
-
-setDefaultEntry( false );
 }
 
 OUString SvtCompatibilityEntry::getName( const Index rIdx )


[Libreoffice-commits] core.git: include/unotools package/inc package/source unotools/source

2022-10-21 Thread Noel Grandin (via logerrit)
 include/unotools/tempfile.hxx|   53 +
 package/inc/ZipOutputEntry.hxx   |3 
 package/source/xstor/owriteablestream.cxx|2 
 package/source/xstor/switchpersistencestream.cxx |3 
 package/source/xstor/xfactory.cxx|5 
 package/source/xstor/xstorage.cxx|   27 +-
 package/source/zipapi/ByteGrabber.cxx|3 
 package/source/zipapi/ZipFile.cxx|   11 -
 package/source/zipapi/ZipOutputEntry.cxx |4 
 package/source/zipapi/ZipOutputStream.cxx|1 
 package/source/zippackage/ZipPackage.cxx |7 
 package/source/zippackage/ZipPackageStream.cxx   |   24 --
 unotools/source/ucbhelper/tempfile.cxx   |  229 +++
 13 files changed, 317 insertions(+), 55 deletions(-)

New commits:
commit 848f9b2c56ce4c4620f62f1fbf9d12d84ec4da96
Author: Noel Grandin 
AuthorDate: Thu Oct 20 17:47:21 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 21 12:01:05 2022 +0200

tdf#133767 new service TempFileFastService

to use in places where we know we can use the TempFileFast mechanism.

Speeds up export to EPUB from 43s to 17s on my windows machine.

This is essentially a copy of OTempFileService, but it does not
implement XTempFile (because these temp files have no name on Windows).

Also remove a couple of calls to Flush() (which is not necessary now),
and TellEnd(), which is a little slow on Windows.

Change-Id: Iced300bf8121eae08c7a011d62ec68b93330d84c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141598
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
index 460f13b96e90..168659d26359 100644
--- a/include/unotools/tempfile.hxx
+++ b/include/unotools/tempfile.hxx
@@ -19,8 +19,16 @@
 #pragma once
 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
+#include 
+#include 
 
 namespace utl
 {
@@ -182,6 +190,51 @@ public:
 
 };
 
+
+typedef ::cppu::WeakImplHelper<
+ css::io::XStream
+, css::io::XSeekable
+, css::io::XInputStream
+, css::io::XOutputStream
+, css::io::XTruncate> TempFileFastService_Base;
+class UNOTOOLS_DLLPUBLIC TempFileFastService : public TempFileFastService_Base
+{
+std::optional mpTempFile;
+std::mutex maMutex;
+SvStream* mpStream;
+bool mbInClosed;
+bool mbOutClosed;
+
+void checkError () const;
+void checkConnected ();
+
+public:
+explicit TempFileFastService ();
+virtual ~TempFileFastService () override;
+
+// XInputStream
+virtual ::sal_Int32 SAL_CALL readBytes( css::uno::Sequence< ::sal_Int8 >& 
aData, ::sal_Int32 nBytesToRead ) override;
+virtual ::sal_Int32 SAL_CALL readSomeBytes( css::uno::Sequence< ::sal_Int8 
>& aData, ::sal_Int32 nMaxBytesToRead ) override;
+virtual void SAL_CALL skipBytes( ::sal_Int32 nBytesToSkip ) override;
+virtual ::sal_Int32 SAL_CALL available(  ) override;
+virtual void SAL_CALL closeInput(  ) override;
+// XOutputStream
+virtual void SAL_CALL writeBytes( const css::uno::Sequence< ::sal_Int8 >& 
aData ) override;
+virtual void SAL_CALL flush(  ) override;
+virtual void SAL_CALL closeOutput(  ) override;
+// XSeekable
+virtual void SAL_CALL seek( sal_Int64 location ) override;
+virtual sal_Int64 SAL_CALL getPosition(  ) override;
+virtual sal_Int64 SAL_CALL getLength(  ) override;
+// XStream
+virtual css::uno::Reference< css::io::XInputStream > SAL_CALL 
getInputStream(  ) override;
+virtual css::uno::Reference< css::io::XOutputStream > SAL_CALL 
getOutputStream(  ) override;
+// XTruncate
+virtual void SAL_CALL truncate() override;
+
+};
+
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/package/inc/ZipOutputEntry.hxx b/package/inc/ZipOutputEntry.hxx
index 678a073c6746..fcf25dcadf81 100644
--- a/package/inc/ZipOutputEntry.hxx
+++ b/package/inc/ZipOutputEntry.hxx
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 #include "CRC32.hxx"
 #include 
 
@@ -110,7 +111,7 @@ protected:
 class ZipOutputEntryInThread final : public ZipOutputEntry
 {
 class Task;
-css::uno::Reference m_xTempFile;
+rtl::Reference m_xTempFile;
 std::exception_ptr m_aParallelDeflateException;
 std::atomic   m_bFinished;
 
diff --git a/package/source/xstor/owriteablestream.cxx 
b/package/source/xstor/owriteablestream.cxx
index 3437df46f2fd..2d6bda378d34 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -1320,7 +1320,7 @@ void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( 
const uno::Reference< io:
 {
 uno::Reference < io::XStream > xTempFile;
 if ( !xTargetStream.is() )
-xTempFile = io::TempFile::create(m_xContext);
+xTempFile = new utl::TempFileFastService;
 else
 

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

2022-09-27 Thread Justin Luth (via logerrit)
 include/unotools/collatorwrapper.hxx |3 ---
 sc/source/core/data/conditio.cxx |   27 ---
 unotools/source/i18n/collatorwrapper.cxx |   17 -
 3 files changed, 12 insertions(+), 35 deletions(-)

New commits:
commit 27c22bac5439908ecdd1aa05580d75998a5eb058
Author: Justin Luth 
AuthorDate: Mon Sep 26 18:15:03 2022 -0400
Commit: Eike Rathke 
CommitDate: Tue Sep 27 21:55:02 2022 +0200

tdf#123990 sc condition: use GetTransliteration, not GetCollator

Thanks Eike

Eike said "This should not use collation (which should only be used
in sorting context) but ignore case transliteration instead."

I had just copied ancient code from
commit 952c2b02c73b30b011306faf2f0d6f2b4a935955
Author: Eike Rathke on Date:   Wed Mar 14 14:57:39 2001 +
use CollatorWrapper instead of International

Apparently that code should also be changed
in a follow-up commit.

Interestingly, a \x000 - \x008 etc must be isEqual(""),
so an attempt to ScGlobal::getCharClass().lowercase
all variables at the beginning and use regular OUString
comparisons didn't work.

Also, a "" startsWith and endsWith each string.
In Excel, a "" is also contained in every string,
but not (yet) in Calc.

Change-Id: I44a07c482d2d67a76a939ba2d593a003398d52c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140633
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 
Reviewed-by: Eike Rathke 

diff --git a/include/unotools/collatorwrapper.hxx 
b/include/unotools/collatorwrapper.hxx
index 1552a7ce9b36..595d9ccf4f41 100644
--- a/include/unotools/collatorwrapper.hxx
+++ b/include/unotools/collatorwrapper.hxx
@@ -45,9 +45,6 @@ class UNOTOOLS_DLLPUBLIC CollatorWrapper
 compareString (
 const OUString& s1, const OUString& s2) const;
 
-sal_Int32 compareSubstring (const OUString& s1, sal_Int32 off1, 
sal_Int32 len1,
-const OUString& s2, sal_Int32 off2, 
sal_Int32 len2) const;
-
 css::uno::Sequence< OUString >
 listCollatorAlgorithms (
 const css::lang::Locale& rLocale) const;
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 834c4a78f5e8..d126357dc38a 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1175,36 +1175,33 @@ bool ScConditionEntry::IsValidStr( const OUString& 
rArg, const ScAddress& rPos )
 bValid = !bValid;
 break;
 case ScConditionMode::BeginsWith:
-{
-const sal_Int32 nLen = aUpVal1.getLength();
-if (!nLen || nLen > rArg.getLength())
-bValid = false;
-else
-{
-bValid = (ScGlobal::GetCollator().compareSubstring(rArg, 0, 
nLen,
-   aUpVal1, 0, 
nLen) == 0);
-}
-}
-   break;
+bValid = ScGlobal::GetTransliteration().isMatch(aUpVal1, rArg);
+break;
 case ScConditionMode::EndsWith:
 {
 sal_Int32 nStart = rArg.getLength();
 const sal_Int32 nLen = aUpVal1.getLength();
-if (!nLen || nLen > nStart)
+if (nLen > nStart)
 bValid = false;
 else
 {
 nStart = nStart - nLen;
-bValid = (ScGlobal::GetCollator().compareSubstring(rArg, 
nStart, nLen,
-   aUpVal1, 0, 
nLen) == 0);
+sal_Int32 nMatch1(0), nMatch2(0);
+bValid = ScGlobal::GetTransliteration().equals(rArg, nStart, 
nLen, nMatch1,
+   aUpVal1, 0, 
nLen, nMatch2);
 }
 }
 break;
 case ScConditionMode::ContainsText:
 case ScConditionMode::NotContainsText:
-bValid = 
rArg.toAsciiLowerCase().indexOf(aUpVal1.toAsciiLowerCase()) != -1;
+{
+const OUString aArgStr(ScGlobal::getCharClass().lowercase(rArg));
+const OUString 
aValStr(ScGlobal::getCharClass().lowercase(aUpVal1));
+bValid = aArgStr.indexOf(aValStr) != -1;
+
 if(eOp == ScConditionMode::NotContainsText)
 bValid = !bValid;
+}
 break;
 default:
 {
diff --git a/unotools/source/i18n/collatorwrapper.cxx 
b/unotools/source/i18n/collatorwrapper.cxx
index ce85de11df7e..4da1398e0636 100644
--- a/unotools/source/i18n/collatorwrapper.cxx
+++ b/unotools/source/i18n/collatorwrapper.cxx
@@ -46,23 +46,6 @@ CollatorWrapper::compareString (const OUString& s1, const 
OUString& s2) const
 return 0;
 }
 
-sal_Int32
-CollatorWrapper::compareSubstring (const OUString& s1, sal_Int32 off1, 
sal_Int32 len1,
-   const OUString& s2, 

[Libreoffice-commits] core.git: include/unotools sc/qa sc/source unotools/source

2022-09-23 Thread Justin Luth (via logerrit)
 include/unotools/collatorwrapper.hxx |3 +++
 sc/qa/unit/ucalc_condformat.cxx  |3 ++-
 sc/source/core/data/conditio.cxx |   28 
 unotools/source/i18n/collatorwrapper.cxx |   17 +
 4 files changed, 46 insertions(+), 5 deletions(-)

New commits:
commit 3bfed17b047422a8c4e98ab80001f3158afb227e
Author: Justin Luth 
AuthorDate: Fri Sep 23 07:41:23 2022 -0400
Commit: Justin Luth 
CommitDate: Fri Sep 23 17:38:15 2022 +0200

tdf#123990 sc condformat: case insensitive begins/ends/contains

This is how Excel handles these.

At first I was afraid that this would upset LibreOffice users,
but then I realized that equals already is case insensitive,
so this change ought to be more consistent, and thus there should
be fewer outcrys.

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

diff --git a/include/unotools/collatorwrapper.hxx 
b/include/unotools/collatorwrapper.hxx
index 595d9ccf4f41..1552a7ce9b36 100644
--- a/include/unotools/collatorwrapper.hxx
+++ b/include/unotools/collatorwrapper.hxx
@@ -45,6 +45,9 @@ class UNOTOOLS_DLLPUBLIC CollatorWrapper
 compareString (
 const OUString& s1, const OUString& s2) const;
 
+sal_Int32 compareSubstring (const OUString& s1, sal_Int32 off1, 
sal_Int32 len1,
+const OUString& s2, sal_Int32 off2, 
sal_Int32 len2) const;
+
 css::uno::Sequence< OUString >
 listCollatorAlgorithms (
 const css::lang::Locale& rLocale) const;
diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx
index 652ca8b059c6..35a8a02b0802 100644
--- a/sc/qa/unit/ucalc_condformat.cxx
+++ b/sc/qa/unit/ucalc_condformat.cxx
@@ -818,7 +818,8 @@ void TestCondformat::testCondFormatEndsWithStr()
 {
 m_pDoc->InsertTab(0, "Test");
 
-ScConditionEntry aEntry(ScConditionMode::EndsWith, "\"TestString\"", "", 
*m_pDoc, ScAddress(),
+// case insnsitive matching
+ScConditionEntry aEntry(ScConditionMode::EndsWith, "\"teststring\"", "", 
*m_pDoc, ScAddress(),
 "", "", formula::FormulaGrammar::GRAM_DEFAULT, 
formula::FormulaGrammar::GRAM_DEFAULT);
 
 svl::SharedStringPool& rStringPool = m_pDoc->GetSharedStringPool();
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 46e51cf9f297..834c4a78f5e8 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1175,14 +1175,34 @@ bool ScConditionEntry::IsValidStr( const OUString& 
rArg, const ScAddress& rPos )
 bValid = !bValid;
 break;
 case ScConditionMode::BeginsWith:
-bValid = rArg.startsWith(aUpVal1);
-break;
+{
+const sal_Int32 nLen = aUpVal1.getLength();
+if (!nLen || nLen > rArg.getLength())
+bValid = false;
+else
+{
+bValid = (ScGlobal::GetCollator().compareSubstring(rArg, 0, 
nLen,
+   aUpVal1, 0, 
nLen) == 0);
+}
+}
+   break;
 case ScConditionMode::EndsWith:
-bValid = rArg.endsWith(aUpVal1);
+{
+sal_Int32 nStart = rArg.getLength();
+const sal_Int32 nLen = aUpVal1.getLength();
+if (!nLen || nLen > nStart)
+bValid = false;
+else
+{
+nStart = nStart - nLen;
+bValid = (ScGlobal::GetCollator().compareSubstring(rArg, 
nStart, nLen,
+   aUpVal1, 0, 
nLen) == 0);
+}
+}
 break;
 case ScConditionMode::ContainsText:
 case ScConditionMode::NotContainsText:
-bValid = rArg.indexOf(aUpVal1) != -1;
+bValid = 
rArg.toAsciiLowerCase().indexOf(aUpVal1.toAsciiLowerCase()) != -1;
 if(eOp == ScConditionMode::NotContainsText)
 bValid = !bValid;
 break;
diff --git a/unotools/source/i18n/collatorwrapper.cxx 
b/unotools/source/i18n/collatorwrapper.cxx
index 4da1398e0636..ce85de11df7e 100644
--- a/unotools/source/i18n/collatorwrapper.cxx
+++ b/unotools/source/i18n/collatorwrapper.cxx
@@ -46,6 +46,23 @@ CollatorWrapper::compareString (const OUString& s1, const 
OUString& s2) const
 return 0;
 }
 
+sal_Int32
+CollatorWrapper::compareSubstring (const OUString& s1, sal_Int32 off1, 
sal_Int32 len1,
+   const OUString& s2, sal_Int32 off2, 
sal_Int32 len2) const
+{
+try
+{
+if (mxInternationalCollator.is())
+return mxInternationalCollator->compareSubstring (s1, off1, len1, 
s2, off2, len2);
+}
+catch (const uno::RuntimeException&)
+{
+SAL_WARN( 

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

2022-09-13 Thread Eike Rathke (via logerrit)
 include/unotools/charclass.hxx |   25 ++-
 linguistic/source/misc.cxx |4 -
 unotools/source/i18n/charclass.cxx |   83 -
 3 files changed, 80 insertions(+), 32 deletions(-)

New commits:
commit ab0adac692b67fe7b63dee665607400c6a7e6c01
Author: Eike Rathke 
AuthorDate: Mon Sep 12 17:14:24 2022 +0200
Commit: Eike Rathke 
CommitDate: Tue Sep 13 10:25:17 2022 +0200

Fix everything using XCharacterClassification::getStringType() and don't 
use it

See note in offapi/com/sun/star/i18n/XCharacterClassification.idl

The brain dead implementation is useless but API ... its use in
isAlphaNumericType() and similar never returned what would had
been expected.

Change-Id: I278f2468182dab94c32273ef69cf9634bc002cb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139809
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index c76c7ae35f0b..7cb35ba2a594 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -31,28 +31,29 @@
 namespace com::sun::star::uno { class XComponentContext; }
 namespace com::sun::star::i18n { class XCharacterClassification; }
 
-const sal_Int32 nCharClassAlphaType =
+inline constexpr sal_Int32 nCharClassAlphaType =
 css::i18n::KCharacterType::UPPER |
 css::i18n::KCharacterType::LOWER |
 css::i18n::KCharacterType::TITLE_CASE;
 
-const sal_Int32 nCharClassAlphaTypeMask =
+inline constexpr sal_Int32 nCharClassAlphaTypeMask =
 nCharClassAlphaType |
+css::i18n::KCharacterType::LETTER | // Alpha is also always a LETTER
 css::i18n::KCharacterType::PRINTABLE |
 css::i18n::KCharacterType::BASE_FORM;
 
-const sal_Int32 nCharClassLetterType =
+inline constexpr sal_Int32 nCharClassLetterType =
 nCharClassAlphaType |
 css::i18n::KCharacterType::LETTER;
 
-const sal_Int32 nCharClassLetterTypeMask =
+inline constexpr sal_Int32 nCharClassLetterTypeMask =
 nCharClassAlphaTypeMask |
 css::i18n::KCharacterType::LETTER;
 
-const sal_Int32 nCharClassNumericType =
+inline constexpr sal_Int32 nCharClassNumericType =
 css::i18n::KCharacterType::DIGIT;
 
-const sal_Int32 nCharClassNumericTypeMask =
+inline constexpr sal_Int32 nCharClassNumericTypeMask =
 nCharClassNumericType |
 css::i18n::KCharacterType::PRINTABLE |
 css::i18n::KCharacterType::BASE_FORM;
@@ -86,14 +87,14 @@ public:
 /// isalpha() on ascii values of entire string
 static bool isAsciiAlpha( std::u16string_view rStr );
 
-/// whether type is pure numeric or not, e.g. return of getStringType
+/// whether type is pure numeric or not, e.g. return of getCharacterType()
 static bool isNumericType( sal_Int32 nType )
 {
 return ((nType & nCharClassNumericType) != 0) &&
 ((nType & ~nCharClassNumericTypeMask) == 0);
 }
 
-/// whether type is pure alphanumeric or not, e.g. return of getStringType
+/// whether type is pure alphanumeric or not, e.g. return of 
getCharacterType()
 static bool isAlphaNumericType( sal_Int32 nType )
 {
 return ((nType & (nCharClassAlphaType |
@@ -102,14 +103,14 @@ public:
 nCharClassNumericTypeMask)) == 0);
 }
 
-/// whether type is pure letter or not, e.g. return of getStringType
+/// whether type is pure letter or not, e.g. return of getCharacterType()
 static bool isLetterType( sal_Int32 nType )
 {
 return ((nType & nCharClassLetterType) != 0) &&
 ((nType & ~nCharClassLetterTypeMask) == 0);
 }
 
-/// whether type is pure letternumeric or not, e.g. return of getStringType
+/// whether type is pure letternumeric or not, e.g. return of 
getCharacterType()
 static bool isLetterNumericType( sal_Int32 nType )
 {
 return ((nType & (nCharClassLetterType |
@@ -141,7 +142,6 @@ public:
 css::i18n::DirectionProperty getCharacterDirection( const OUString& rStr, 
sal_Int32 nPos ) const;
 css::i18n::UnicodeScript getScript( const OUString& rStr, sal_Int32 nPos ) 
const;
 sal_Int32 getCharacterType( const OUString& rStr, sal_Int32 nPos ) const;
-sal_Int32 getStringType( const OUString& rStr, sal_Int32 nPos, sal_Int32 
nCount ) const;
 
 css::i18n::ParseResult parseAnyToken(
 const OUString& rStr,
@@ -167,10 +167,13 @@ public:
 bool isDigit( const OUString& rStr, sal_Int32 nPos ) const;
 bool isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const;
 bool isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const;
+bool isUpper( const OUString& rStr, sal_Int32 nPos ) const;
 bool isLetter( const OUString& rStr ) const;
 bool isNumeric( const OUString& rStr ) const;
 bool isLetterNumeric( const OUString& rStr ) const;
 
+bool isUpper( const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) 
const;
+
 private:
 
 const 

[Libreoffice-commits] core.git: include/unotools oox/source package/Library_xstor.mk package/source unotools/source

2022-06-28 Thread Noel Grandin (via logerrit)
 include/unotools/streamwrap.hxx  |1 
 oox/source/ole/vbaproject.cxx|7 
 package/Library_xstor.mk |1 
 package/source/xstor/owriteablestream.cxx|  216 +--
 package/source/xstor/owriteablestream.hxx|9 
 package/source/xstor/selfterminatefilestream.cxx |   36 +--
 package/source/xstor/selfterminatefilestream.hxx |   14 -
 unotools/source/streaming/streamwrap.cxx |   16 +
 8 files changed, 132 insertions(+), 168 deletions(-)

New commits:
commit 9ba8b37db55d210b915170528fd87df196ab29e7
Author: Noel Grandin 
AuthorDate: Mon Jun 27 13:24:23 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Jun 28 14:56:46 2022 +0200

use utl::TempFile directly in package

so we can
(a) control the lifetime of the temp file properly
and
(b) we don't need to use file URLs which means we stay on the
efficient path on Windows

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

diff --git a/include/unotools/streamwrap.hxx b/include/unotools/streamwrap.hxx
index dc4c51807189..429bbe91c36c 100644
--- a/include/unotools/streamwrap.hxx
+++ b/include/unotools/streamwrap.hxx
@@ -164,6 +164,7 @@ class UNOTOOLS_DLLPUBLIC OStreamWrapper final
 public:
 OStreamWrapper(SvStream& _rStream);
 OStreamWrapper(std::unique_ptr _rStream);
+OStreamWrapper(SvStream* _pStream, bool _bOwner = false);
 
 // css::io::XStream
 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL 
getInputStream(  ) override;
diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx
index c868d83b6f72..001d97bc7513 100644
--- a/oox/source/ole/vbaproject.cxx
+++ b/oox/source/ole/vbaproject.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -90,6 +91,7 @@ VbaFilterConfig::VbaFilterConfig( const Reference< 
XComponentContext >& rxContex
 }
 catch(const Exception& )
 {
+TOOLS_WARN_EXCEPTION("oox", "");
 }
 OSL_ENSURE( mxConfigAccess.is(), "VbaFilterConfig::VbaFilterConfig - 
cannot open configuration" );
 }
@@ -131,6 +133,7 @@ void VbaMacroAttacherBase::resolveAndAttachMacro( const 
Reference< XVBAMacroReso
 }
 catch(const Exception& )
 {
+TOOLS_WARN_EXCEPTION("oox", "");
 }
 }
 
@@ -233,6 +236,7 @@ Reference< XNameContainer > VbaProject::openLibrary( 
sal_Int32 nPropId )
 }
 catch(const Exception& )
 {
+TOOLS_WARN_EXCEPTION("oox", "");
 }
 OSL_ENSURE( xLibrary.is(), "VbaProject::openLibrary - cannot create 
library" );
 return xLibrary;
@@ -421,6 +425,7 @@ void VbaProject::readVbaModules( StorageBase& rVbaPrjStrg )
 }
 catch(const Exception& )
 {
+TOOLS_WARN_EXCEPTION("oox", "");
 }
 }
 
@@ -510,6 +515,7 @@ void VbaProject::importModulesAndForms( StorageBase& 
rVbaPrjStrg, const GraphicH
 }
 catch(const Exception& )
 {
+TOOLS_WARN_EXCEPTION("oox", "");
 }
 }
 }
@@ -533,6 +539,7 @@ void VbaProject::attachMacros()
 }
 catch(const Exception& )
 {
+TOOLS_WARN_EXCEPTION("oox", "");
 }
 }
 
diff --git a/package/Library_xstor.mk b/package/Library_xstor.mk
index fecf9c8da4eb..ea6b503e1380 100644
--- a/package/Library_xstor.mk
+++ b/package/Library_xstor.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_Library_use_libraries,xstor,\
sal \
salhelper \
tl \
+   utl \
 ))
 
 $(eval $(call gb_Library_add_exception_objects,xstor,\
diff --git a/package/source/xstor/owriteablestream.cxx 
b/package/source/xstor/owriteablestream.cxx
index 001daa439c96..6ecdb35b848f 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -82,6 +82,42 @@ struct WSInternalData_Impl
 namespace package
 {
 
+static void CopyInputToOutput(
+const css::uno::Reference< css::io::XInputStream >& xInput,
+SvStream& rOutput )
+{
+static const sal_Int32 nConstBufferSize = 32000;
+
+uno::Reference< css::lang::XUnoTunnel > xInputTunnel( xInput, 
uno::UNO_QUERY );
+comphelper::ByteReader* pByteReader = nullptr;
+if (xInputTunnel)
+pByteReader = reinterpret_cast< comphelper::ByteReader* >( 
xInputTunnel->getSomething( comphelper::ByteReader::getUnoTunnelId() ) );
+
+if (pByteReader)
+{
+sal_Int32 nRead;
+sal_Int8 aTempBuf[ nConstBufferSize ];
+do
+{
+nRead = pByteReader->readSomeBytes ( aTempBuf, nConstBufferSize );
+rOutput.WriteBytes ( aTempBuf, nRead );
+}
+while ( nRead == nConstBufferSize );
+}
+else
+{
+sal_Int32 nRead;
+uno::Sequence < sal_Int8 > aSequence ( nConstBufferSize );
+
+do
+{
+nRead = xInput->readBytes ( 

[Libreoffice-commits] core.git: include/unotools lingucomponent/config lingucomponent/source postprocess/CustomTarget_registry.mk unotools/source

2022-06-14 Thread Mert Tumer (via logerrit)
 include/unotools/lingucfg.hxx  |2 
 lingucomponent/config/Linguistic-lingucomponent-grammarchecker.xcu |   30 
++
 lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx  |   45 
+++---
 postprocess/CustomTarget_registry.mk   |1 
 unotools/source/config/lingucfg.cxx|   21 
 5 files changed, 70 insertions(+), 29 deletions(-)

New commits:
commit c3ed41752237a7a70c856dfb0d618f1c2eacea5a
Author: Mert Tumer 
AuthorDate: Tue May 10 13:06:06 2022 +0300
Commit: Mert Tumer 
CommitDate: Tue Jun 14 10:04:28 2022 +0200

Load the locales from config file for languagetool

Locales needs to be read again
in the Preferences/Writing Aids section and since
this is a network operation it can cause a problem.
Better to list all the supported locales in the xcu
and load it right away.

Signed-off-by: Mert Tumer 
Change-Id: Ifff624334627f7be259b677f9b416d6ddedfb2c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135598
Tested-by: Jenkins

diff --git a/include/unotools/lingucfg.hxx b/include/unotools/lingucfg.hxx
index b4a0b824e127..9117799c2f3a 100644
--- a/include/unotools/lingucfg.hxx
+++ b/include/unotools/lingucfg.hxx
@@ -192,6 +192,8 @@ public:
 
 bool GetDictionaryEntry( const OUString , 
SvtLinguConfigDictionaryEntry  ) const;
 
+bool GetLocaleListFor( const OUString , const OUString 
, css::uno::Sequence< OUString >  ) const;
+
 css::uno::Sequence< OUString > GetDisabledDictionaries() const;
 
 std::vector< SvtLinguConfigDictionaryEntry > 
GetActiveDictionariesByFormat( std::u16string_view rFormatName ) const;
diff --git a/lingucomponent/config/Linguistic-lingucomponent-grammarchecker.xcu 
b/lingucomponent/config/Linguistic-lingucomponent-grammarchecker.xcu
new file mode 100644
index ..ce3d6033d0c2
--- /dev/null
+++ b/lingucomponent/config/Linguistic-lingucomponent-grammarchecker.xcu
@@ -0,0 +1,30 @@
+
+
+http://openoffice.org/2004/installation; 
xmlns:oor="http://openoffice.org/2001/registry; 
xmlns:xs="http://www.w3.org/2001/XMLSchema; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>
+
+
+
+
+ar ast-ES be-BY br-FR ca-ES ca-ES-valencia zh-CN 
da-DK nl nl-BE en en-AU en-CA en-CA en-GB en-NZ en-ZA en-US fr gl-ES de de-AT 
de-DE de-DE de-CH el-GR ga-IE it ja-JP km-KH nb no fa pl-PL pt pt-AO pt-BR 
pt-MZ pt-PT ro-RO ru-RU de-DE-x-simple-language sk-SK sl-SI es es-AR sv tl-PH 
ta-IN uk-UA
+
+
+
+
+
+
diff --git a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx 
b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx
index 06b4fcb64175..d7d53c015860 100644
--- a/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx
+++ b/lingucomponent/source/spellcheck/languagetool/languagetoolimp.cxx
@@ -35,11 +35,12 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 
 using namespace osl;
 using namespace com::sun::star;
@@ -108,40 +109,26 @@ sal_Bool SAL_CALL 
LanguageToolGrammarChecker::hasLocale(const Locale& rLocale)
 
 Sequence SAL_CALL LanguageToolGrammarChecker::getLocales()
 {
+MutexGuard aGuard(GetLinguMutex());
+
 if (m_aSuppLocales.hasElements())
 return m_aSuppLocales;
-SvxLanguageToolOptions& rLanguageOpts = SvxLanguageToolOptions::Get();
-OString localeUrl = OUStringToOString(rLanguageOpts.getLocaleListURL(), 
RTL_TEXTENCODING_UTF8);
-if (localeUrl.isEmpty())
-{
-return m_aSuppLocales;
-}
-tools::Long statusCode = 0;
-std::string response = makeHttpRequest(localeUrl, HTTP_METHOD::HTTP_GET, 
OString(), statusCode);
-if (statusCode != 200)
-{
-return m_aSuppLocales;
-}
-if (response.empty())
-{
-return m_aSuppLocales;
-}
-boost::property_tree::ptree root;
-std::stringstream aStream(response);
-boost::property_tree::read_json(aStream, root);
 
-size_t length = root.size();
-m_aSuppLocales.realloc(length);
+SvtLinguConfig aLinguCfg;
+uno::Sequence aLocaleList;
+aLinguCfg.GetLocaleListFor("GrammarCheckers", 
"org.openoffice.lingu.LanguageToolGrammarChecker",
+   aLocaleList);
+
+auto nLength = aLocaleList.getLength();
+m_aSuppLocales.realloc(nLength);
 auto pArray = m_aSuppLocales.getArray();
-int i = 0;
-for (auto it = root.begin(); it != root.end(); it++, i++)
+auto pLocaleList = aLocaleList.getArray();
+
+for (auto i = 0; i < nLength; i++)
 {
-boost::property_tree::ptree& localeItem = it->second;
-const std::string longCode = localeItem.get("longCode");
-Locale aLocale = LanguageTag::convertToLocale(
-OUString(longCode.c_str(), longCode.length(), 
RTL_TEXTENCODING_UTF8));
-

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

2022-05-30 Thread Noel Grandin (via logerrit)
 include/unotools/charclass.hxx|4 ++--
 include/unotools/configitem.hxx   |2 +-
 include/unotools/intlwrapper.hxx  |2 +-
 include/unotools/localedatawrapper.hxx|4 ++--
 include/unotools/progresshandlerwrap.hxx  |2 +-
 include/unotools/streamhelper.hxx |5 +++--
 include/unotools/viewoptions.hxx  |3 +--
 unotools/source/config/configitem.cxx |5 +++--
 unotools/source/config/configvaluecontainer.cxx   |7 ---
 unotools/source/config/viewoptions.cxx|5 +++--
 unotools/source/i18n/charclass.cxx|9 +
 unotools/source/i18n/intlwrapper.cxx  |6 +++---
 unotools/source/i18n/localedatawrapper.cxx|9 +
 unotools/source/misc/ServiceDocumenter.hxx|5 +++--
 unotools/source/ucbhelper/progresshandlerwrap.cxx |5 +++--
 unotools/source/ucbhelper/ucblockbytes.cxx|   11 ++-
 16 files changed, 46 insertions(+), 38 deletions(-)

New commits:
commit 7b87afa899be289306c709d35eb1d32c0b73b1ed
Author: Noel Grandin 
AuthorDate: Mon May 30 14:59:16 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 30 19:16:45 2022 +0200

clang-tidy modernize-pass-by-value in unotools

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

diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index ab695beb52cb..c76c7ae35f0b 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -69,11 +69,11 @@ public:
 /// Preferred ctor with service manager specified
 CharClass(
 const css::uno::Reference< css::uno::XComponentContext > & rxContext,
-const LanguageTag& rLanguageTag );
+LanguageTag aLanguageTag );
 
 /// Deprecated ctor, tries to get a process service manager or to load the
 /// library directly.
-CharClass( const LanguageTag& rLanguageTag );
+CharClass( LanguageTag aLanguageTag );
 
 ~CharClass();
 
diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx
index 63bd38dce6b4..7692bd3d6c9e 100644
--- a/include/unotools/configitem.hxx
+++ b/include/unotools/configitem.hxx
@@ -109,7 +109,7 @@ namespace utl
 virtual voidImplCommit() = 0;
 
 protected:
-explicit ConfigItem(const OUString ,
+explicit ConfigItem(OUString aSubTree,
 ConfigItemMode nMode = ConfigItemMode::NONE);
 
 voidSetModified  (); // mark item as modified
diff --git a/include/unotools/intlwrapper.hxx b/include/unotools/intlwrapper.hxx
index 49d1f8bf5438..e86346a9552e 100644
--- a/include/unotools/intlwrapper.hxx
+++ b/include/unotools/intlwrapper.hxx
@@ -61,7 +61,7 @@ private:
 voidImplNewCollator( bool bCaseSensitive ) const;
 
 public:
-IntlWrapper(const LanguageTag& rLanguageTag);
+IntlWrapper(LanguageTag aLanguageTag);
 ~IntlWrapper();
 
 const LocaleDataWrapper*getLocaleData() const
diff --git a/include/unotools/localedatawrapper.hxx 
b/include/unotools/localedatawrapper.hxx
index 2c408b4a0cf9..5fbdcd0782b7 100644
--- a/include/unotools/localedatawrapper.hxx
+++ b/include/unotools/localedatawrapper.hxx
@@ -118,14 +118,14 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
 public:
 LocaleDataWrapper(
 const css::uno::Reference< css::uno::XComponentContext > & rxContext,
-const LanguageTag& rLanguageTag
+LanguageTag aLanguageTag
 );
 /**
 @param rOverrideDateAcceptancePatterns Override locale's date 
acceptance patterns.
 An empty sequence resets the patterns to the locale's pattern 
sequence.
  */
 LocaleDataWrapper(
-const LanguageTag& rLanguageTag,
+LanguageTag aLanguageTag,
 const std::vector & rOverrideDateAcceptancePatterns = {}
 );
 ~LocaleDataWrapper();
diff --git a/include/unotools/progresshandlerwrap.hxx 
b/include/unotools/progresshandlerwrap.hxx
index 207ba2af8c1b..4fcfd36da044 100644
--- a/include/unotools/progresshandlerwrap.hxx
+++ b/include/unotools/progresshandlerwrap.hxx
@@ -38,7 +38,7 @@ class UNLESS_MERGELIBS(UNOTOOLS_DLLPUBLIC) 
ProgressHandlerWrap final
 css::uno::Reference m_xStatusIndicator;
 
 public:
-ProgressHandlerWrap(css::uno::Reference 
const& xSI);
+ProgressHandlerWrap(css::uno::Reference xSI);
 
 // XProgressHandler
 virtual void SAL_CALL push(const css::uno::Any& Status) override;
diff --git a/include/unotools/streamhelper.hxx 
b/include/unotools/streamhelper.hxx
index 5d0a3792855b..a727869bfea6 100644
--- a/include/unotools/streamhelper.hxx
+++ b/include/unotools/streamhelper.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace utl
 {
@@ 

[Libreoffice-commits] core.git: include/unotools starmath/inc starmath/source

2022-05-19 Thread Mike Kaganski (via logerrit)
 include/unotools/resmgr.hxx   |4 
 starmath/inc/ElementsDockingWindow.hxx|   25 -
 starmath/source/ElementsDockingWindow.cxx |  739 --
 starmath/source/SmElementsPanel.cxx   |7 
 4 files changed, 411 insertions(+), 364 deletions(-)

New commits:
commit 8231d7957ae04599d7c87bba117f9a53452fcf0f
Author: Mike Kaganski 
AuthorDate: Thu May 19 16:38:56 2022 +0300
Commit: Mike Kaganski 
CommitDate: Thu May 19 22:31:20 2022 +0200

Simplify SmElementsControl

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

diff --git a/include/unotools/resmgr.hxx b/include/unotools/resmgr.hxx
index 80e3a23eb57d..142ec2de5b1f 100644
--- a/include/unotools/resmgr.hxx
+++ b/include/unotools/resmgr.hxx
@@ -33,9 +33,9 @@ struct UNOTOOLS_DLLPUBLIC TranslateId
 const char* mpContext;
 const char* mpId;
 
-inline TranslateId()
+inline constexpr TranslateId()
 : mpContext(nullptr), mpId(nullptr) {}
-inline TranslateId(const char* pContext, const char* pId)
+inline constexpr TranslateId(const char* pContext, const char* pId)
 : mpContext(pContext), mpId(pId) {}
 
 inline operator bool() const { return mpId != nullptr; }
diff --git a/starmath/inc/ElementsDockingWindow.hxx 
b/starmath/inc/ElementsDockingWindow.hxx
index 3b8e9fa9788d..28a564f7a1e7 100644
--- a/starmath/inc/ElementsDockingWindow.hxx
+++ b/starmath/inc/ElementsDockingWindow.hxx
@@ -58,32 +58,11 @@ public:
 bool isSeparator() const override { return true; }
 };
 
-typedef std::pair SmElementDescr;
-
 class SmElementsControl : public weld::CustomWidgetController
 {
 friend class ElementSelectorUIObject;
 friend class ElementUIObject;
 
-// SmParser 5 elements
-static const SmElementDescr m_a5UnaryBinaryOperatorsList[];
-static const SmElementDescr m_a5RelationsList[];
-static const SmElementDescr m_a5SetOperationsList[];
-static const SmElementDescr m_a5FunctionsList[];
-static const SmElementDescr m_a5OperatorsList[];
-static const SmElementDescr m_a5AttributesList[];
-static const SmElementDescr m_a5BracketsList[];
-static const SmElementDescr m_a5FormatsList[];
-static const SmElementDescr m_a5OthersList[];
-static const SmElementDescr m_a5ExamplesList[];
-static const std::tuple 
m_a5Categories[];
-static const size_t m_a5CategoriesSize;
-
-// SmParser 6 elements
-static const std::tuple 
m_a6Categories[0];
-static const size_t m_a6CategoriesSize = 0;
-
-// Parser for them
 std::unique_ptr maParser;
 
 virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&) override;
@@ -113,7 +92,6 @@ class SmElementsControl : public weld::CustomWidgetController
 rtl::Reference m_xAccessible;
 
 void addElement(const OUString& aElementVisual, const OUString& 
aElementSource, const OUString& aHelpText);
-void addElements(const SmElementDescr aElementsArray[], sal_uInt16 size);
 SmElement* current() const;
 void setCurrentElement(sal_uInt16);
 bool hasRollover() const { return m_nCurrentRolloverElement != 
SAL_MAX_UINT16; }
@@ -133,8 +111,7 @@ public:
 explicit SmElementsControl(std::unique_ptr 
xScrolledWindow);
 virtual ~SmElementsControl() override;
 
-static const auto& categories() { return m_a5Categories; }
-static size_t categoriesSize() { return m_a5CategoriesSize; }
+static const std::vector& categories();
 const TranslateId& elementSetId() const { return msCurrentSetId; }
 void setElementSetId(TranslateId pSetId);
 
diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 8256dfe19c55..f534a5345b8e 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -38,6 +38,8 @@
 #include 
 #include 
 
+#include 
+
 SmElement::SmElement(std::unique_ptr&& pNode, const OUString& aText, 
const OUString& aHelpText) :
 mpNode(std::move(pNode)),
 maText(aText),
@@ -53,234 +55,416 @@ SmElementSeparator::SmElementSeparator() :
 SmElement(std::unique_ptr(), OUString(), OUString())
 {}
 
-const SmElementDescr SmElementsControl::m_a5UnaryBinaryOperatorsList[] =
+namespace
 {
-{RID_PLUSX, RID_PLUSX_HELP}, {RID_MINUSX, RID_MINUSX_HELP},
-{RID_PLUSMINUSX, RID_PLUSMINUSX_HELP}, {RID_MINUSPLUSX, 
RID_MINUSPLUSX_HELP},
-{nullptr, {}},
-{RID_XPLUSY, RID_XPLUSY_HELP}, {RID_XMINUSY, RID_XMINUSY_HELP},
-{RID_XCDOTY, RID_XCDOTY_HELP}, {RID_XTIMESY, RID_XTIMESY_HELP},
-{RID_XSYMTIMESY, RID_XSYMTIMESY_HELP}, {RID_XOVERY, RID_XOVERY_HELP},
-{RID_FRACXY, RID_FRACXY_HELP},
-{RID_XDIVY, RID_XDIVY_HELP}, {RID_XSYMDIVIDEY, RID_XSYMDIVIDEY_HELP},
-{RID_XOPLUSY, RID_XOPLUSY_HELP}, {RID_XOMINUSY, RID_XOMINUSY_HELP},
-{RID_XODOTY, RID_XODOTY_HELP}, {RID_XOTIMESY, 

[Libreoffice-commits] core.git: include/unotools ucb/Library_ucpfile1.mk ucb/source unotools/source

2022-05-19 Thread Noel Grandin (via logerrit)
 include/unotools/bytereader.hxx|   31 +
 include/unotools/streamwrap.hxx|   12 +--
 ucb/Library_ucpfile1.mk|1 
 ucb/source/ucp/file/filstr.cxx |   23 +
 ucb/source/ucp/file/filstr.hxx |   15 +-
 unotools/source/streaming/streamhelper.cxx |   10 +
 unotools/source/streaming/streamwrap.cxx   |   23 +
 unotools/source/ucbhelper/ucblockbytes.cxx |   20 +++---
 8 files changed, 129 insertions(+), 6 deletions(-)

New commits:
commit d1dc27fef899ff6cd70873cd945d5312a53e1b3a
Author: Noel Grandin 
AuthorDate: Sun May 15 13:03:18 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu May 19 09:29:14 2022 +0200

add utl::ByteReader pure class

which lets us skip the inefficiency of needing an extra buffer when
reading via XInputStream

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

diff --git a/include/unotools/bytereader.hxx b/include/unotools/bytereader.hxx
new file mode 100644
index ..8edf19929eea
--- /dev/null
+++ b/include/unotools/bytereader.hxx
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+#pragma once
+
+#include 
+#include 
+
+namespace utl
+{
+/**
+ * Interface that we can cast to, to bypass the inefficiency of using 
Sequence
+ * when reading via XInputStream.
+ */
+class UNOTOOLS_DLLPUBLIC ByteReader
+{
+public:
+virtual ~ByteReader();
+virtual sal_Int32 readSomeBytes(sal_Int8* aData, sal_Int32 nBytesToRead) = 
0;
+
+static const css::uno::Sequence& getUnoTunnelId();
+};
+
+} // namespace utl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/unotools/streamwrap.hxx b/include/unotools/streamwrap.hxx
index 4993ffd92f7c..15e729f156f3 100644
--- a/include/unotools/streamwrap.hxx
+++ b/include/unotools/streamwrap.hxx
@@ -26,8 +26,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -37,10 +39,10 @@ namespace utl
 {
 
 // workaround for incremental linking bugs in MSVC2015
-class SAL_DLLPUBLIC_TEMPLATE OInputStreamWrapper_Base : public 
cppu::WeakImplHelper< css::io::XInputStream > {};
+class SAL_DLLPUBLIC_TEMPLATE OInputStreamWrapper_Base : public 
cppu::WeakImplHelper< css::io::XInputStream, css::lang::XUnoTunnel > {};
 
 /// helper class for wrapping an SvStream into a com.sun.star.io::XInputStream
-class UNOTOOLS_DLLPUBLIC OInputStreamWrapper : public OInputStreamWrapper_Base
+class UNOTOOLS_DLLPUBLIC OInputStreamWrapper : public 
OInputStreamWrapper_Base, public ByteReader
 {
 protected:
 std::mutex  m_aMutex;
@@ -64,6 +66,12 @@ public:
 virtual sal_Int32   SAL_CALLavailable() override;
 virtual voidSAL_CALLcloseInput() override;
 
+// css::lang::XUnoTunnel
+virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& _rIdentifier ) override;
+
+// utl::ByteReader
+virtual sal_Int32 readSomeBytes( sal_Int8* aData, sal_Int32 
nMaxBytesToRead ) final override;
+
 protected:
 /// throws a NotConnectedException if the object is not connected anymore
 void checkConnected() const;
diff --git a/ucb/Library_ucpfile1.mk b/ucb/Library_ucpfile1.mk
index 2f9684955ec5..f67c69b78b28 100644
--- a/ucb/Library_ucpfile1.mk
+++ b/ucb/Library_ucpfile1.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_Library_use_libraries,ucpfile1,\
sal \
tl \
ucbhelper \
+   utl \
 ))
 
 $(eval $(call gb_Library_add_exception_objects,ucpfile1,\
diff --git a/ucb/source/ucp/file/filstr.cxx b/ucb/source/ucp/file/filstr.cxx
index 8b4274cb60e0..8e605f7f1cc6 100644
--- a/ucb/source/ucp/file/filstr.cxx
+++ b/ucb/source/ucp/file/filstr.cxx
@@ -148,6 +148,29 @@ XStream_impl::readBytes(
 return static_cast(nrc);
 }
 
+sal_Int32
+XStream_impl::readSomeBytes(
+sal_Int8* pData,
+sal_Int32 nBytesToRead )
+{
+if( ! m_nIsOpen )
+throw io::IOException( THROW_WHERE );
+
+sal_uInt64 nrc(0);
+if(m_aFile.read( pData, sal_uInt64(nBytesToRead), nrc )
+   != osl::FileBase::E_None)
+{
+throw io::IOException( THROW_WHERE );
+}
+return static_cast(nrc);
+}
+
+sal_Int64 SAL_CALL XStream_impl::getSomething( const css::uno::Sequence< 
sal_Int8 >& rIdentifier )
+{
+if (rIdentifier == utl::ByteReader::getUnoTunnelId())
+return 
reinterpret_cast(static_cast(this));
+return 0;
+}
 
 sal_Int32 SAL_CALL
 

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

2022-05-14 Thread Noel Grandin (via logerrit)
 include/unotools/eventcfg.hxx|3 +++
 sfx2/source/inc/eventsupplier.hxx|4 ++--
 sfx2/source/notify/eventsupplier.cxx |   14 +-
 sfx2/source/notify/globalevents.cxx  |   12 +++-
 unotools/source/config/eventcfg.cxx  |   12 +++-
 5 files changed, 24 insertions(+), 21 deletions(-)

New commits:
commit ce214d56727ecf8fb212910a711b4e3ef38e4b63
Author: Noel Grandin 
AuthorDate: Fri May 13 15:30:37 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat May 14 17:30:08 2022 +0200

bypass some unnecessary wrapping in Any in SfxEvents_Impl

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

diff --git a/include/unotools/eventcfg.hxx b/include/unotools/eventcfg.hxx
index 5999d0bc1ea3..7ddca4a96be0 100644
--- a/include/unotools/eventcfg.hxx
+++ b/include/unotools/eventcfg.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_UNOTOOLS_EVENTCFG_HXX
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -75,6 +76,8 @@ class UNOTOOLS_DLLPUBLIC GlobalEventConfig final :
 sal_Bool SAL_CALL hasElements(  ) override;
 static OUString GetEventName( GlobalEventId nID );
 
+css::uno::Sequence < css::beans::PropertyValue > getByName2( const 
OUString& aName );
+
 private:
 static GlobalEventConfig_Impl* m_pImpl;
 static sal_Int32 m_nRefCount;
diff --git a/sfx2/source/inc/eventsupplier.hxx 
b/sfx2/source/inc/eventsupplier.hxx
index 0a6c1a971daf..56aa8f95e75f 100644
--- a/sfx2/source/inc/eventsupplier.hxx
+++ b/sfx2/source/inc/eventsupplier.hxx
@@ -44,7 +44,7 @@ class SvxMacro;
 class SfxEvents_Impl final : public ::cppu::WeakImplHelper< 
css::container::XNameReplace, css::document::XDocumentEventListener >
 {
 css::uno::Sequence< OUString > maEventNames;
-std::vector< css::uno::Any >   maEventData;
+std::vector< css::uno::Sequence < css::beans::PropertyValue > >  
maEventData;
 css::uno::Reference< css::document::XDocumentEventBroadcaster >  
mxBroadcaster;
 std::mutex maMutex;
 SfxObjectShell *mpObjShell;
@@ -79,7 +79,7 @@ public:
 const ::comphelper::NamedValueCollection& 
i_eventDescriptor,
 ::comphelper::NamedValueCollection& 
o_normalizedDescriptor,
 SfxObjectShell* i_document );
-static void Execute( css::uno::Any const & aEventData, const 
css::document::DocumentEvent& aTrigger, SfxObjectShell* pDoc );
+static void Execute( css::uno::Sequence < css::beans::PropertyValue > 
const & aEventData, const css::document::DocumentEvent& aTrigger, 
SfxObjectShell* pDoc );
 
 private:
 /// Check if script URL whitelist exists, and if so, if current script url 
is part of it
diff --git a/sfx2/source/notify/eventsupplier.cxx 
b/sfx2/source/notify/eventsupplier.cxx
index 7ac2fd7d830d..d6bff98de8f0 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -98,11 +98,11 @@ void SAL_CALL SfxEvents_Impl::replaceByName( const OUString 
& aName, const uno::
 
 if ( !aNormalizedDescriptor.empty() )
 {
-maEventData[nIndex] <<= aNormalizedDescriptor.getPropertyValues();
+maEventData[nIndex] = aNormalizedDescriptor.getPropertyValues();
 }
 else
 {
-maEventData[nIndex].clear();
+maEventData[nIndex] = {};
 }
 }
 
@@ -117,7 +117,7 @@ uno::Any SAL_CALL SfxEvents_Impl::getByName( const 
OUString& aName )
 
 auto nIndex = comphelper::findValue(maEventNames, aName);
 if (nIndex != -1)
-return maEventData[nIndex];
+return uno::Any(maEventData[nIndex]);
 
 throw container::NoSuchElementException();
 }
@@ -180,12 +180,8 @@ bool SfxEvents_Impl::isScriptURLAllowed(const OUString& 
aScriptURL)
 return false;
 }
 
-void SfxEvents_Impl::Execute( uno::Any const & aEventData, const 
document::DocumentEvent& aTrigger, SfxObjectShell* pDoc )
+void SfxEvents_Impl::Execute( css::uno::Sequence < css::beans::PropertyValue > 
const & aProperties, const document::DocumentEvent& aTrigger, SfxObjectShell* 
pDoc )
 {
-uno::Sequence < beans::PropertyValue > aProperties;
-if ( !(aEventData >>= aProperties) )
-return;
-
 OUString aType;
 OUString aScript;
 OUString aLibrary;
@@ -292,7 +288,7 @@ void SAL_CALL SfxEvents_Impl::documentEventOccured( const 
document::DocumentEven
 if ( nIndex == -1 )
 return;
 
-uno::Any aEventData = maEventData[ nIndex ];
+css::uno::Sequence < css::beans::PropertyValue > aEventData = maEventData[ 
nIndex ];
 aGuard.unlock();
 Execute( aEventData, aEvent, mpObjShell );
 }
diff --git a/sfx2/source/notify/globalevents.cxx 
b/sfx2/source/notify/globalevents.cxx
index 87564e74ed65..cd6b08007115 100644
--- a/sfx2/source/notify/globalevents.cxx
+++ 

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

2022-05-11 Thread Noel Grandin (via logerrit)
 include/unotools/syslocale.hxx |4 
 unotools/source/misc/syslocale.cxx |   30 --
 2 files changed, 16 insertions(+), 18 deletions(-)

New commits:
commit c8e144638c10f81a25478dd8d8061d7d870b383c
Author: Noel Grandin 
AuthorDate: Wed May 11 13:04:14 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed May 11 21:13:48 2022 +0200

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

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

diff --git a/include/unotools/syslocale.hxx b/include/unotools/syslocale.hxx
index ae3153b7976a..e5bc9dd85224 100644
--- a/include/unotools/syslocale.hxx
+++ b/include/unotools/syslocale.hxx
@@ -31,8 +31,6 @@ class LocaleDataWrapper;
 class SvtSysLocale_Impl;
 class SvtSysLocaleOptions;
 
-namespace osl { class Mutex; }
-
 /**
 SvtSysLocale provides a refcounted single instance of an application wide
 LocaleDataWrapper and CharClass which always
@@ -48,8 +46,6 @@ class UNOTOOLS_DLLPUBLIC SvtSysLocale
 
 std::shared_ptr  pImpl;
 
-UNOTOOLS_DLLPRIVATE static  ::osl::Mutex&   GetMutex();
-
 public:
 SvtSysLocale();
 ~SvtSysLocale();
diff --git a/unotools/source/misc/syslocale.cxx 
b/unotools/source/misc/syslocale.cxx
index 889d9b34688f..954e7e94caf8 100644
--- a/unotools/source/misc/syslocale.cxx
+++ b/unotools/source/misc/syslocale.cxx
@@ -31,6 +31,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -41,6 +42,18 @@ namespace {
 
 std::weak_ptr g_pSysLocale;
 
+// static
+std::mutex& GetMutex()
+{
+// #i77768# Due to a static reference in the toolkit lib
+// we need a mutex that lives longer than the svl library.
+// Otherwise the dtor would use a destructed mutex!!
+static std::mutex* persistentMutex(new std::mutex);
+
+return *persistentMutex;
+}
+
+
 }
 
 class SvtSysLocale_Impl : public utl::ConfigurationListener
@@ -88,7 +101,7 @@ void SvtSysLocale_Impl::ConfigurationChanged( 
utl::ConfigurationBroadcaster*, Co
  !(nHint & ConfigurationHints::DatePatterns) )
 return;
 
-MutexGuard aGuard( SvtSysLocale::GetMutex() );
+std::unique_lock aGuard( GetMutex() );
 
 const LanguageTag& rLanguageTag = aSysLocaleOptions.GetRealLanguageTag();
 if ( nHint & ConfigurationHints::Locale )
@@ -115,7 +128,7 @@ std::vector 
SvtSysLocale_Impl::getDateAcceptancePatternsConfig() const
 
 SvtSysLocale::SvtSysLocale()
 {
-MutexGuard aGuard( GetMutex() );
+std::unique_lock aGuard( GetMutex() );
 pImpl = g_pSysLocale.lock();
 if ( !pImpl )
 {
@@ -126,21 +139,10 @@ SvtSysLocale::SvtSysLocale()
 
 SvtSysLocale::~SvtSysLocale()
 {
-MutexGuard aGuard( GetMutex() );
+std::unique_lock aGuard( GetMutex() );
 pImpl.reset();
 }
 
-// static
-Mutex& SvtSysLocale::GetMutex()
-{
-// #i77768# Due to a static reference in the toolkit lib
-// we need a mutex that lives longer than the svl library.
-// Otherwise the dtor would use a destructed mutex!!
-static Mutex* persistentMutex(new Mutex);
-
-return *persistentMutex;
-}
-
 const LocaleDataWrapper& SvtSysLocale::GetLocaleData() const
 {
 return *(pImpl->pLocaleData);


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

2022-05-10 Thread Noel Grandin (via logerrit)
 include/unotools/eventcfg.hxx   |1 
 unotools/source/config/eventcfg.cxx |   37 
 2 files changed, 17 insertions(+), 21 deletions(-)

New commits:
commit f75b742997c119ccb081faa7e63ce04b8e88912c
Author: Noel Grandin 
AuthorDate: Mon May 9 18:06:54 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue May 10 19:26:20 2022 +0200

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

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

diff --git a/include/unotools/eventcfg.hxx b/include/unotools/eventcfg.hxx
index 660ec91b02f0..5999d0bc1ea3 100644
--- a/include/unotools/eventcfg.hxx
+++ b/include/unotools/eventcfg.hxx
@@ -65,7 +65,6 @@ class UNOTOOLS_DLLPUBLIC GlobalEventConfig final :
 public:
 GlobalEventConfig( );
 virtual ~GlobalEventConfig( ) override;
-static ::osl::Mutex& GetOwnStaticMutex();
 
 css::uno::Reference< css::container::XNameReplace > SAL_CALL 
getEvents(  ) override;
 void SAL_CALL replaceByName( const OUString& aName, const 
css::uno::Any& aElement ) override;
diff --git a/unotools/source/config/eventcfg.cxx 
b/unotools/source/config/eventcfg.cxx
index 197546f5502b..0c0f87ed4624 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -81,6 +81,12 @@ static o3tl::enumarray 
pEventAsciiNames =
 typedef std::unordered_map< OUString, OUString > EventBindingHash;
 typedef o3tl::enumarray< GlobalEventId, OUString > SupportedEventsVector;
 
+static std::mutex& GetOwnStaticMutex()
+{
+static std::mutex INSTANCE;
+return INSTANCE;
+}
+
 class GlobalEventConfig_Impl : public utl::ConfigItem
 {
 private:
@@ -150,7 +156,7 @@ OUString const & GlobalEventConfig_Impl::GetEventName( 
GlobalEventId nIndex ) co
 
 void GlobalEventConfig_Impl::Notify( const Sequence< OUString >& )
 {
-MutexGuard aGuard( GlobalEventConfig::GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 
 initBindingInfo();
 }
@@ -295,13 +301,14 @@ sal_Int32   
GlobalEventConfig::m_nRefCount  = 0;
 GlobalEventConfig::GlobalEventConfig()
 {
 // Global access, must be guarded (multithreading!).
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 // Increase our refcount ...
 ++m_nRefCount;
 // ... and initialize our data container only if it not already exist!
 if( m_pImpl == nullptr )
 {
 m_pImpl = new GlobalEventConfig_Impl;
+aGuard.unlock();
 ItemHolder1::holdConfigItem(EItem::EventConfig);
 }
 }
@@ -309,7 +316,7 @@ GlobalEventConfig::GlobalEventConfig()
 GlobalEventConfig::~GlobalEventConfig()
 {
 // Global access, must be guarded (multithreading!)
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 // Decrease our refcount.
 --m_nRefCount;
 // If last instance was deleted ...
@@ -323,52 +330,42 @@ GlobalEventConfig::~GlobalEventConfig()
 
 Reference< container::XNameReplace > SAL_CALL GlobalEventConfig::getEvents()
 {
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 Reference< container::XNameReplace > ret(this);
 return ret;
 }
 
 void SAL_CALL GlobalEventConfig::replaceByName( const OUString& aName, const 
Any& aElement )
 {
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 m_pImpl->replaceByName( aName, aElement );
 }
 Any SAL_CALL GlobalEventConfig::getByName( const OUString& aName )
 {
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 return m_pImpl->getByName( aName );
 }
 Sequence< OUString > SAL_CALL GlobalEventConfig::getElementNames(  )
 {
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 return m_pImpl->getElementNames( );
 }
 sal_Bool SAL_CALL GlobalEventConfig::hasByName( const OUString& aName )
 {
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 return m_pImpl->hasByName( aName );
 }
 Type SAL_CALL GlobalEventConfig::getElementType(  )
 {
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 return GlobalEventConfig_Impl::getElementType( );
 }
 sal_Bool SAL_CALL GlobalEventConfig::hasElements(  )
 {
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 return m_pImpl->hasElements( );
 }
 
-namespace
-{
-class theGlobalEventConfigMutex : public rtl::Static{};
-}
-
-Mutex& GlobalEventConfig::GetOwnStaticMutex()
-{
-return theGlobalEventConfigMutex::get();
-}
-
 OUString GlobalEventConfig::GetEventName( GlobalEventId nIndex )
 {
 if 

[Libreoffice-commits] core.git: include/unotools sc/inc sc/source svtools/source sw/source unotools/source vcl/inc vcl/qa vcl/source

2022-05-04 Thread Noel Grandin (via logerrit)
 include/unotools/charclass.hxx |4 ++--
 include/unotools/configpaths.hxx   |4 ++--
 include/unotools/fontdefs.hxx  |6 +++---
 include/unotools/localedatawrapper.hxx |2 +-
 sc/inc/global.hxx  |2 +-
 sc/source/core/data/global.cxx |   27 ++-
 sc/source/core/data/table4.cxx |6 +++---
 sc/source/ui/dbgui/asciiopt.cxx|2 +-
 svtools/source/config/colorcfg.cxx |2 +-
 sw/source/filter/inc/msfilter.hxx  |2 +-
 sw/source/filter/ww8/writerwordglue.cxx|4 ++--
 sw/source/filter/ww8/wrtw8sty.cxx  |8 
 sw/source/filter/ww8/wrtww8.hxx|2 +-
 unotools/source/config/configpaths.cxx |   12 ++--
 unotools/source/config/fontcfg.cxx |8 
 unotools/source/i18n/charclass.cxx |   16 
 unotools/source/i18n/localedatawrapper.cxx |8 
 unotools/source/misc/fontdefs.cxx  |   21 +++--
 vcl/inc/font/PhysicalFontCollection.hxx|2 +-
 vcl/qa/cppunit/physicalfontcollection.cxx  |2 +-
 vcl/source/font/PhysicalFontCollection.cxx |2 +-
 21 files changed, 72 insertions(+), 70 deletions(-)

New commits:
commit bf6b64d5963002d52c3ed2093b064896a4316d0e
Author: Noel Grandin 
AuthorDate: Tue May 3 11:51:18 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed May 4 10:01:33 2022 +0200

use more string_view in unotools

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

diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index 4405d810875b..ab695beb52cb 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -81,10 +81,10 @@ public:
 const LanguageTag& getLanguageTag() const;
 
 /// isdigit() on ascii values of entire string
-static bool isAsciiNumeric( const OUString& rStr );
+static bool isAsciiNumeric( std::u16string_view rStr );
 
 /// isalpha() on ascii values of entire string
-static bool isAsciiAlpha( const OUString& rStr );
+static bool isAsciiAlpha( std::u16string_view rStr );
 
 /// whether type is pure numeric or not, e.g. return of getStringType
 static bool isNumericType( sal_Int32 nType )
diff --git a/include/unotools/configpaths.hxx b/include/unotools/configpaths.hxx
index 15bc7118efa4..119733a477dc 100644
--- a/include/unotools/configpaths.hxx
+++ b/include/unotools/configpaths.hxx
@@ -134,7 +134,7 @@ namespace utl
 "*['']", where  is properly escaped.
 
 */
-UNOTOOLS_DLLPUBLIC OUString wrapConfigurationElementName(OUString const& 
_sElementName);
+UNOTOOLS_DLLPUBLIC OUString 
wrapConfigurationElementName(std::u16string_view _sElementName);
 
 /** Create a one-level relative configuration path from a set element name
 and a known set element type.
@@ -152,7 +152,7 @@ namespace utl
 "['']", where  is properly escaped.
 
 */
-OUString wrapConfigurationElementName(OUString const& _sElementName,
+OUString wrapConfigurationElementName(std::u16string_view _sElementName,
  OUString const& _sTypeName);
 
 }   // namespace utl
diff --git a/include/unotools/fontdefs.hxx b/include/unotools/fontdefs.hxx
index 7f145eba309e..aff10c860122 100644
--- a/include/unotools/fontdefs.hxx
+++ b/include/unotools/fontdefs.hxx
@@ -40,7 +40,7 @@ namespace o3tl
 template<> struct typed_flags : 
is_typed_flags {};
 }
 
-UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, 
SubsFontFlags nFlags );
+UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( std::u16string_view rName, 
SubsFontFlags nFlags );
 
 UNLESS_MERGELIBS(UNOTOOLS_DLLPUBLIC) void AddTokenFontName( OUString& rName, 
std::u16string_view rNewToken );
 
@@ -84,7 +84,7 @@ enum class DefaultFontType
 CTL_DISPLAY = 4004,
 };
 
-UNOTOOLS_DLLPUBLIC std::u16string_view GetNextFontToken( const OUString& 
rTokenStr, sal_Int32& rIndex );
+UNOTOOLS_DLLPUBLIC std::u16string_view GetNextFontToken( std::u16string_view 
rTokenStr, sal_Int32& rIndex );
 UNOTOOLS_DLLPUBLIC OUString GetEnglishSearchFontName( std::u16string_view 
rName );
 
 /** Strip any "script font suffix" from the font name
@@ -104,7 +104,7 @@ UNOTOOLS_DLLPUBLIC OUString StripScriptFromName(const 
OUString& rName);
 @return true if this is Star|Open Symbol
 */
 // FIXME It's quite possible that code using this should instead check for 
RTL_TEXTENCODING_SYMBOL.
-UNOTOOLS_DLLPUBLIC bool IsStarSymbol(const OUString );
+UNOTOOLS_DLLPUBLIC bool IsStarSymbol(std::u16string_view rFontName);
 
 #endif // INCLUDED_UNOTOOLS_FONTDEFS_HXX
 
diff --git a/include/unotools/localedatawrapper.hxx 
b/include/unotools/localedatawrapper.hxx
index 6c2502c2a786..2c408b4a0cf9 100644
--- 

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

2022-05-03 Thread Stephan Bergmann (via logerrit)
 include/unotools/sharedunocomponent.hxx   |2 -
 unotools/source/config/configmgr.cxx  |6 ++---
 unotools/source/config/confignode.cxx |2 -
 unotools/source/config/historyoptions.cxx |   28 +-
 unotools/source/config/useroptions.cxx|2 -
 unotools/source/config/viewoptions.cxx|6 ++---
 unotools/source/misc/ZipPackageHelper.cxx |2 -
 unotools/source/misc/mediadescriptor.cxx  |2 -
 unotools/source/ucbhelper/ucbhelper.cxx   |2 -
 unotools/source/ucbhelper/ucbstreamhelper.cxx |2 -
 10 files changed, 27 insertions(+), 27 deletions(-)

New commits:
commit 54d6e9f7dcea00761a47121994dd9121f54e1798
Author: Stephan Bergmann 
AuthorDate: Tue May 3 11:20:57 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 3 16:00:02 2022 +0200

Just use Any ctor instead of makeAny in unotools

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

diff --git a/include/unotools/sharedunocomponent.hxx 
b/include/unotools/sharedunocomponent.hxx
index 169e899ca75b..8acc64b1f905 100644
--- a/include/unotools/sharedunocomponent.hxx
+++ b/include/unotools/sharedunocomponent.hxx
@@ -232,7 +232,7 @@ namespace utl
 template < class INTERFACE, class COMPONENT >
 inline css::uno::Any SAL_CALL makeAny( const SharedUNOComponent< 
INTERFACE, COMPONENT >& value )
 {
-return makeAny( value.getTyped() );
+return css::uno::Any( value.getTyped() );
 }
 
 template < class INTERFACE, class COMPONENT >
diff --git a/unotools/source/config/configmgr.cxx 
b/unotools/source/config/configmgr.cxx
index 5b109788d2cd..f3aef792e856 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -117,10 +117,10 @@ css::uno::Reference< 
css::container::XHierarchicalNameAccess >
 utl::ConfigManager::acquireTree(utl::ConfigItem const & item) {
 css::uno::Sequence< css::uno::Any > args{ 
css::uno::Any(css::beans::NamedValue(
 "nodepath",
-css::uno::makeAny("/org.openoffice." + item.GetSubTreeName( };
+css::uno::Any("/org.openoffice." + item.GetSubTreeName( };
 if (item.GetMode() & ConfigItemMode::AllLocales) {
 args.realloc(2);
-args.getArray()[1] <<= css::beans::NamedValue("locale", 
css::uno::makeAny(OUString("*")));
+args.getArray()[1] <<= css::beans::NamedValue("locale", 
css::uno::Any(OUString("*")));
 }
 return css::uno::Reference< css::container::XHierarchicalNameAccess >(
 getConfigurationProvider()->createInstanceWithArguments(
@@ -133,7 +133,7 @@ css::uno::Reference< 
css::container::XHierarchicalNameAccess >
 utl::ConfigManager::acquireTree(std::u16string_view rSubTreeName) {
 css::uno::Sequence< css::uno::Any > args{ 
css::uno::Any(css::beans::NamedValue(
 "nodepath",
-css::uno::makeAny(OUString::Concat(u"/org.openoffice.") + 
rSubTreeName))) };
+css::uno::Any(OUString::Concat(u"/org.openoffice.") + rSubTreeName))) 
};
 return css::uno::Reference< css::container::XHierarchicalNameAccess >(
 getConfigurationProvider()->createInstanceWithArguments(
 "com.sun.star.configuration.ConfigurationUpdateAccess",
diff --git a/unotools/source/config/confignode.cxx 
b/unotools/source/config/confignode.cxx
index b5669c7b485b..85aa6c3bada5 100644
--- a/unotools/source/config/confignode.cxx
+++ b/unotools/source/config/confignode.cxx
@@ -234,7 +234,7 @@ namespace utl
 try
 {
 OUString sName = normalizeName(_rName, NO_CALLER);
-m_xContainerAccess->insertByName(sName, makeAny(_xNode));
+m_xContainerAccess->insertByName(sName, Any(_xNode));
 // if we're here, all was ok ...
 return OConfigurationNode( _xNode );
 }
diff --git a/unotools/source/config/historyoptions.cxx 
b/unotools/source/config/historyoptions.cxx
index edbf5f5d6b7b..db5ef4087481 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -178,11 +178,11 @@ void AppendItem(EHistoryType eHistory,
 if (sThumbnail)
 {
 // update the thumbnail
-xSet->setPropertyValue(s_sThumbnail, 
uno::makeAny(*sThumbnail));
+xSet->setPropertyValue(s_sThumbnail, uno::Any(*sThumbnail));
 }
 if (oIsReadOnly)
 {
-xSet->setPropertyValue(s_sReadOnly, 
uno::makeAny(*oIsReadOnly));
+xSet->setPropertyValue(s_sReadOnly, uno::Any(*oIsReadOnly));
 }
 
 for (sal_Int32 i=0; igetPropertyValue(s_sHistoryItemRef) >>= 
sTemp;
-xPrevSet->setPropertyValue(s_sHistoryItemRef, 
uno::makeAny(sTemp));
+

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

2022-04-22 Thread Noel Grandin (via logerrit)
 include/unotools/datetime.hxx  |2 +-
 include/unotools/fontdefs.hxx  |2 +-
 unotools/source/misc/datetime.cxx  |   14 +++---
 unotools/source/misc/fontdefs.cxx  |6 +++---
 vcl/source/font/PhysicalFontCollection.cxx |4 ++--
 vcl/source/font/fontmetric.cxx |2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit ca1027e7d3a47402a016dba26d12db93b097a856
Author: Noel Grandin 
AuthorDate: Thu Apr 21 16:08:20 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 22 13:29:40 2022 +0200

use more string_view in unotools

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

diff --git a/include/unotools/datetime.hxx b/include/unotools/datetime.hxx
index afb06bc652a1..368ffcb393f9 100644
--- a/include/unotools/datetime.hxx
+++ b/include/unotools/datetime.hxx
@@ -48,7 +48,7 @@ namespace utl
 UNOTOOLS_DLLPUBLIC void typeConvert(const css::util::DateTime& _rDateTime, 
DateTime& _rOut);
 
 UNOTOOLS_DLLPUBLIC OUString toISO8601(const css::util::DateTime& 
_rDateTime);
-UNOTOOLS_DLLPUBLIC boolISO8601parseDateTime(const OUString 
_rIn, css::util::DateTime& o_rDateTime);
+UNOTOOLS_DLLPUBLIC bool
ISO8601parseDateTime(std::u16string_view i_rIn, css::util::DateTime& 
o_rDateTime);
 UNOTOOLS_DLLPUBLIC boolISO8601parseDate(std::u16string_view 
i_rIn, css::util::Date& o_rDate);
 UNOTOOLS_DLLPUBLIC boolISO8601parseTime(std::u16string_view 
i_rIn, css::util::Time& o_Time);
 
diff --git a/include/unotools/fontdefs.hxx b/include/unotools/fontdefs.hxx
index f5ff03efc837..7f145eba309e 100644
--- a/include/unotools/fontdefs.hxx
+++ b/include/unotools/fontdefs.hxx
@@ -84,7 +84,7 @@ enum class DefaultFontType
 CTL_DISPLAY = 4004,
 };
 
-UNOTOOLS_DLLPUBLIC OUString GetNextFontToken( const OUString& rTokenStr, 
sal_Int32& rIndex );
+UNOTOOLS_DLLPUBLIC std::u16string_view GetNextFontToken( const OUString& 
rTokenStr, sal_Int32& rIndex );
 UNOTOOLS_DLLPUBLIC OUString GetEnglishSearchFontName( std::u16string_view 
rName );
 
 /** Strip any "script font suffix" from the font name
diff --git a/unotools/source/misc/datetime.cxx 
b/unotools/source/misc/datetime.cxx
index f1b1d6a8a33e..db7216ffa268 100644
--- a/unotools/source/misc/datetime.cxx
+++ b/unotools/source/misc/datetime.cxx
@@ -303,25 +303,25 @@ OUString toISO8601(const css::util::DateTime& rDateTime)
 }
 
 /** convert ISO8601 DateTime String to util::DateTime */
-bool ISO8601parseDateTime(const OUString , css::util::DateTime& 
rDateTime)
+bool ISO8601parseDateTime(std::u16string_view rString, css::util::DateTime& 
rDateTime)
 {
 bool bSuccess = true;
 
-OUString aDateStr, aTimeStr;
+std::u16string_view aDateStr, aTimeStr;
 css::util::Date aDate;
 css::util::Time aTime;
-sal_Int32 nPos = rString.indexOf( 'T' );
-if ( nPos >= 0 )
+size_t nPos = rString.find( 'T' );
+if ( nPos != std::u16string_view::npos )
 {
-aDateStr = rString.copy( 0, nPos );
-aTimeStr = rString.copy( nPos + 1 );
+aDateStr = rString.substr( 0, nPos );
+aTimeStr = rString.substr( nPos + 1 );
 }
 else
 aDateStr = rString; // no separator: only date part
 
 bSuccess = ISO8601parseDate(aDateStr, aDate);
 
-if ( bSuccess && !aTimeStr.isEmpty() )   // time is optional
+if ( bSuccess && !aTimeStr.empty() )   // time is optional
 {
 bSuccess = ISO8601parseTime(aTimeStr, aTime);
 }
diff --git a/unotools/source/misc/fontdefs.cxx 
b/unotools/source/misc/fontdefs.cxx
index 9015f93e9de6..4a07087fd71f 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -457,14 +457,14 @@ OUString GetEnglishSearchFontName(std::u16string_view 
rInName)
 return rNameStr;
 }
 
-OUString GetNextFontToken( const OUString& rTokenStr, sal_Int32& rIndex )
+std::u16string_view GetNextFontToken( const OUString& rTokenStr, sal_Int32& 
rIndex )
 {
 // check for valid start index
 sal_Int32 nStringLen = rTokenStr.getLength();
 if( rIndex >= nStringLen )
 {
 rIndex = -1;
-return OUString();
+return {};
 }
 
 // find the next token delimiter and return the token substring
@@ -498,7 +498,7 @@ OUString GetNextFontToken( const OUString& rTokenStr, 
sal_Int32& rIndex )
 }
 }
 
-return rTokenStr.copy( nTokenStart, nTokenLen );
+return rTokenStr.subView( nTokenStart, nTokenLen );
 }
 
 static bool ImplIsFontToken( const OUString& rName, std::u16string_view rToken 
)
diff --git a/vcl/source/font/PhysicalFontCollection.cxx 
b/vcl/source/font/PhysicalFontCollection.cxx
index 139e4f133e88..6a1b35372952 100644
--- a/vcl/source/font/PhysicalFontCollection.cxx
+++ b/vcl/source/font/PhysicalFontCollection.cxx
@@ 

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

2022-03-18 Thread Noel Grandin (via logerrit)
 include/unotools/fontcfg.hxx   |4 ++--
 unotools/source/config/fontcfg.cxx |   15 +++
 unotools/source/misc/fontdefs.cxx  |   19 ++-
 3 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 7cb91a40e20b0ea405042429a1b497bf3c983e01
Author: Noel Grandin 
AuthorDate: Thu Mar 17 15:24:27 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 18 09:59:04 2022 +0100

tdf#133603 cache languagetag in FontSubstConfiguration

speeds up saving XLSX by 10%

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

diff --git a/include/unotools/fontcfg.hxx b/include/unotools/fontcfg.hxx
index 99520e39528b..1f77d484531a 100644
--- a/include/unotools/fontcfg.hxx
+++ b/include/unotools/fontcfg.hxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -32,8 +33,6 @@
 namespace com::sun::star::container { class XNameAccess; }
 namespace com::sun::star::lang { class XMultiServiceFactory; }
 
-class LanguageTag;
-
 enum class DefaultFontType;
 
 // If you think the below concept of classifying a font (typeface) as possibly 
being one or several
@@ -156,6 +155,7 @@ private:
 std::unordered_map< OUString, LocaleSubst > m_aSubst;
 typedef std::unordered_set< OUString > UniqueSubstHash;
 mutable UniqueSubstHash maSubstHash;
+LanguageTag maLanguageTag;
 
 void fillSubstVector( const css::uno::Reference< 
css::container::XNameAccess >& rFont,
   const OUString& rType,
diff --git a/unotools/source/config/fontcfg.cxx 
b/unotools/source/config/fontcfg.cxx
index ef94981d7746..371084708084 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -299,7 +299,8 @@ FontSubstConfiguration& FontSubstConfiguration::get()
  */
 
 FontSubstConfiguration::FontSubstConfiguration() :
-maSubstHash( 300 )
+maSubstHash( 300 ),
+maLanguageTag("en")
 {
 if (utl::ConfigManager::IsFuzzing())
 return;
@@ -339,6 +340,9 @@ FontSubstConfiguration::FontSubstConfiguration() :
 }
 SAL_INFO("unotools.config", "config provider: " << m_xConfigProvider.is()
 << ", config access: " << m_xConfigAccess.is());
+
+if( maLanguageTag.isSystemLocale() )
+maLanguageTag = SvtSysLocale().GetUILanguageTag();
 }
 
 /*
@@ -1042,13 +1046,8 @@ const FontNameAttr* 
FontSubstConfiguration::getSubstInfo( const OUString& rFontN
 FontNameAttr aSearchAttr;
 aSearchAttr.Name = aSearchFont;
 
-LanguageTag aLanguageTag("en");
-
-if( aLanguageTag.isSystemLocale() )
-aLanguageTag = SvtSysLocale().GetUILanguageTag();
-
-::std::vector< OUString > aFallbacks( aLanguageTag.getFallbackStrings( 
true));
-if (aLanguageTag.getLanguage() != "en")
+::std::vector< OUString > aFallbacks( maLanguageTag.getFallbackStrings( 
true));
+if (maLanguageTag.getLanguage() != "en")
 aFallbacks.emplace_back("en");
 
 for (const auto& rFallback : aFallbacks)
diff --git a/unotools/source/misc/fontdefs.cxx 
b/unotools/source/misc/fontdefs.cxx
index 66bd91363be7..9015f93e9de6 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -545,18 +545,19 @@ OUString GetSubsFontName( const OUString& rName, 
SubsFontFlags nFlags )
   ||  aOrgName == "opensymbol" ) )
 return aName;
 
-const utl::FontNameAttr* pAttr = 
utl::FontSubstConfiguration::get().getSubstInfo( aOrgName );
-if ( pAttr && (nFlags & SubsFontFlags::MS) )
+if (nFlags & SubsFontFlags::MS)
 {
-for( const auto& rSubstitution : pAttr->MSSubstitutions )
-if( ! ImplIsFontToken( rName, rSubstitution ) )
-{
-ImplAppendFontToken( aName, rSubstitution );
-if( nFlags & SubsFontFlags::ONLYONE )
+const utl::FontNameAttr* pAttr = 
utl::FontSubstConfiguration::get().getSubstInfo( aOrgName );
+if (pAttr)
+for( const auto& rSubstitution : pAttr->MSSubstitutions )
+if( ! ImplIsFontToken( rName, rSubstitution ) )
 {
-break;
+ImplAppendFontToken( aName, rSubstitution );
+if( nFlags & SubsFontFlags::ONLYONE )
+{
+break;
+}
 }
-}
 }
 
 return aName;


[Libreoffice-commits] core.git: include/unotools

2022-03-01 Thread Tor Lillqvist (via logerrit)
 include/unotools/VersionConfig.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 6c17a51c0f6f2bf9e8c1132a2d1c96edb404e522
Author: Tor Lillqvist 
AuthorDate: Tue Mar 1 15:09:15 2022 +0200
Commit: Mike Kaganski 
CommitDate: Tue Mar 1 16:34:52 2022 +0100

Quick build fix: Add missing #include

Change-Id: Ib36aa807c3fbe0678adaaea0d202163d2ac70022
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130791
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/include/unotools/VersionConfig.hxx 
b/include/unotools/VersionConfig.hxx
index a16e9f0e0b29..f3ed8315640f 100644
--- a/include/unotools/VersionConfig.hxx
+++ b/include/unotools/VersionConfig.hxx
@@ -12,6 +12,8 @@
 #include 
 #include 
 
+#include 
+
 namespace utl
 {
 /** This method is called when there's a need to determine if the


[Libreoffice-commits] core.git: include/unotools

2022-03-01 Thread homeboy445 (via logerrit)
 include/unotools/VersionConfig.hxx |   19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 1c2dc4bc28a594c15464fdb0f5adaa30baf47af2
Author: homeboy445 
AuthorDate: Tue Nov 2 14:39:26 2021 +0530
Commit: Samuel Mehrbrodt 
CommitDate: Tue Mar 1 13:20:41 2022 +0100

tdf#145486: Catch the error instead of re-checking readOnly state

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

diff --git a/include/unotools/VersionConfig.hxx 
b/include/unotools/VersionConfig.hxx
index f94dfe564b3d..a16e9f0e0b29 100644
--- a/include/unotools/VersionConfig.hxx
+++ b/include/unotools/VersionConfig.hxx
@@ -30,12 +30,21 @@ static bool isProductVersionUpgraded(bool aUpdateVersion)
 = sLastVersion.getToken(0, '.').toInt32() * 10 + 
sLastVersion.getToken(1, '.').toInt32();
 if (iCurrent > iLast)
 {
-if (aUpdateVersion && 
!officecfg::Setup::Product::ooSetupLastVersion::isReadOnly())
+if (aUpdateVersion)
 { //update lastversion
-std::shared_ptr batch(
-comphelper::ConfigurationChanges::create());
-officecfg::Setup::Product::ooSetupLastVersion::set(sSetupVersion, 
batch);
-batch->commit();
+try
+{
+std::shared_ptr batch(
+comphelper::ConfigurationChanges::create());
+
officecfg::Setup::Product::ooSetupLastVersion::set(sSetupVersion, batch);
+batch->commit();
+}
+catch (css::lang::IllegalArgumentException&)
+{ //If the value was readOnly.
+SAL_WARN("desktop.updater", "Updating property 
ooSetupLastVersion to version "
+<< sSetupVersion
+<< " failed (read-only 
property?)");
+}
 }
 return true;
 }


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

2021-12-24 Thread Noel Grandin (via logerrit)
 include/unotools/cmdoptions.hxx   |   11 ---
 unotools/source/config/cmdoptions.cxx |   27 +--
 2 files changed, 13 insertions(+), 25 deletions(-)

New commits:
commit 1576ef8532cf2cea2da361db9c5707f1994e65e2
Author: Noel Grandin 
AuthorDate: Thu Dec 23 18:40:44 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 24 19:50:02 2021 +0100

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

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

diff --git a/include/unotools/cmdoptions.hxx b/include/unotools/cmdoptions.hxx
index d0e6792ba8b9..bb3414f8ff41 100644
--- a/include/unotools/cmdoptions.hxx
+++ b/include/unotools/cmdoptions.hxx
@@ -109,17 +109,6 @@ public:
 
 void EstablishFrameCallback(const css::uno::Reference& 
xFrame);
 
-private:
-
/*-
-@short  return a reference to a static mutex
-@descr  These class is partially threadsafe (for 
de-/initialization only).
-All access methods aren't safe!
-We create a static mutex only for one ime and use at 
different times.
-@return A reference to a static mutex member.
-
**-***/
-
-UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
-
 private:
 std::shared_ptr m_pImpl;
 
diff --git a/unotools/source/config/cmdoptions.cxx 
b/unotools/source/config/cmdoptions.cxx
index d9e061224a4a..1408f22c2480 100644
--- a/unotools/source/config/cmdoptions.cxx
+++ b/unotools/source/config/cmdoptions.cxx
@@ -84,6 +84,12 @@ class SvtCmdOptions
 CommandHashMap m_aCommandHashMap;
 };
 
+std::mutex& GetOwnStaticMutex()
+{
+static std::mutex theCommandOptionsMutex;
+return theCommandOptionsMutex;
+}
+
 }
 
 typedef ::std::vector< css::uno::WeakReference< css::frame::XFrame > > 
SvtFrameVector;
@@ -185,7 +191,7 @@ SvtCommandOptions_Impl::~SvtCommandOptions_Impl()
 
 void SvtCommandOptions_Impl::Notify( const Sequence< OUString >& )
 {
-MutexGuard aGuard( SvtCommandOptions::GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 
 Sequence< OUString >lNames   = impl_GetPropertyNames ();
 Sequence< Any > lValues  = GetProperties ( lNames 
);
@@ -296,13 +302,14 @@ std::weak_ptr g_pCommandOptions;
 SvtCommandOptions::SvtCommandOptions()
 {
 // Global access, must be guarded (multithreading!).
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 
 m_pImpl = g_pCommandOptions.lock();
 if( !m_pImpl )
 {
 m_pImpl = std::make_shared();
 g_pCommandOptions = m_pImpl;
+aGuard.unlock(); // because holdConfigItem will call this constructor
 ItemHolder1::holdConfigItem(EItem::CmdOptions);
 }
 }
@@ -310,7 +317,7 @@ SvtCommandOptions::SvtCommandOptions()
 SvtCommandOptions::~SvtCommandOptions()
 {
 // Global access, must be guarded (multithreading!)
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 
 m_pImpl.reset();
 }
@@ -319,7 +326,7 @@ SvtCommandOptions::~SvtCommandOptions()
 
 bool SvtCommandOptions::HasEntries( CmdOption eOption ) const
 {
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 return m_pImpl->HasEntries( eOption );
 }
 
@@ -327,7 +334,7 @@ bool SvtCommandOptions::HasEntries( CmdOption eOption ) 
const
 
 bool SvtCommandOptions::Lookup( CmdOption eCmdOption, const OUString& 
aCommandURL ) const
 {
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 return m_pImpl->Lookup( eCmdOption, aCommandURL );
 }
 
@@ -335,16 +342,8 @@ bool SvtCommandOptions::Lookup( CmdOption eCmdOption, 
const OUString& aCommandUR
 
 void SvtCommandOptions::EstablishFrameCallback(const css::uno::Reference< 
css::frame::XFrame >& xFrame)
 {
-MutexGuard aGuard( GetOwnStaticMutex() );
+std::unique_lock aGuard( GetOwnStaticMutex() );
 m_pImpl->EstablishFrameCallback(xFrame);
 }
 
-//  private method
-
-Mutex& SvtCommandOptions::GetOwnStaticMutex()
-{
-static osl::Mutex theCommandOptionsMutex;
-return theCommandOptionsMutex;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-12-24 Thread Noel Grandin (via logerrit)
 include/unotools/useroptions.hxx   |2 -
 unotools/source/config/useroptions.cxx |   34 +
 2 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit ac511d90cdf9d28eb8809c30be9fa08b42ea0bd3
Author: Noel Grandin 
AuthorDate: Thu Dec 23 19:42:19 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 24 19:10:25 2021 +0100

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

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

diff --git a/include/unotools/useroptions.hxx b/include/unotools/useroptions.hxx
index adc5f5055d5b..d21482dcca2d 100644
--- a/include/unotools/useroptions.hxx
+++ b/include/unotools/useroptions.hxx
@@ -60,8 +60,6 @@ public:
 SvtUserOptions ();
 virtual ~SvtUserOptions () override;
 
-static osl::Mutex& GetInitMutex ();
-
 // get the address token
 OUString GetCompany() const;
 OUString GetFirstName  () const;
diff --git a/unotools/source/config/useroptions.cxx 
b/unotools/source/config/useroptions.cxx
index ffe01cca497c..448850fb84fc 100644
--- a/unotools/source/config/useroptions.cxx
+++ b/unotools/source/config/useroptions.cxx
@@ -259,34 +259,36 @@ bool SvtUserOptions::Impl::IsTokenReadonly (UserOptToken 
nToken) const
 beans::PropertyAttribute::READONLY);
 }
 
+static std::mutex& GetInitMutex()
+{
+static std::mutex gMutex;
+return gMutex;
+}
+
+
 SvtUserOptions::SvtUserOptions ()
 {
 // Global access, must be guarded (multithreading)
-osl::MutexGuard aGuard(GetInitMutex());
+std::unique_lock aGuard(GetInitMutex());
 
-if (xSharedImpl.expired())
+xImpl = xSharedImpl.lock();
+if (!xImpl)
 {
 xImpl = std::make_shared();
 xSharedImpl = xImpl;
+aGuard.unlock(); // because holdConfigItem will call this constructor
 ItemHolder1::holdConfigItem(EItem::UserOptions);
 }
-xImpl = xSharedImpl.lock();
 xImpl->AddListener(this);
 }
 
 SvtUserOptions::~SvtUserOptions()
 {
 // Global access, must be guarded (multithreading)
-osl::MutexGuard aGuard( GetInitMutex() );
+std::unique_lock aGuard( GetInitMutex() );
 xImpl->RemoveListener(this);
 }
 
-osl::Mutex& SvtUserOptions::GetInitMutex()
-{
-static osl::Mutex gMutex;
-return gMutex;
-}
-
 OUString SvtUserOptions::GetCompany() const { return 
GetToken(UserOptToken::Company); }
 OUString SvtUserOptions::GetFirstName  () const { return 
GetToken(UserOptToken::FirstName); }
 OUString SvtUserOptions::GetLastName   () const { return 
GetToken(UserOptToken::LastName); }
@@ -307,37 +309,37 @@ OUString SvtUserOptions::GetEncryptionKey  () const { 
return GetToken(UserOptTok
 
 bool SvtUserOptions::IsTokenReadonly (UserOptToken nToken) const
 {
-osl::MutexGuard aGuard(GetInitMutex());
+std::unique_lock aGuard(GetInitMutex());
 return xImpl->IsTokenReadonly(nToken);
 }
 
 OUString SvtUserOptions::GetToken (UserOptToken nToken) const
 {
-osl::MutexGuard aGuard(GetInitMutex());
+std::unique_lock aGuard(GetInitMutex());
 return xImpl->GetToken(nToken);
 }
 
 void SvtUserOptions::SetToken (UserOptToken nToken, OUString const& rNewToken)
 {
-osl::MutexGuard aGuard(GetInitMutex());
+std::unique_lock aGuard(GetInitMutex());
 xImpl->SetToken(nToken, rNewToken);
 }
 
 void SvtUserOptions::SetBoolValue (UserOptToken nToken, bool bNewValue)
 {
-osl::MutexGuard aGuard(GetInitMutex());
+std::unique_lock aGuard(GetInitMutex());
 xImpl->SetBoolValue(nToken, bNewValue);
 }
 
 bool SvtUserOptions::GetEncryptToSelf() const
 {
-osl::MutexGuard aGuard(GetInitMutex());
+std::unique_lock aGuard(GetInitMutex());
 return xImpl->GetBoolValue(UserOptToken::EncryptToSelf);
 }
 
 OUString SvtUserOptions::GetFullName () const
 {
-osl::MutexGuard aGuard(GetInitMutex());
+std::unique_lock aGuard(GetInitMutex());
 return xImpl->GetFullName();
 }
 


[Libreoffice-commits] core.git: include/unotools

2021-11-29 Thread Noel Grandin (via logerrit)
 include/unotools/linguprops.hxx |   68 
 1 file changed, 34 insertions(+), 34 deletions(-)

New commits:
commit 5bba732060a947541f07fc9c87df8ac7a1f8c4f7
Author: Noel Grandin 
AuthorDate: Mon Nov 29 13:27:07 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 30 08:53:48 2021 +0100

loplugin:stringliteraldefine in unotools

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

diff --git a/include/unotools/linguprops.hxx b/include/unotools/linguprops.hxx
index 00400f05d31e..6beae72149ac 100644
--- a/include/unotools/linguprops.hxx
+++ b/include/unotools/linguprops.hxx
@@ -24,51 +24,51 @@
 #endif
 
 // UNO property names for general options
-constexpr OUStringLiteral UPN_IS_GERMAN_PRE_REFORM= 
u"IsGermanPreReform"; /*! deprecated #i91949 !*/
-constexpr OUStringLiteral UPN_IS_USE_DICTIONARY_LIST  = 
u"IsUseDictionaryList";
-constexpr OUStringLiteral UPN_IS_IGNORE_CONTROL_CHARACTERS= 
u"IsIgnoreControlCharacters";
-constexpr OUStringLiteral UPN_ACTIVE_DICTIONARIES = 
u"ActiveDictionaries";
+inline constexpr OUStringLiteral UPN_IS_GERMAN_PRE_REFORM= 
u"IsGermanPreReform"; /*! deprecated #i91949 !*/
+inline constexpr OUStringLiteral UPN_IS_USE_DICTIONARY_LIST  = 
u"IsUseDictionaryList";
+inline constexpr OUStringLiteral UPN_IS_IGNORE_CONTROL_CHARACTERS= 
u"IsIgnoreControlCharacters";
+inline constexpr OUStringLiteral UPN_ACTIVE_DICTIONARIES = 
u"ActiveDictionaries";
 
 // UNO property names for SpellChecker
-constexpr OUStringLiteral UPN_IS_SPELL_UPPER_CASE = 
u"IsSpellUpperCase";
-constexpr OUStringLiteral UPN_IS_SPELL_WITH_DIGITS= 
u"IsSpellWithDigits";
-constexpr OUStringLiteral UPN_IS_SPELL_CAPITALIZATION = 
u"IsSpellCapitalization";
+inline constexpr OUStringLiteral UPN_IS_SPELL_UPPER_CASE = 
u"IsSpellUpperCase";
+inline constexpr OUStringLiteral UPN_IS_SPELL_WITH_DIGITS= 
u"IsSpellWithDigits";
+inline constexpr OUStringLiteral UPN_IS_SPELL_CAPITALIZATION = 
u"IsSpellCapitalization";
 
 // UNO property names for Hyphenator
-constexpr OUStringLiteral UPN_HYPH_MIN_LEADING= 
u"HyphMinLeading";
-constexpr OUStringLiteral UPN_HYPH_MIN_TRAILING   = 
u"HyphMinTrailing";
-constexpr OUStringLiteral UPN_HYPH_MIN_WORD_LENGTH= 
u"HyphMinWordLength";
-constexpr OUStringLiteral UPN_HYPH_NO_CAPS= u"HyphNoCaps";
+inline constexpr OUStringLiteral UPN_HYPH_MIN_LEADING= 
u"HyphMinLeading";
+inline constexpr OUStringLiteral UPN_HYPH_MIN_TRAILING   = 
u"HyphMinTrailing";
+inline constexpr OUStringLiteral UPN_HYPH_MIN_WORD_LENGTH= 
u"HyphMinWordLength";
+inline constexpr OUStringLiteral UPN_HYPH_NO_CAPS= 
u"HyphNoCaps";
 
 // UNO property names for Lingu
 // (those not covered by the SpellChecker and Hyphenator
 // properties and more likely to be used in other modules only)
-constexpr OUStringLiteral UPN_DEFAULT_LANGUAGE= 
u"DefaultLanguage";
-constexpr OUStringLiteral UPN_DEFAULT_LOCALE  = 
u"DefaultLocale";
-constexpr OUStringLiteral UPN_DEFAULT_LOCALE_CJK  = 
u"DefaultLocale_CJK";
-constexpr OUStringLiteral UPN_DEFAULT_LOCALE_CTL  = 
u"DefaultLocale_CTL";
-constexpr OUStringLiteral UPN_IS_HYPH_AUTO= u"IsHyphAuto";
-constexpr OUStringLiteral UPN_IS_HYPH_SPECIAL = 
u"IsHyphSpecial";
-constexpr OUStringLiteral UPN_IS_SPELL_AUTO   = u"IsSpellAuto";
-constexpr OUStringLiteral UPN_IS_SPELL_HIDE   = 
u"IsSpellHide";   /*! deprecated #i91949 !*/
-constexpr OUStringLiteral UPN_IS_SPELL_IN_ALL_LANGUAGES   = 
u"IsSpellInAllLanguages"; /*! deprecated #i91949 !*/
-constexpr OUStringLiteral UPN_IS_SPELL_SPECIAL= 
u"IsSpellSpecial";
-constexpr OUStringLiteral UPN_IS_WRAP_REVERSE = 
u"IsWrapReverse";
-constexpr OUStringLiteral UPN_DATA_FILES_CHANGED_CHECK_VALUE  = 
u"DataFilesChangedCheckValue";
+inline constexpr OUStringLiteral UPN_DEFAULT_LANGUAGE= 
u"DefaultLanguage";
+inline constexpr OUStringLiteral UPN_DEFAULT_LOCALE  = 
u"DefaultLocale";
+inline constexpr OUStringLiteral UPN_DEFAULT_LOCALE_CJK  = 
u"DefaultLocale_CJK";
+inline constexpr OUStringLiteral UPN_DEFAULT_LOCALE_CTL  = 
u"DefaultLocale_CTL";
+inline constexpr OUStringLiteral UPN_IS_HYPH_AUTO= 
u"IsHyphAuto";
+inline constexpr OUStringLiteral UPN_IS_HYPH_SPECIAL = 
u"IsHyphSpecial";
+inline constexpr OUStringLiteral UPN_IS_SPELL_AUTO   = 
u"IsSpellAuto";
+inline constexpr OUStringLiteral UPN_IS_SPELL_HIDE   = 
u"IsSpellHide";   /*! deprecated 

[Libreoffice-commits] core.git: include/unotools

2021-11-04 Thread Mike Kaganski (via logerrit)
 include/unotools/compatibility.hxx |9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

New commits:
commit 706c7161fa1dd001c658bd1837e2b8e366693641
Author: Mike Kaganski 
AuthorDate: Thu Nov 4 12:12:08 2021 +0200
Commit: Mike Kaganski 
CommitDate: Thu Nov 4 13:20:27 2021 +0100

Simplify SvtCompatibilityEntry::setValue

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

diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index c74825c8f5bd..15f8b59dfee8 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -129,14 +129,7 @@ class SvtCompatibilityEntry
 template
 void setValue( const Index rIdx, T rValue )
 {
-if ( static_cast(rIdx) < getElementCount() )
-{
-m_aPropertyValue[ static_cast(rIdx) ] = 
css::uno::Any(rValue);
-} else
-{
-/* Wrong index. */
-assert( false );
-}
+setValue(rIdx, css::uno::Any(rValue));
 }
 
 bool isDefaultEntry() const


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

2021-11-04 Thread Noel Grandin (via logerrit)
 include/unotools/localedatawrapper.hxx |3 +--
 unotools/source/i18n/localedatawrapper.cxx |   12 +---
 2 files changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 60b9c16bd482e43cfc5d70d807b84df442707a83
Author: Noel Grandin 
AuthorDate: Thu Nov 4 11:31:33 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 4 11:42:12 2021 +0100

fix potential out-of-bounds access in LocaleDataWrapper

after
commit 86b345a963a64fd9b9a3cab522b3ac2e909977fd
Date:   Sat May 1 08:30:46 2021 +0200
tdf#79049 speed up OOXML workbook load (4)
if the number of reserved words returned by the locale is not correct.

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

diff --git a/include/unotools/localedatawrapper.hxx 
b/include/unotools/localedatawrapper.hxx
index 22cafe581c42..6593e96dcaaa 100644
--- a/include/unotools/localedatawrapper.hxx
+++ b/include/unotools/localedatawrapper.hxx
@@ -80,12 +80,11 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
 std::shared_ptr< css::i18n::Calendar2 >xDefaultCalendar;
 std::shared_ptr< css::i18n::Calendar2 >xSecondaryCalendar;
 css::i18n::LocaleDataItem2 aLocaleDataItem;
-css::uno::Sequence< OUString > aReservedWordSeq;
 css::uno::Sequence< OUString > aDateAcceptancePatterns;
 css::uno::Sequence< sal_Int32 >aGrouping;
 // cached items
 OUStringaLocaleItem[css::i18n::LocaleItem::COUNT2];
-OUStringaReservedWord[css::i18n::reservedWords::COUNT];
+std::vector   aReservedWords;
 OUStringaCurrSymbol;
 OUStringaCurrBankSymbol;
 DateOrder   nDateOrder;
diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index 12a91d363ded..42b8027b3239 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -169,15 +169,12 @@ void LocaleDataWrapper::loadData()
 
 try
 {
-aReservedWordSeq = xLD->getReservedWord( rMyLocale );
+aReservedWords = 
comphelper::sequenceToContainer>(xLD->getReservedWord( 
rMyLocale ));
 }
 catch ( const Exception& )
 {
 TOOLS_WARN_EXCEPTION( "unotools.i18n", "getReservedWord" );
-aReservedWordSeq = {};
 }
-for (int i=0; i < css::i18n::reservedWords::COUNT; ++i)
-aReservedWord[i] = aReservedWordSeq[i];
 
 try
 {
@@ -378,12 +375,13 @@ const OUString& LocaleDataWrapper::getOneLocaleItem( 
sal_Int16 nItem ) const
 
 const OUString& LocaleDataWrapper::getOneReservedWord( sal_Int16 nWord ) const
 {
-if ( nWord < 0 || nWord >= reservedWords::COUNT )
+if ( nWord < 0 || nWord >= static_cast(aReservedWords.size()) )
 {
 SAL_WARN( "unotools.i18n", "getOneReservedWord: bounds" );
-nWord = reservedWords::FALSE_WORD;
+static const OUString EMPTY;
+return EMPTY;
 }
-return aReservedWord[nWord];
+return aReservedWords[nWord];
 }
 
 MeasurementSystem LocaleDataWrapper::mapMeasurementStringToEnum( const 
OUString& rMS ) const


[Libreoffice-commits] core.git: include/unotools

2021-11-02 Thread homeboy445 (via logerrit)
 include/unotools/VersionConfig.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ab32d1c01814d576b0b82c99e1849a8a71b12188
Author: homeboy445 
AuthorDate: Mon Nov 1 21:08:23 2021 +0530
Commit: Samuel Mehrbrodt 
CommitDate: Tue Nov 2 07:47:41 2021 +0100

tdf#145486: Prevented crash by not updating readOnly value

Change-Id: I88c2b8a9a05335a16154a23a541882a3ca6de3e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124555
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/unotools/VersionConfig.hxx 
b/include/unotools/VersionConfig.hxx
index 60b3a36c51e0..c3bdeea48fea 100644
--- a/include/unotools/VersionConfig.hxx
+++ b/include/unotools/VersionConfig.hxx
@@ -31,7 +31,7 @@ static bool isProductVersionUpgraded(bool aUpdateVersion)
 = sLastVersion.getToken(0, '.').toInt32() * 10 + 
sLastVersion.getToken(1, '.').toInt32();
 if (iCurrent > iLast)
 {
-if (aUpdateVersion)
+if (aUpdateVersion && 
!officecfg::Setup::Product::ooSetupLastVersion::isReadOnly())
 { //update lastversion
 std::shared_ptr batch(
 comphelper::ConfigurationChanges::create());


[Libreoffice-commits] core.git: include/unotools sfx2/source unotools/source xmlsecurity/source

2021-10-11 Thread Noel Grandin (via logerrit)
 include/unotools/securityoptions.hxx   |2 +-
 sfx2/source/appl/appcfg.cxx|2 +-
 unotools/source/config/securityoptions.cxx |4 ++--
 xmlsecurity/source/component/documentdigitalsignatures.cxx |2 +-
 xmlsecurity/source/dialogs/macrosecurity.cxx   |2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 64937ff98a970050b0d5d89e3a4734d93e13ad00
Author: Noel Grandin 
AuthorDate: Sun Oct 10 20:23:48 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 11 10:39:38 2021 +0200

loplugin:moveparam in unotools

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

diff --git a/include/unotools/securityoptions.hxx 
b/include/unotools/securityoptions.hxx
index 93363c48210f..332ba457fc4d 100644
--- a/include/unotools/securityoptions.hxx
+++ b/include/unotools/securityoptions.hxx
@@ -90,7 +90,7 @@ namespace SvtSecurityOptions
 
*//*-*/
 
 UNOTOOLS_DLLPUBLIC std::vector< OUString >  GetSecureURLs();
-UNOTOOLS_DLLPUBLIC void SetSecureURLs( const std::vector< OUString >& 
seqURLList );
+UNOTOOLS_DLLPUBLIC void SetSecureURLs( std::vector< OUString >&& 
seqURLList );
 
 
/*-
 @short  interface methods to get and set value of config key 
"org.openoffice.Office.Common/Security/Scripting/StarOfficeBasic"
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index c37e01281977..feeb621b1596 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -640,7 +640,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& 
rSet )
 if ( SfxItemState::SET == rSet.GetItemState(SID_SECURE_URL, true, ))
 {
 DBG_ASSERT(dynamic_cast< const SfxStringListItem *>( pItem ) !=  
nullptr, "StringListItem expected");
-SvtSecurityOptions::SetSecureURLs( static_cast(pItem)->GetList() );
+SvtSecurityOptions::SetSecureURLs( std::vector(static_cast(pItem)->GetList()) );
 }
 
 // Store changed data
diff --git a/unotools/source/config/securityoptions.cxx 
b/unotools/source/config/securityoptions.cxx
index cd41f92a0eac..e3cab9d1a557 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -104,12 +104,12 @@ std::vector< OUString > GetSecureURLs()
 return aRet;
 }
 
-void SetSecureURLs( const std::vector< OUString >& urlList )
+void SetSecureURLs( std::vector< OUString >&& urlList )
 {
 //DBG_ASSERT(!officecfg::SecureURL::isReadOnly(), 
"SvtSecurityOptions_Impl::SetSecureURLs()\nYou tried to write on a readonly 
value!\n");
 //if (officecfg::SecureURL::isReadOnly())
 //return;
-std::vector< OUString > lURLs( urlList );
+std::vector< OUString > lURLs( std::move(urlList) );
 SvtPathOptions aOpt;
 std::transform(lURLs.begin(), lURLs.end(), lURLs.begin(),
 [](const OUString& rUrl) -> OUString { return aOpt.UseVariable( 
rUrl ); });
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx 
b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 625bbbd0d4be..189c220eebd9 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -788,7 +788,7 @@ void 
DocumentDigitalSignatures::addLocationToTrustedSources( const OUString& Loc
 std::vector< OUString > aSecURLs = SvtSecurityOptions::GetSecureURLs();
 aSecURLs.push_back(Location);
 
-SvtSecurityOptions::SetSecureURLs( aSecURLs );
+SvtSecurityOptions::SetSecureURLs( std::move(aSecURLs) );
 }
 
 sal_Bool DocumentDigitalSignatures::signDocumentWithCertificate(
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx 
b/xmlsecurity/source/dialogs/macrosecurity.cxx
index dbfa41e96d58..d4a7e9f7c23f 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -430,7 +430,7 @@ void MacroSecurityTrustedSourcesTP::ClosePage()
 aSecureURLs.push_back(aURL);
 }
 
-SvtSecurityOptions::SetSecureURLs( aSecureURLs );
+SvtSecurityOptions::SetSecureURLs( std::move(aSecureURLs) );
 }
 // Trusted Path could not be removed (#i33584#)
 // don't forget to remove the old saved SecureURLs


[Libreoffice-commits] core.git: include/unotools linguistic/source svl/source sw/inc sw/source unotools/source xmloff/source

2021-09-17 Thread Noel Grandin (via logerrit)
 include/unotools/charclass.hxx |4 -
 linguistic/source/misc.cxx |   22 +-
 linguistic/source/spelldsp.cxx |6 -
 svl/source/numbers/zforlist.cxx|2 
 sw/inc/calc.hxx|3 
 sw/source/core/bastyp/calc.cxx |7 +
 sw/source/core/fields/usrfld.cxx   |6 -
 sw/source/core/txtnode/txtedt.cxx  |   11 +--
 unotools/source/i18n/charclass.cxx |  133 ++---
 unotools/source/misc/syslocale.cxx |   12 +--
 xmloff/source/style/xmlnumfe.cxx   |2 
 11 files changed, 56 insertions(+), 152 deletions(-)

New commits:
commit dac29c278531d5474289eb54aa03987c4958ac83
Author: Noel Grandin 
AuthorDate: Thu Sep 16 11:03:04 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 17 10:49:21 2021 +0200

speedup toUpperCase when called in parallel

by removing locking from CharClass, which means we need to make it an
immutable class

Since SharedStringPool in sc/ stores a pointer to the CharClass in
use, we have to tweak SvtSysLocale so that the object does not change
location.

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

diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index 521f3abe003b..f3c81a18e51b 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -62,7 +62,6 @@ class UNOTOOLS_DLLPUBLIC CharClass
 {
 LanguageTag maLanguageTag;
 css::uno::Reference< css::i18n::XCharacterClassification >xCC;
-mutable std::mutexaMutex;
 
 CharClass(const CharClass&) = delete;
 CharClass& operator=(const CharClass&) = delete;
@@ -79,9 +78,6 @@ public:
 
 ~CharClass();
 
-/// set a new Locale
-void setLanguageTag( const LanguageTag& rLanguageTag );
-
 /// get current Locale
 const LanguageTag& getLanguageTag() const;
 
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 363b5f445a47..f541b97551e6 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -566,21 +566,10 @@ uno::Reference< XHyphenatedWord > 
RebuildHyphensAndControlChars(
 return xRes;
 }
 
-static CharClass & lcl_GetCharClass()
-{
-static CharClass aCC( LanguageTag( LANGUAGE_ENGLISH_US ));
-return aCC;
-}
-
-static std::mutex s_GetCharClassMutex;
-
 bool IsUpper( const OUString , sal_Int32 nPos, sal_Int32 nLen, 
LanguageType nLanguage )
 {
-std::scoped_lock  aGuard( s_GetCharClassMutex );
-
-CharClass  = lcl_GetCharClass();
-rCC.setLanguageTag( LanguageTag( nLanguage ));
-sal_Int32 nFlags = rCC.getStringType( rText, nPos, nLen );
+CharClass aCC(( LanguageTag( nLanguage ) ));
+sal_Int32 nFlags = aCC.getStringType( rText, nPos, nLen );
 return  (nFlags & KCharacterType::UPPER)
 && !(nFlags & KCharacterType::LOWER);
 }
@@ -612,11 +601,8 @@ CapType capitalType(const OUString& aTerm, CharClass const 
* pCC)
 
 OUString ToLower( const OUString , LanguageType nLanguage )
 {
-std::scoped_lock  aGuard( s_GetCharClassMutex );
-
-CharClass  = lcl_GetCharClass();
-rCC.setLanguageTag( LanguageTag( nLanguage ));
-return rCC.lowercase( rText );
+CharClass aCC(( LanguageTag( nLanguage ) ));
+return aCC.lowercase( rText );
 }
 
 // sorted(!) array of unicode ranges for code points that are exclusively(!) 
used as numbers
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx
index dbece3def648..c1b309b00adf 100644
--- a/linguistic/source/spelldsp.cxx
+++ b/linguistic/source/spelldsp.cxx
@@ -813,9 +813,9 @@ void SpellCheckerDispatcher::FlushSpellCache()
 
 void SpellCheckerDispatcher::setCharClass(const LanguageTag& rLanguageTag)
 {
-if (!m_pCharClass)
-m_pCharClass.reset( new CharClass(rLanguageTag) );
-m_pCharClass->setLanguageTag(rLanguageTag);
+if (m_pCharClass && m_pCharClass->getLanguageTag() == rLanguageTag)
+return;
+m_pCharClass.reset( new CharClass(rLanguageTag) );
 }
 
 
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 6ef3dddcd016..077d04867e0f 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -338,7 +338,7 @@ void SvNumberFormatter::ChangeIntl(LanguageType eLnge)
 ActLnge = eLnge;
 
 maLanguageTag.reset( eLnge );
-pCharClass->setLanguageTag( maLanguageTag );
+pCharClass.reset( new CharClass( m_xContext, maLanguageTag ) );
 xLocaleData.changeLocale( maLanguageTag );
 xCalendar.changeLocale( maLanguageTag.getLocale() );
 xTransliteration.changeLocale( eLnge );
diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx
index 4121cc7f0e72..5ff42c15c59e 100644
--- a/sw/inc/calc.hxx
+++ b/sw/inc/calc.hxx
@@ -240,7 +240,8 @@ public:
 
 boolPush(const SwUserFieldType* pUserFieldType);
 voidPop();
-CharClass* 

[Libreoffice-commits] core.git: include/unotools include/vcl unotools/source vcl/inc vcl/qt5 vcl/source vcl/unx

2021-08-03 Thread Noel Grandin (via logerrit)
 include/unotools/resmgr.hxx   |   21 -
 include/vcl/font/Feature.hxx  |   11 ++-
 unotools/source/i18n/resmgr.cxx   |   29 +
 vcl/inc/font/OpenTypeFeatureStrings.hrc   |2 +-
 vcl/inc/print.hrc |4 ++--
 vcl/inc/printaccessoryview.hrc|4 ++--
 vcl/inc/qt5/Qt5FilePicker.hxx |3 ++-
 vcl/inc/strings.hrc   |2 +-
 vcl/inc/svdata.hxx|3 ++-
 vcl/inc/units.hrc |4 ++--
 vcl/qt5/Qt5FilePicker.cxx |8 
 vcl/source/app/stdtext.cxx|2 +-
 vcl/source/app/svapp.cxx  |2 +-
 vcl/source/app/svdata.cxx |2 +-
 vcl/source/font/Feature.cxx   |   11 ---
 vcl/source/window/brdwin.cxx  |2 +-
 vcl/source/window/builder.cxx |   12 +++-
 vcl/source/window/splitwin.cxx|2 +-
 vcl/unx/gtk3/fpicker/resourceprovider.cxx |8 
 19 files changed, 87 insertions(+), 45 deletions(-)

New commits:
commit 5afdcad4c0e7850b18996c549892b9360cd8973f
Author: Noel Grandin 
AuthorDate: Mon Aug 2 16:06:05 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 3 12:18:15 2021 +0200

Pass context and resource string down to boost::locale separately

because this is often on a hot path, and we can avoid the splitting and
joining of strings like this.

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

diff --git a/include/unotools/resmgr.hxx b/include/unotools/resmgr.hxx
index 244963f598b1..0795c3f16704 100644
--- a/include/unotools/resmgr.hxx
+++ b/include/unotools/resmgr.hxx
@@ -33,7 +33,8 @@ struct UNOTOOLS_DLLPUBLIC TranslateId
 const char* mpContext;
 const char* mpId;
 
-TranslateId() {}
+TranslateId()
+: mpContext(nullptr), mpId(nullptr) {}
 TranslateId(const char* pContext, const char* pId)
 : mpContext(pContext), mpId(pId) {}
 
@@ -43,12 +44,30 @@ struct UNOTOOLS_DLLPUBLIC TranslateId
 bool operator!=(const TranslateId& other) const { return 
!operator==(other); }
 };
 
+struct UNOTOOLS_DLLPUBLIC TranslateNId
+{
+const char* mpContext;
+const char* mpSingular;
+const char* mpPlural;
+
+TranslateNId()
+: mpContext(nullptr), mpSingular(nullptr), mpPlural(nullptr) {}
+TranslateNId(const char* pContext, const char* pSingular, const char* 
pPlural)
+: mpContext(pContext), mpSingular(pSingular), mpPlural(pPlural) {}
+
+operator bool() const { return mpContext != nullptr; }
+
+bool operator==(const TranslateNId& other) const;
+bool operator!=(const TranslateNId& other) const { return 
!operator==(other); }
+};
+
 namespace Translate
 {
 UNOTOOLS_DLLPUBLIC std::locale Create(std::string_view aPrefixName, const 
LanguageTag& rLocale = SvtSysLocale().GetUILanguageTag());
 UNOTOOLS_DLLPUBLIC OUString get(std::string_view aId, const std::locale 
);
 UNOTOOLS_DLLPUBLIC OUString nget(std::string_view aId, int n, const 
std::locale );
 UNOTOOLS_DLLPUBLIC OUString get(TranslateId sContextAndId, const 
std::locale );
+UNOTOOLS_DLLPUBLIC OUString nget(TranslateNId aContextSingularPlural, int 
n, const std::locale );
 UNOTOOLS_DLLPUBLIC void SetReadStringHook( ResHookProc pProc );
 UNOTOOLS_DLLPUBLIC ResHookProc GetReadStringHook();
 UNOTOOLS_DLLPUBLIC OUString ExpandVariables(const OUString& rString);
diff --git a/include/vcl/font/Feature.hxx b/include/vcl/font/Feature.hxx
index 13c798fbcf32..b16843abea7d 100644
--- a/include/vcl/font/Feature.hxx
+++ b/include/vcl/font/Feature.hxx
@@ -12,6 +12,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 namespace vcl::font
@@ -41,11 +42,11 @@ struct VCL_DLLPUBLIC FeatureParameter
 private:
 uint32_t m_nCode;
 OUString m_sDescription;
-const char* m_pDescriptionID;
+TranslateId m_pDescriptionID;
 
 public:
 FeatureParameter(uint32_t nCode, OUString aDescription);
-FeatureParameter(uint32_t nCode, const char* pDescriptionID);
+FeatureParameter(uint32_t nCode, TranslateId pDescriptionID);
 
 uint32_t getCode() const;
 OUString getDescription() const;
@@ -55,7 +56,7 @@ class VCL_DLLPUBLIC FeatureDefinition
 {
 private:
 OUString m_sDescription;
-const char* m_pDescriptionID;
+TranslateId m_pDescriptionID;
 OUString m_sNumericPart;
 uint32_t m_nCode;
 uint32_t m_nDefault;
@@ -70,9 +71,9 @@ public:
   std::vector const& rEnumParameters
   = std::vector{},
   uint32_t nDefault = 0);
-FeatureDefinition(uint32_t nCode, const char* pDescriptionID,
+FeatureDefinition(uint32_t nCode, TranslateId pDescriptionID,
   OUString const& 

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

2021-07-31 Thread Noel Grandin (via logerrit)
 include/unotools/streamwrap.hxx  |4 ++--
 unotools/source/streaming/streamwrap.cxx |   14 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit dc0aebfb6a199761134d372f42401b81b37ca102
Author: Noel Grandin 
AuthorDate: Fri Jul 30 15:10:17 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 31 11:17:02 2021 +0200

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

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

diff --git a/include/unotools/streamwrap.hxx b/include/unotools/streamwrap.hxx
index 2e83c63bbdbf..4993ffd92f7c 100644
--- a/include/unotools/streamwrap.hxx
+++ b/include/unotools/streamwrap.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_UNOTOOLS_STREAMWRAP_HXX
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -30,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class SvStream;
 
@@ -43,7 +43,7 @@ class SAL_DLLPUBLIC_TEMPLATE OInputStreamWrapper_Base : 
public cppu::WeakImplHel
 class UNOTOOLS_DLLPUBLIC OInputStreamWrapper : public OInputStreamWrapper_Base
 {
 protected:
-::osl::Mutexm_aMutex;
+std::mutex  m_aMutex;
 SvStream*   m_pSvStream;
 boolm_bSvStreamOwner : 1;
 OInputStreamWrapper()
diff --git a/unotools/source/streaming/streamwrap.cxx 
b/unotools/source/streaming/streamwrap.cxx
index 70054d0f58dc..77e7168d69a2 100644
--- a/unotools/source/streaming/streamwrap.cxx
+++ b/unotools/source/streaming/streamwrap.cxx
@@ -63,7 +63,7 @@ sal_Int32 SAL_CALL 
OInputStreamWrapper::readBytes(css::uno::Sequence< sal_Int8 >
 if (nBytesToRead < 0)
 throw 
css::io::BufferSizeExceededException(OUString(),static_cast(this));
 
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 
 if (aData.getLength() < nBytesToRead)
 aData.realloc(nBytesToRead);
@@ -96,7 +96,7 @@ sal_Int32 SAL_CALL 
OInputStreamWrapper::readSomeBytes(css::uno::Sequence< sal_In
 
 void SAL_CALL OInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip)
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 checkError();
 
 m_pSvStream->SeekRel(nBytesToSkip);
@@ -105,7 +105,7 @@ void SAL_CALL OInputStreamWrapper::skipBytes(sal_Int32 
nBytesToSkip)
 
 sal_Int32 SAL_CALL OInputStreamWrapper::available()
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 checkConnected();
 
 sal_Int64 nAvailable = m_pSvStream->remainingSize();
@@ -116,7 +116,7 @@ sal_Int32 SAL_CALL OInputStreamWrapper::available()
 
 void SAL_CALL OInputStreamWrapper::closeInput()
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 checkConnected();
 
 if (m_bSvStreamOwner)
@@ -157,7 +157,7 @@ 
OSeekableInputStreamWrapper::OSeekableInputStreamWrapper(SvStream* _pStream, boo
 
 void SAL_CALL OSeekableInputStreamWrapper::seek( sal_Int64 _nLocation )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 checkConnected();
 
 m_pSvStream->Seek(static_cast(_nLocation));
@@ -166,7 +166,7 @@ void SAL_CALL OSeekableInputStreamWrapper::seek( sal_Int64 
_nLocation )
 
 sal_Int64 SAL_CALL OSeekableInputStreamWrapper::getPosition(  )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 checkConnected();
 
 sal_uInt32 nPos = m_pSvStream->Tell();
@@ -176,7 +176,7 @@ sal_Int64 SAL_CALL 
OSeekableInputStreamWrapper::getPosition(  )
 
 sal_Int64 SAL_CALL OSeekableInputStreamWrapper::getLength(  )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 checkConnected();
 
 checkError();


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

2021-07-31 Thread Noel Grandin (via logerrit)
 include/unotools/streamhelper.hxx  |4 ++--
 unotools/source/streaming/streamhelper.cxx |   12 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 429e6e6efbfbc65d36452cbf8b3a25740a1dc8bc
Author: Noel Grandin 
AuthorDate: Fri Jul 30 15:08:23 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 31 11:16:41 2021 +0200

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

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

diff --git a/include/unotools/streamhelper.hxx 
b/include/unotools/streamhelper.hxx
index 05c5a5b45e84..26c7aa37c2da 100644
--- a/include/unotools/streamhelper.hxx
+++ b/include/unotools/streamhelper.hxx
@@ -23,9 +23,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 
 namespace utl
 {
@@ -35,7 +35,7 @@ namespace utl
  */
 class UNOTOOLS_DLLPUBLIC OInputStreamHelper final : public 
cppu::WeakImplHelper
 {
-::osl::Mutexm_aMutex;
+std::mutex  m_aMutex;
 SvLockBytesRef  m_xLockBytes;
 sal_uInt64  m_nActPos;
 sal_Int32   m_nAvailable;   // this is typically the chunk(buffer) size
diff --git a/unotools/source/streaming/streamhelper.cxx 
b/unotools/source/streaming/streamhelper.cxx
index cf5930d43f19..bd8824d9456f 100644
--- a/unotools/source/streaming/streamhelper.cxx
+++ b/unotools/source/streaming/streamhelper.cxx
@@ -36,7 +36,7 @@ sal_Int32 SAL_CALL 
OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >&
 if (nBytesToRead < 0)
 throw css::io::BufferSizeExceededException(OUString(), 
static_cast(this));
 
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 if (aData.getLength() < nBytesToRead)
 aData.realloc(nBytesToRead);
 
@@ -56,7 +56,7 @@ sal_Int32 SAL_CALL 
OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >&
 
 void SAL_CALL OInputStreamHelper::seek( sal_Int64 location )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 m_nActPos = location;
 }
 
@@ -70,7 +70,7 @@ sal_Int64 SAL_CALL OInputStreamHelper::getLength(  )
 if (!m_xLockBytes.is())
 return 0;
 
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 SvLockBytesStat aStat;
 m_xLockBytes->Stat(  );
 return aStat.nSize;
@@ -85,7 +85,7 @@ sal_Int32 SAL_CALL 
OInputStreamHelper::readSomeBytes(css::uno::Sequence< sal_Int
 
 void SAL_CALL OInputStreamHelper::skipBytes(sal_Int32 nBytesToSkip)
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 if (!m_xLockBytes.is())
 throw css::io::NotConnectedException(OUString(), 
static_cast(this));
 
@@ -97,7 +97,7 @@ void SAL_CALL OInputStreamHelper::skipBytes(sal_Int32 
nBytesToSkip)
 
 sal_Int32 SAL_CALL OInputStreamHelper::available()
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 if (!m_xLockBytes.is())
 throw css::io::NotConnectedException(OUString(), 
static_cast(this));
 
@@ -106,7 +106,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::available()
 
 void SAL_CALL OInputStreamHelper::closeInput()
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 if (!m_xLockBytes.is())
 throw css::io::NotConnectedException(OUString(), 
static_cast(this));
 


[Libreoffice-commits] core.git: include/unotools svl/source svtools/source

2021-07-31 Thread Noel Grandin (via logerrit)
 include/unotools/itemholderbase.hxx   |6 --
 svl/source/config/itemholder2.cxx |5 ++---
 svl/source/config/itemholder2.hxx |7 ---
 svtools/source/config/itemholder2.cxx |5 ++---
 svtools/source/config/itemholder2.hxx |6 +++---
 5 files changed, 11 insertions(+), 18 deletions(-)

New commits:
commit d78d98e62255238d4ae6060b2a57ae37dbabb4e6
Author: Noel Grandin 
AuthorDate: Fri Jul 30 15:06:26 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 31 10:10:36 2021 +0200

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

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

diff --git a/include/unotools/itemholderbase.hxx 
b/include/unotools/itemholderbase.hxx
index 0445c8fc2498..9ce0131626df 100644
--- a/include/unotools/itemholderbase.hxx
+++ b/include/unotools/itemholderbase.hxx
@@ -21,14 +21,8 @@
 #define INCLUDED_UNOTOOLS_ITEMHOLDERBASE_HXX
 
 #include 
-#include 
 #include 
 
-struct ItemHolderMutexBase
-{
-::osl::Mutex m_aLock;
-};
-
 enum class EItem
 {
 AccessibilityOptions  ,   // 2
diff --git a/svl/source/config/itemholder2.cxx 
b/svl/source/config/itemholder2.cxx
index 6227ce390b45..4bcbe13c5c7c 100644
--- a/svl/source/config/itemholder2.cxx
+++ b/svl/source/config/itemholder2.cxx
@@ -31,7 +31,6 @@
 #include 
 
 ItemHolder2::ItemHolder2()
-: ItemHolderMutexBase()
 {
 try
 {
@@ -76,7 +75,7 @@ void SAL_CALL ItemHolder2::disposing(const 
css::lang::EventObject&)
 
 void ItemHolder2::impl_addItem(EItem eItem)
 {
-osl::MutexGuard aLock(m_aLock);
+std::lock_guard aLock(m_aLock);
 
 for ( auto const & rInfo : m_lItems )
 {
@@ -95,7 +94,7 @@ void ItemHolder2::impl_releaseAllItems()
 {
 std::vector< TItemInfo > items;
 {
-::osl::MutexGuard aLock(m_aLock);
+std::lock_guard aLock(m_aLock);
 items.swap(m_lItems);
 }
 
diff --git a/svl/source/config/itemholder2.hxx 
b/svl/source/config/itemholder2.hxx
index 27d9f182ff03..cdb72581e715 100644
--- a/svl/source/config/itemholder2.hxx
+++ b/svl/source/config/itemholder2.hxx
@@ -23,13 +23,14 @@
 #include 
 #include 
 #include 
+#include 
 
-class ItemHolder2 : private ItemHolderMutexBase
-  , public  ::cppu::WeakImplHelper< css::lang::XEventListener >
+class ItemHolder2 : public  ::cppu::WeakImplHelper< css::lang::XEventListener >
 {
 // member
-private:
+private:
 
+std::mutex m_aLock;
 std::vector m_lItems;
 
 // c++ interface
diff --git a/svtools/source/config/itemholder2.cxx 
b/svtools/source/config/itemholder2.cxx
index 92d3226b8e1c..396a90322a65 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -36,7 +36,6 @@
 namespace svtools {
 
 ItemHolder2::ItemHolder2()
-: ItemHolderMutexBase()
 {
 try
 {
@@ -87,7 +86,7 @@ void SAL_CALL ItemHolder2::disposing(const 
css::lang::EventObject&)
 
 void ItemHolder2::impl_addItem(EItem eItem)
 {
-osl::MutexGuard aLock(m_aLock);
+std::lock_guard aLock(m_aLock);
 
 for ( auto const & rInfo : m_lItems )
 {
@@ -107,7 +106,7 @@ void ItemHolder2::impl_releaseAllItems()
 {
 std::vector items;
 {
-osl::MutexGuard aLock(m_aLock);
+std::lock_guard aLock(m_aLock);
 items.swap(m_lItems);
 }
 
diff --git a/svtools/source/config/itemholder2.hxx 
b/svtools/source/config/itemholder2.hxx
index c4fd540cf2d3..3bb1a6871ba7 100644
--- a/svtools/source/config/itemholder2.hxx
+++ b/svtools/source/config/itemholder2.hxx
@@ -22,17 +22,17 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace svtools {
 
 
-class ItemHolder2 : private ItemHolderMutexBase
-  , public  ::cppu::WeakImplHelper< css::lang::XEventListener >
+class ItemHolder2 : public  ::cppu::WeakImplHelper< css::lang::XEventListener >
 {
 
 // member
 private:
-
+std::mutex m_aLock;
 std::vector m_lItems;
 
 


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

2021-07-31 Thread Noel Grandin (via logerrit)
 include/unotools/charclass.hxx |4 +--
 unotools/source/i18n/charclass.cxx |   40 ++---
 2 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit c636f233fc0cd4f7c9000901fd006aa7823ade55
Author: Noel Grandin 
AuthorDate: Fri Jul 30 15:00:21 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 31 10:02:06 2021 +0200

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

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

diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index 61a850da9570..521f3abe003b 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -26,8 +26,8 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 
 namespace com::sun::star::uno { class XComponentContext; }
 namespace com::sun::star::i18n { class XCharacterClassification; }
@@ -62,7 +62,7 @@ class UNOTOOLS_DLLPUBLIC CharClass
 {
 LanguageTag maLanguageTag;
 css::uno::Reference< css::i18n::XCharacterClassification >xCC;
-mutable ::osl::MutexaMutex;
+mutable std::mutexaMutex;
 
 CharClass(const CharClass&) = delete;
 CharClass& operator=(const CharClass&) = delete;
diff --git a/unotools/source/i18n/charclass.cxx 
b/unotools/source/i18n/charclass.cxx
index 394ed81c2936..7c1c2b92d4c4 100644
--- a/unotools/source/i18n/charclass.cxx
+++ b/unotools/source/i18n/charclass.cxx
@@ -53,13 +53,13 @@ CharClass::~CharClass()
 
 void CharClass::setLanguageTag( const LanguageTag& rLanguageTag )
 {
-::osl::MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 maLanguageTag = rLanguageTag;
 }
 
 const LanguageTag& CharClass::getLanguageTag() const
 {
-::osl::MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return maLanguageTag;
 }
 
@@ -115,7 +115,7 @@ bool CharClass::isAlpha( const OUString& rStr, sal_Int32 
nPos ) const
 {
 if ( xCC.is() )
 {
-::osl::MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
  nCharClassAlphaType) != 0;
 }
@@ -137,7 +137,7 @@ bool CharClass::isLetter( const OUString& rStr, sal_Int32 
nPos ) const
 {
 if ( xCC.is() )
 {
-::osl::MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
  nCharClassLetterType) != 0;
 }
@@ -155,7 +155,7 @@ bool CharClass::isLetter( const OUString& rStr ) const
 {
 if ( xCC.is() )
 {
-::osl::MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return isLetterType( xCC->getStringType( rStr, 0, 
rStr.getLength(), getMyLocale() ) );
 }
 }
@@ -176,7 +176,7 @@ bool CharClass::isDigit( const OUString& rStr, sal_Int32 
nPos ) const
 {
 if ( xCC.is() )
 {
-::osl::MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
  KCharacterType::DIGIT) != 0;
 }
@@ -194,7 +194,7 @@ bool CharClass::isNumeric( const OUString& rStr ) const
 {
 if ( xCC.is() )
 {
-::osl::MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return isNumericType( xCC->getStringType( rStr, 0, 
rStr.getLength(), getMyLocale() ) );
 }
 }
@@ -215,7 +215,7 @@ bool CharClass::isAlphaNumeric( const OUString& rStr, 
sal_Int32 nPos ) const
 {
 if ( xCC.is() )
 {
-::osl::MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
 (nCharClassAlphaType | KCharacterType::DIGIT)) != 0;
 }
@@ -237,7 +237,7 @@ bool CharClass::isLetterNumeric( const OUString& rStr, 
sal_Int32 nPos ) const
 {
 if ( xCC.is() )
 {
-::osl::MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return  (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
  (nCharClassLetterType | KCharacterType::DIGIT)) != 0;
 }
@@ -255,7 +255,7 @@ bool CharClass::isLetterNumeric( const OUString& rStr ) 
const
 {
 if ( xCC.is() )
 {
-::osl::MutexGuard aGuard( aMutex );
+std::lock_guard aGuard( aMutex );
 return isLetterNumericType( xCC->getStringType( rStr, 0, 
rStr.getLength(), getMyLocale() ) );
 }
 }
@@ -272,7 +272,7 @@ OUString CharClass::titlecase(const OUString& rStr, 
sal_Int32 nPos, sal_Int32 nC
 {
   

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

2021-07-31 Thread Noel Grandin (via logerrit)
 include/unotools/accessiblestatesethelper.hxx  |4 ++--
 unotools/source/accessibility/accessiblestatesethelper.cxx |   12 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 421c3c9ca4ad01540838cbe4ecb89e353a70e14c
Author: Noel Grandin 
AuthorDate: Fri Jul 30 14:56:31 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 31 10:01:47 2021 +0200

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

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

diff --git a/include/unotools/accessiblestatesethelper.hxx 
b/include/unotools/accessiblestatesethelper.hxx
index 6fa66279f885..b1e5644f1eea 100644
--- a/include/unotools/accessiblestatesethelper.hxx
+++ b/include/unotools/accessiblestatesethelper.hxx
@@ -22,8 +22,8 @@
 #include 
 
 #include 
-#include 
 #include 
+#include 
 
 //= XAccessibleStateSet helper classes
 
@@ -126,7 +126,7 @@ public:
 
 private:
 /// Mutex guarding this object.
-::osl::Mutex maMutex;
+std::mutex maMutex;
 /// The implementation of this helper interface.
 sal_uInt64 maStates;
 };
diff --git a/unotools/source/accessibility/accessiblestatesethelper.cxx 
b/unotools/source/accessibility/accessiblestatesethelper.cxx
index cec1f6bcd615..db725d079a06 100644
--- a/unotools/source/accessibility/accessiblestatesethelper.cxx
+++ b/unotools/source/accessibility/accessiblestatesethelper.cxx
@@ -70,7 +70,7 @@ AccessibleStateSetHelper::~AccessibleStateSetHelper()
 */
 sal_Bool SAL_CALL AccessibleStateSetHelper::isEmpty ()
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 return maStates == 0;
 }
 
@@ -87,7 +87,7 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::isEmpty ()
 */
 sal_Bool SAL_CALL AccessibleStateSetHelper::contains (sal_Int16 aState)
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 return lcl_contains(maStates, aState);
 }
@@ -110,14 +110,14 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::contains 
(sal_Int16 aState)
 sal_Bool SAL_CALL AccessibleStateSetHelper::containsAll
 (const uno::Sequence& rStateSet)
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 return std::all_of(rStateSet.begin(), rStateSet.end(),
 [this](const sal_Int16 nState) { return lcl_contains(maStates, 
nState); });
 }
 
 uno::Sequence SAL_CALL AccessibleStateSetHelper::getStates()
 {
-osl::MutexGuard aGuard(maMutex);
+std::lock_guard aGuard(maMutex);
 uno::Sequence aRet(BITFIELDSIZE);
 sal_Int16* pSeq = aRet.getArray();
 sal_Int16 nStateCount(0);
@@ -134,7 +134,7 @@ uno::Sequence SAL_CALL 
AccessibleStateSetHelper::getStates()
 
 void AccessibleStateSetHelper::AddState(sal_Int16 aState)
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
 sal_uInt64 aTempBitSet(1);
 aTempBitSet <<= aState;
@@ -143,7 +143,7 @@ void AccessibleStateSetHelper::AddState(sal_Int16 aState)
 
 void AccessibleStateSetHelper::RemoveState(sal_Int16 aState)
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
 sal_uInt64 aTempBitSet(1);
 aTempBitSet <<= aState;


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

2021-07-31 Thread Noel Grandin (via logerrit)
 include/unotools/accessiblerelationsethelper.hxx  |4 ++--
 unotools/source/accessibility/accessiblerelationsethelper.cxx |   10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 049732b2190ee24b11a71f9236d597a37b54ea77
Author: Noel Grandin 
AuthorDate: Fri Jul 30 14:53:24 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 31 08:55:58 2021 +0200

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

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

diff --git a/include/unotools/accessiblerelationsethelper.hxx 
b/include/unotools/accessiblerelationsethelper.hxx
index b3ab5b0e4b27..35277ae5bd5f 100644
--- a/include/unotools/accessiblerelationsethelper.hxx
+++ b/include/unotools/accessiblerelationsethelper.hxx
@@ -23,8 +23,8 @@
 #include 
 
 #include 
-#include 
 #include 
+#include 
 #include 
 
 //= XAccessibleRelationSet helper classes
@@ -115,7 +115,7 @@ public:
 
 private:
 /// Mutex guarding this object.
-::osl::Mutex maMutex;
+std::mutex maMutex;
 /// The implementation of this helper interface.
 std::vector maRelations;
 };
diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx 
b/unotools/source/accessibility/accessiblerelationsethelper.cxx
index 02b3ad572e34..e7bf704a300b 100644
--- a/unotools/source/accessibility/accessiblerelationsethelper.cxx
+++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx
@@ -66,7 +66,7 @@ AccessibleRelationSetHelper::~AccessibleRelationSetHelper()
 sal_Int32 SAL_CALL
 AccessibleRelationSetHelper::getRelationCount(  )
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 return maRelations.size();
 }
@@ -87,7 +87,7 @@ sal_Int32 SAL_CALL
  AccessibleRelation SAL_CALL
 AccessibleRelationSetHelper::getRelation( sal_Int32 nIndex )
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 if ((nIndex < 0) || (o3tl::make_unsigned(nIndex) >= maRelations.size()))
 throw lang::IndexOutOfBoundsException();
@@ -110,7 +110,7 @@ sal_Int32 SAL_CALL
 sal_Bool SAL_CALL
 AccessibleRelationSetHelper::containsRelation( sal_Int16 aRelationType )
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 AccessibleRelation defaultRelation; // default is INVALID
 AccessibleRelation relationByType = lcl_getRelationByType(maRelations, 
aRelationType);
@@ -131,14 +131,14 @@ sal_Bool SAL_CALL
 AccessibleRelation SAL_CALL
 AccessibleRelationSetHelper::getRelationByType( sal_Int16 
aRelationType )
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 return lcl_getRelationByType(maRelations, aRelationType);
 }
 
 void AccessibleRelationSetHelper::AddRelation(const AccessibleRelation& 
rRelation)
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 for (auto& aRelation: maRelations)
 {


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

2021-07-29 Thread Noel Grandin (via logerrit)
 include/unotools/localedatawrapper.hxx |6 +++---
 unotools/source/i18n/localedatawrapper.cxx |6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 27457150b1c85cbf7c084b0930a71b0106b8278b
Author: Noel Grandin 
AuthorDate: Thu Jul 29 14:47:39 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 29 17:37:58 2021 +0200

return by const& in LocaleDataWrapper

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

diff --git a/include/unotools/localedatawrapper.hxx 
b/include/unotools/localedatawrapper.hxx
index 0a0832b64a13..94cc9be3425a 100644
--- a/include/unotools/localedatawrapper.hxx
+++ b/include/unotools/localedatawrapper.hxx
@@ -157,12 +157,12 @@ public:
 css::uno::Sequence< css::i18n::Currency2 > getAllCurrencies() const;
 css::uno::Sequence< css::i18n::FormatElement > getAllFormats() const;
 css::i18n::ForbiddenCharacters getForbiddenCharacters() const;
-css::uno::Sequence< css::lang::Locale > getAllInstalledLocaleNames() const;
+const css::uno::Sequence< css::lang::Locale > & 
getAllInstalledLocaleNames() const;
 css::uno::Sequence< OUString > getDateAcceptancePatterns() const;
 
 
 /// same as the wrapper implementation but static
-static css::uno::Sequence< css::lang::Locale > getInstalledLocaleNames();
+static const css::uno::Sequence< css::lang::Locale > & 
getInstalledLocaleNames();
 
 /** Get LanguageTypes for all installed locales which are unambiguous
 convertible back and forth between locale ISO strings and MS-LCID
@@ -171,7 +171,7 @@ public:
 matching, excluding already known problems.
 (e.g. used in number formatter dialog init)
  */
-static std::vector< LanguageType > getInstalledLanguageTypes();
+static const std::vector< LanguageType > & getInstalledLanguageTypes();
 
 /// maps the LocaleData string to the International enum
 MeasurementSystem   mapMeasurementStringToEnum( const OUString& rMS ) 
const;
diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index b6a286a07fc2..1793b8594eeb 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -269,7 +269,7 @@ css::i18n::ForbiddenCharacters 
LocaleDataWrapper::getForbiddenCharacters() const
 return css::i18n::ForbiddenCharacters();
 }
 
-css::uno::Sequence< css::lang::Locale > 
LocaleDataWrapper::getAllInstalledLocaleNames() const
+const css::uno::Sequence< css::lang::Locale > & 
LocaleDataWrapper::getAllInstalledLocaleNames() const
 {
 uno::Sequence< lang::Locale >  = gInstalledLocales;
 
@@ -290,7 +290,7 @@ css::uno::Sequence< css::lang::Locale > 
LocaleDataWrapper::getAllInstalledLocale
 // --- Impl and helpers 
 
 // static
-css::uno::Sequence< css::lang::Locale > 
LocaleDataWrapper::getInstalledLocaleNames()
+const css::uno::Sequence< css::lang::Locale >& 
LocaleDataWrapper::getInstalledLocaleNames()
 {
 const uno::Sequence< lang::Locale >  = gInstalledLocales;
 
@@ -303,7 +303,7 @@ css::uno::Sequence< css::lang::Locale > 
LocaleDataWrapper::getInstalledLocaleNam
 }
 
 // static
-std::vector< LanguageType > LocaleDataWrapper::getInstalledLanguageTypes()
+const std::vector< LanguageType >& 
LocaleDataWrapper::getInstalledLanguageTypes()
 {
 std::vector< LanguageType >  = 
gInstalledLanguageTypes;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-28 Thread Noel Grandin (via logerrit)
 include/unotools/itemholderbase.hxx|2 
 include/unotools/optionsdlg.hxx|   30 +++---
 unotools/source/config/itemholder1.cxx |4 
 unotools/source/config/optionsdlg.cxx  |  151 ++---
 4 files changed, 44 insertions(+), 143 deletions(-)

New commits:
commit 3ed7511eca99819012fc1baa490ef85963a9472e
Author: Noel Grandin 
AuthorDate: Mon Jul 26 15:21:35 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Jul 28 13:13:16 2021 +0200

simplify SvtOptionsDialogOptions

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

diff --git a/include/unotools/itemholderbase.hxx 
b/include/unotools/itemholderbase.hxx
index 5aca7107158a..0445c8fc2498 100644
--- a/include/unotools/itemholderbase.hxx
+++ b/include/unotools/itemholderbase.hxx
@@ -45,8 +45,6 @@ enum class EItem
 MiscOptions   ,
 ModuleOptions ,
 
-OptionsDialogOptions  ,
-
 PathOptions   ,
 
 SysLocaleOptions  ,   // 2
diff --git a/include/unotools/optionsdlg.hxx b/include/unotools/optionsdlg.hxx
index 239740a0e4b3..4e0d78245b65 100644
--- a/include/unotools/optionsdlg.hxx
+++ b/include/unotools/optionsdlg.hxx
@@ -16,26 +16,22 @@
  *   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_UNOTOOLS_OPTIONSDLG_HXX
-#define INCLUDED_UNOTOOLS_OPTIONSDLG_HXX
+#pragma once
 
 #include 
-
-#include 
-
 #include 
-#include 
-
-class SvtOptionsDlgOptions_Impl;
+#include 
+#include 
+#include 
 
-class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtOptionsDialogOptions final : 
public utl::detail::Options
+// Loads the dialog options from config
+class UNOTOOLS_DLLPUBLIC SvtOptionsDialogOptions
 {
-private:
-SvtOptionsDlgOptions_Impl* m_pImp;
-
 public:
-SvtOptionsDialogOptions();
-virtual ~SvtOptionsDialogOptions() override;
+
+typedef std::unordered_map< OUString, bool > OptionNodeList;
+
+SvtOptionsDialogOptions();
 
 boolIsGroupHidden   (   std::u16string_view _rGroup ) const;
 boolIsPageHidden(   std::u16string_view _rPage,
@@ -43,8 +39,10 @@ public:
 boolIsOptionHidden  (   std::u16string_view _rOption,
 std::u16string_view _rPage,
 std::u16string_view _rGroup ) const;
-};
+private:
+bool IsHidden( const OUString& _rPath ) const;
 
-#endif
+OptionNodeList m_aOptionNodeList;
+};
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/itemholder1.cxx 
b/unotools/source/config/itemholder1.cxx
index 8cb01998b063..f56e88cb0b2f 100644
--- a/unotools/source/config/itemholder1.cxx
+++ b/unotools/source/config/itemholder1.cxx
@@ -137,10 +137,6 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
 rItem.pItem.reset( new SvtModuleOptions() );
 break;
 
-case EItem::OptionsDialogOptions :
-rItem.pItem.reset( new SvtOptionsDialogOptions() );
-break;
-
 case EItem::PathOptions :
 rItem.pItem.reset( new SvtPathOptions() );
 break;
diff --git a/unotools/source/config/optionsdlg.cxx 
b/unotools/source/config/optionsdlg.cxx
index 52897278be7c..32e5ee0d2bf7 100644
--- a/unotools/source/config/optionsdlg.cxx
+++ b/unotools/source/config/optionsdlg.cxx
@@ -19,91 +19,44 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 
-#include "itemholder1.hxx"
-
-#include 
-#include 
-
-using namespace utl;
 using namespace com::sun::star::beans;
 using namespace com::sun::star::uno;
 
-#define CFG_FILENAME"Office.OptionsDialog"
-#define ROOT_NODE   "OptionsDialogGroups"
-#define PAGES_NODE  "Pages"
-#define OPTIONS_NODE"Options"
-
-static SvtOptionsDlgOptions_Impl*   pOptions = nullptr;
-static sal_Int32nRefCount = 0;
-
-class SvtOptionsDlgOptions_Impl : public utl::ConfigItem
-{
-private:
-typedef std::unordered_map< OUString, bool > OptionNodeList;
-
-static constexpr OUStringLiteral g_sPathDelimiter = u"/";
-OptionNodeList  m_aOptionNodeList;
+constexpr OUStringLiteral ROOT_NODE = u"OptionsDialogGroups";
+constexpr OUStringLiteral PAGES_NODE = u"Pages";
+constexpr OUStringLiteral OPTIONS_NODE = u"Options";
 
+namespace {
 enum NodeType{ NT_Group, NT_Page, NT_Option };
-voidReadNode( std::u16string_view _rNode, NodeType _eType );
-boolIsHidden( const OUString& _rPath ) const;
-
-virtual voidImplCommit() override;
-
-public:
-SvtOptionsDlgOptions_Impl();
-
-virtual voidNotify( const css::uno::Sequence< OUString >& 
aPropertyNames ) override;
-
-static ::osl::Mutex & 

[Libreoffice-commits] core.git: include/unotools

2021-07-28 Thread Stephan Bergmann (via logerrit)
 include/unotools/ZipPackageHelper.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5a9d7625d215d9f9417a2207327a741618d3de82
Author: Stephan Bergmann 
AuthorDate: Wed Jul 28 09:38:09 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jul 28 10:54:07 2021 +0200

ZipPackageHelper is now used in Library_cui outside Library_merged

...since 6cb3c79b84e396959a982070f6fc4d439a9c396d "Added the feature to 
store
VCL test results as a zip file", see e.g. failed

:

> 61078 
/tinderbox/buildslave/build/workdir/CxxObject/cui/source/dialogs/GraphicTestsDialog.o:
 In function `GraphicsTestsDialog::HandleDownloadRequest(weld::Button&)´:
> 61079 
/tinderbox/buildslave/source/libo-master/cui/source/dialogs/GraphicTestsDialog.cxx:87:
 undefined reference to 
`utl::ZipPackageHelper::ZipPackageHelper(com::sun::star::uno::Reference
 const&, rtl::OUString const&)´
> 61080 
/tinderbox/buildslave/source/libo-master/cui/source/dialogs/GraphicTestsDialog.cxx:88:
 undefined reference to `utl::ZipPackageHelper::getRootFolder()´
> 61081 
/tinderbox/buildslave/source/libo-master/cui/source/dialogs/GraphicTestsDialog.cxx:88:
 undefined reference to 
`utl::ZipPackageHelper::addFolderWithContent(com::sun::star::uno::Reference
 const&, rtl::OUString const&)´
> 61082 
/tinderbox/buildslave/source/libo-master/cui/source/dialogs/GraphicTestsDialog.cxx:89:
 undefined reference to `utl::ZipPackageHelper::savePackage()´
> 61083 NEXTcollect2: error: ld returned 1 exit status
> 61084 NEXTmake[1]: *** 
[/tinderbox/buildslave/source/libo-master/cui/Library_cui.mk:10: 
/tinderbox/buildslave/build/instdir/program/libcuilo.so] Error 1

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

diff --git a/include/unotools/ZipPackageHelper.hxx 
b/include/unotools/ZipPackageHelper.hxx
index f647fed4083a..69eb7205cd8a 100644
--- a/include/unotools/ZipPackageHelper.hxx
+++ b/include/unotools/ZipPackageHelper.hxx
@@ -30,7 +30,7 @@ namespace com::sun::star::uno { class XComponentContext; }
 
 namespace utl {
 
-class UNLESS_MERGELIBS(UNOTOOLS_DLLPUBLIC) ZipPackageHelper
+class UNOTOOLS_DLLPUBLIC ZipPackageHelper
 {
 public:
 ZipPackageHelper( const css::uno::Reference< css::uno::XComponentContext 
>& rxContext,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-27 Thread Noel Grandin (via logerrit)
 include/unotools/itemholderbase.hxx|5 
 include/unotools/viewoptions.hxx   |   56 -
 sfx2/source/appl/app.cxx   |6 
 unotools/source/config/itemholder1.cxx |   16 
 unotools/source/config/viewoptions.cxx |  929 ++---
 5 files changed, 182 insertions(+), 830 deletions(-)

New commits:
commit 48383d59f49d00dc27797d58472c90382c2244f7
Author: Noel Grandin 
AuthorDate: Mon Jul 26 16:01:25 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 27 14:32:52 2021 +0200

simplify SvtViewOptions

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

diff --git a/include/unotools/itemholderbase.hxx 
b/include/unotools/itemholderbase.hxx
index b7a8a7bbc825..0815a4c20c32 100644
--- a/include/unotools/itemholderbase.hxx
+++ b/include/unotools/itemholderbase.hxx
@@ -53,11 +53,6 @@ enum class EItem
 SysLocaleOptions  ,   // 2
 
 UserOptions   ,   // 2
-
-ViewOptionsDialog ,
-ViewOptionsTabDialog  ,
-ViewOptionsTabPage,
-ViewOptionsWindow
 };
 
 struct TItemInfo
diff --git a/include/unotools/viewoptions.hxx b/include/unotools/viewoptions.hxx
index c4e6a38e5e79..46f3ea326860 100644
--- a/include/unotools/viewoptions.hxx
+++ b/include/unotools/viewoptions.hxx
@@ -26,9 +26,7 @@
 #include 
 
 namespace com::sun::star::beans { struct NamedValue; }
-namespace osl { class Mutex; }
-
-class SvtViewOptionsBase_Impl;
+namespace com::sun::star::container { class XNameAccess; }
 
 
/*-
 @descr  Use these enum values to specify right list in 
configuration in which your view data are saved.
@@ -94,7 +92,7 @@ enum class EViewType
 @devstatus  ready to use
 
*//*-*/
 
-class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions final : public 
utl::detail::Options
+class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions final
 {
 
 //  public methods
@@ -118,15 +116,6 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions 
final : public utl::deta
 
  SvtViewOptions(   EViewTypeeType ,
  const OUString& sViewName );
-virtual ~SvtViewOptions() override;
-
-
/*-
-@short  support preload of these config item
-@descr  Sometimes we need preloading of these configuration 
data without real using of it.
-
*//*-*/
-
-static void AcquireOptions();
-static void ReleaseOptions();
 
 //  interface
 
@@ -174,7 +163,7 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions 
final : public utl::deta
 
*//*-*/
 
 OString GetPageID() const;
-void  SetPageID(const OString& rID);
+void  SetPageID(std::string_view rID);
 
 
/*-
 @short  use it to set/get the visual state of a window
@@ -214,46 +203,21 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions 
final : public utl::deta
 void  SetUserItem( const OUString&sName  ,
const css::uno::Any& aValue );
 
-//  private methods
-
 private:
+enum State { STATE_NONE, STATE_FALSE, STATE_TRUE };
 
-
/*-
-@short  return a reference to a static mutex
-@descr  These class is threadsafe.
-We create a static mutex only for one time and use it 
to protect our refcount and container
-member!
-@return A reference to a static mutex member.
-
*//*-*/
-
-UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
-
-//  private member
-
-private:
+css::uno::Reference< css::uno::XInterface > impl_getSetNode( const 
OUString& sNode   ,
+   
bool bCreateIfMissing) const;
+State GetVisible() const;
 
 /// specify which list of views in configuration is used! This can't 
be a static value!!!
 /// ... because we 

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

2021-07-26 Thread Noel Grandin (via logerrit)
 include/unotools/compatibility.hxx   |3 +
 sw/source/ui/config/optcomp.cxx  |   53 ---
 unotools/source/config/compatibility.cxx |   26 ++-
 3 files changed, 27 insertions(+), 55 deletions(-)

New commits:
commit 78adf246d5e99d0f5d91d2e03c1379b154289d8d
Author: Noel Grandin 
AuthorDate: Mon Jul 26 10:54:36 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 26 20:50:16 2021 +0200

return SvtCompatibilityEntry from SvtCompatibilityOptions::GetList

instead of converting back and forth

Change-Id: Iec913494ccad65ebff76bf7b6cf5b2440fbade42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119514
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index ba8de4e784b5..85c6c2484a31 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::beans { struct PropertyValue; }
 namespace osl { class Mutex; }
@@ -211,7 +212,7 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions final : 
public utl::detail::Opt
 
 @onerrorWe return an empty list.
 
*//*-*/
-css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > 
GetList() const;
+std::vector< SvtCompatibilityEntry > GetList() const;
 
 private:
 std::shared_ptr m_pImpl;
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index bea377047ae9..071b2fa1c76c 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -206,27 +206,16 @@ void SwCompatibilityOptPage::InitControls( const 
SfxItemSet& rSet )
 m_xMain->set_label(rText.replaceAll("%DOCNAME", sDocTitle));
 
 // loading file formats
-const Sequence< Sequence< PropertyValue > > aList = 
m_aConfigItem.GetList();
+const std::vector< SvtCompatibilityEntry > aList = m_aConfigItem.GetList();
 
-SvtCompatibilityEntry aEntry;
-
-for ( const Sequence< PropertyValue >& rEntry : aList )
+for ( const SvtCompatibilityEntry& rEntry : aList )
 {
-for ( const PropertyValue& aValue : rEntry )
-{
-aEntry.setValue( SvtCompatibilityEntry::getIndex(aValue.Name), 
aValue.Value );
-}
-
-const OUString sEntryName = aEntry.getValue( 
SvtCompatibilityEntry::Index::Name );
-
+const OUString sEntryName = rEntry.getValue( 
SvtCompatibilityEntry::Index::Name );
 const bool bIsUserEntry= ( sEntryName == 
SvtCompatibilityEntry::USER_ENTRY_NAME );
-const bool bIsDefaultEntry = ( sEntryName == 
SvtCompatibilityEntry::DEFAULT_ENTRY_NAME );
-
-aEntry.setDefaultEntry( bIsDefaultEntry );
 
-m_pImpl->m_aList.push_back( aEntry );
+m_pImpl->m_aList.push_back( rEntry );
 
-if ( aEntry.isDefaultEntry() )
+if ( rEntry.isDefaultEntry() )
 continue;
 
 OUString sNewEntry;
@@ -245,22 +234,22 @@ void SwCompatibilityOptPage::InitControls( const 
SfxItemSet& rSet )
 sNewEntry = sEntryName;
 
 sal_uInt32 nOptions = convertBools2Ulong_Impl(
-aEntry.getValue( SvtCompatibilityEntry::Index::UsePrtMetrics 
),
-aEntry.getValue( SvtCompatibilityEntry::Index::AddSpacing ),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::AddSpacingAtPages ),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::UseOurTabStops ),
-aEntry.getValue( SvtCompatibilityEntry::Index::NoExtLeading 
),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::UseLineSpacing ),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::AddTableSpacing ),
-
aEntry.getValue(SvtCompatibilityEntry::Index::AddTableLineSpacing),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::UseObjectPositioning ),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::UseOurTextWrapping ),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::ConsiderWrappingStyle ),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::ExpandWordSpace ),
-aEntry.getValue( SvtCompatibilityEntry::Index::ProtectForm ),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::MsWordTrailingBlanks ),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::SubtractFlysAnchoredAtFlys ),
-aEntry.getValue( 
SvtCompatibilityEntry::Index::EmptyDbFieldHidesPara ) );
+rEntry.getValue( SvtCompatibilityEntry::Index::UsePrtMetrics 
),
+rEntry.getValue( SvtCompatibilityEntry::Index::AddSpacing ),
+rEntry.getValue( 
SvtCompatibilityEntry::Index::AddSpacingAtPages ),
+rEntry.getValue( 
SvtCompatibilityEntry::Index::UseOurTabStops ),
+rEntry.getValue( 

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

2021-07-26 Thread Noel Grandin (via logerrit)
 include/unotools/compatibility.hxx   |   11 ++-
 sw/source/ui/config/optcomp.cxx  |4 ++--
 unotools/source/config/compatibility.cxx |4 ++--
 3 files changed, 6 insertions(+), 13 deletions(-)

New commits:
commit d14ab85a4446279e24aa6b6d5e8bfedb48ccdfe1
Author: Noel Grandin 
AuthorDate: Mon Jul 26 10:44:16 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jul 26 20:49:25 2021 +0200

convert these into constants

Change-Id: Ie3e3b497cfeb8c9e9456fb86a04f409658116e1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119513
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index 3c025224ea1b..ba8de4e784b5 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -75,15 +75,8 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityEntry
 
 static OUString getName( const Index rIdx );
 
-static OUString getUserEntryName()
-{
-return "_user";
-}
-
-static OUString getDefaultEntryName()
-{
-return "_default";
-}
+static constexpr OUStringLiteral USER_ENTRY_NAME = u"_user";
+static constexpr OUStringLiteral DEFAULT_ENTRY_NAME = u"_default";
 
 static Index getIndex( std::u16string_view rName )
 {
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 8a57f054abca..bea377047ae9 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -219,8 +219,8 @@ void SwCompatibilityOptPage::InitControls( const 
SfxItemSet& rSet )
 
 const OUString sEntryName = aEntry.getValue( 
SvtCompatibilityEntry::Index::Name );
 
-const bool bIsUserEntry= ( sEntryName == 
SvtCompatibilityEntry::getUserEntryName() );
-const bool bIsDefaultEntry = ( sEntryName == 
SvtCompatibilityEntry::getDefaultEntryName() );
+const bool bIsUserEntry= ( sEntryName == 
SvtCompatibilityEntry::USER_ENTRY_NAME );
+const bool bIsDefaultEntry = ( sEntryName == 
SvtCompatibilityEntry::DEFAULT_ENTRY_NAME );
 
 aEntry.setDefaultEntry( bIsDefaultEntry );
 
diff --git a/unotools/source/config/compatibility.cxx 
b/unotools/source/config/compatibility.cxx
index 5556a0a231d4..c3ac4b6c532a 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -186,7 +186,7 @@ 
SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl() : ConfigItem( ROOTN
 
 m_aOptions.push_back( aItem );
 
-if ( !bDefaultFound && aItem.getValue( 
SvtCompatibilityEntry::Index::Name ) == 
SvtCompatibilityEntry::getDefaultEntryName() )
+if ( !bDefaultFound && aItem.getValue( 
SvtCompatibilityEntry::Index::Name ) == 
SvtCompatibilityEntry::DEFAULT_ENTRY_NAME )
 {
 SvtSysLocale aSysLocale;
 css::lang::Locale aLocale = 
aSysLocale.GetLanguageTag().getLocale();
@@ -209,7 +209,7 @@ void SvtCompatibilityOptions_Impl::AppendItem( const 
SvtCompatibilityEntry& aIte
 m_aOptions.push_back( aItem );
 
 // default item reset?
-if ( aItem.getValue( SvtCompatibilityEntry::Index::Name ) == 
SvtCompatibilityEntry::getDefaultEntryName() )
+if ( aItem.getValue( SvtCompatibilityEntry::Index::Name ) == 
SvtCompatibilityEntry::DEFAULT_ENTRY_NAME )
 m_aDefOptions = aItem;
 
 SetModified();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-24 Thread Noel Grandin (via logerrit)
 include/unotools/saveopt.hxx   |4 ---
 sfx2/source/appl/appcfg.cxx|9 --
 unotools/source/config/saveopt.cxx |   48 ++---
 3 files changed, 9 insertions(+), 52 deletions(-)

New commits:
commit d904a21d5516ce2786f634d0bcc555c4b345e95d
Author: Noel Grandin 
AuthorDate: Fri Jul 23 19:32:25 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 24 22:09:52 2021 +0200

use officecfg to retrieve AutoSavePrompt

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

diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index b268d8397d59..d50b8115885c 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -35,7 +35,6 @@ public:
 UseUserData,
 Backup,
 AutoSave,
-AutoSavePrompt,
 WarnAlienFormat,
 LoadDocPrinter,
 OdfDefaultVersion,
@@ -97,9 +96,6 @@ public:
 voidSetAutoSave( bool b );
 boolIsAutoSave() const;
 
-voidSetAutoSavePrompt( bool b );
-boolIsAutoSavePrompt() const;
-
 voidSetUserAutoSave( bool b );
 boolIsUserAutoSave() const;
 
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 00742402585c..fc4280e8df4b 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -168,8 +168,9 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
 case SID_ATTR_AUTOSAVEPROMPT :
 {
 bRet = true;
-if 
(!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::AutoSavePrompt))
-if (!rSet.Put( SfxBoolItem( rPool.GetWhich( 
SID_ATTR_AUTOSAVEPROMPT ), aSaveOptions.IsAutoSavePrompt(
+if 
(!officecfg::Office::Common::Save::Document::AutoSavePrompt::isReadOnly())
+if (!rSet.Put( SfxBoolItem( rPool.GetWhich( 
SID_ATTR_AUTOSAVEPROMPT ),
+
officecfg::Office::Common::Save::Document::AutoSavePrompt::get(
 bRet = false;
 }
 break;
@@ -461,7 +462,9 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& 
rSet )
 if ( SfxItemState::SET == 
rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), true, ))
 {
 DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) !=  nullptr, 
"BoolItem expected");
-aSaveOptions.SetAutoSavePrompt(static_cast(pItem)->GetValue());
+officecfg::Office::Common::Save::Document::AutoSavePrompt::set(
+static_cast(pItem)->GetValue(),
+batch);
 }
 
 // AutoSave-Time
diff --git a/unotools/source/config/saveopt.cxx 
b/unotools/source/config/saveopt.cxx
index 1d3f7253952a..5bb82488695a 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -62,7 +62,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
 boolbUseUserData,
 bBackup,
 bAutoSave,
-bAutoSavePrompt,
 bUserAutoSave,
 bWarnAlienFormat,
 bLoadDocPrinter;
@@ -73,7 +72,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
 bROUseUserData,
 bROBackup,
 bROAutoSave,
-bROAutoSavePrompt,
 bROUserAutoSave,
 bROWarnAlienFormat,
 bROLoadDocPrinter,
@@ -90,7 +88,6 @@ public:
 boolIsUseUserData() const   { return 
bUseUserData; }
 boolIsBackup() const{ return 
bBackup; }
 boolIsAutoSave() const  { return 
bAutoSave; }
-boolIsAutoSavePrompt() const{ return 
bAutoSavePrompt; }
 boolIsUserAutoSave() const  { return 
bUserAutoSave; }
 boolIsWarnAlienFormat() const   { return 
bWarnAlienFormat; }
 boolIsLoadDocPrinter() const{ return 
bLoadDocPrinter; }
@@ -102,7 +99,6 @@ public:
 voidSetUseUserData( bool b );
 voidSetBackup( bool b );
 voidSetAutoSave( bool b );
-voidSetAutoSavePrompt( bool b );
 voidSetUserAutoSave( bool b );
 

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

2021-07-24 Thread Noel Grandin (via logerrit)
 include/unotools/saveopt.hxx   |4 ---
 sfx2/source/appl/appcfg.cxx|9 +--
 unotools/source/config/saveopt.cxx |   44 -
 3 files changed, 7 insertions(+), 50 deletions(-)

New commits:
commit 8690061b7d2d7c50ba96b40af4c4549fd9378b80
Author: Noel Grandin 
AuthorDate: Fri Jul 23 16:06:24 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 24 19:32:09 2021 +0200

use officecfg to retrieve SaveWorkingSet

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

diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 1420269f2fbf..4a7c21cac08a 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -37,7 +37,6 @@ public:
 AutoSave,
 AutoSavePrompt,
 DocInfSave,
-SaveWorkingSet,
 WarnAlienFormat,
 LoadDocPrinter,
 OdfDefaultVersion,
@@ -108,9 +107,6 @@ public:
 voidSetDocInfoSave(bool b);
 boolIsDocInfoSave() const;
 
-voidSetSaveWorkingSet( bool b );
-boolIsSaveWorkingSet() const;
-
 voidSetLoadUserSettings(bool b);
 boolIsLoadUserSettings() const;
 
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index ae9b8c7a86fc..68faf7d0e75f 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -200,8 +200,9 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
 case SID_ATTR_WORKINGSET :
 {
 bRet = true;
-if 
(!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::SaveWorkingSet))
-if (!rSet.Put( SfxBoolItem( rPool.GetWhich( 
SID_ATTR_WORKINGSET ), aSaveOptions.IsSaveWorkingSet(
+if 
(!officecfg::Office::Common::Save::WorkingSet::isReadOnly())
+if (!rSet.Put( SfxBoolItem( rPool.GetWhich( 
SID_ATTR_WORKINGSET ),
+
officecfg::Office::Common::Save::WorkingSet::get(
 bRet = false;
 }
 break;
@@ -487,7 +488,9 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& 
rSet )
 if ( SfxItemState::SET == 
rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), true, ))
 {
 DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) !=  nullptr, 
"BoolItem expected");
-aSaveOptions.SetSaveWorkingSet(static_cast(pItem)->GetValue());
+officecfg::Office::Common::Save::WorkingSet::set(
+static_cast(pItem)->GetValue(),
+batch);
 }
 
 // Save window settings
diff --git a/unotools/source/config/saveopt.cxx 
b/unotools/source/config/saveopt.cxx
index 5fac07ddc4e1..55979f50e982 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -65,7 +65,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
 bAutoSavePrompt,
 bUserAutoSave,
 bDocInfSave,
-bSaveWorkingSet,
 bWarnAlienFormat,
 bLoadDocPrinter;
 
@@ -78,7 +77,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
 bROAutoSavePrompt,
 bROUserAutoSave,
 bRODocInfSave,
-bROSaveWorkingSet,
 bROWarnAlienFormat,
 bROLoadDocPrinter,
 bROODFDefaultVersion;
@@ -97,7 +95,6 @@ public:
 boolIsAutoSavePrompt() const{ return 
bAutoSavePrompt; }
 boolIsUserAutoSave() const  { return 
bUserAutoSave; }
 boolIsDocInfoSave() const   { return 
bDocInfSave; }
-boolIsSaveWorkingSet() const{ return 
bSaveWorkingSet; }
 boolIsWarnAlienFormat() const   { return 
bWarnAlienFormat; }
 boolIsLoadDocPrinter() const{ return 
bLoadDocPrinter; }
 
@@ -111,7 +108,6 @@ public:
 voidSetAutoSavePrompt( bool b );
 voidSetUserAutoSave( bool b );
 voidSetDocInfoSave( bool b );
-voidSetSaveWorkingSet( bool b );
 voidSetWarnAlienFormat( bool _bDoPP );
 voidSetLoadDocPrinter( bool bNew );
 void

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

2021-07-23 Thread Noel Grandin (via logerrit)
 include/unotools/saveopt.hxx   |4 --
 sfx2/source/appl/appcfg.cxx|6 +--
 unotools/source/config/saveopt.cxx |   56 -
 3 files changed, 10 insertions(+), 56 deletions(-)

New commits:
commit 04389e2e5563ae5d771a78e439dfe7ccdcd8b904
Author: Noel Grandin 
AuthorDate: Fri Jul 23 13:59:23 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 23 22:19:09 2021 +0200

use officecfg to retrieve SaveDocView

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

diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 0e16b683e914..e8b6aed4e448 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -38,7 +38,6 @@ public:
 AutoSavePrompt,
 DocInfSave,
 SaveWorkingSet,
-SaveDocView,
 SaveRelInet,
 SaveRelFsys,
 DoPrettyPrinting,
@@ -115,9 +114,6 @@ public:
 voidSetSaveWorkingSet( bool b );
 boolIsSaveWorkingSet() const;
 
-voidSetSaveDocView( bool b );
-boolIsSaveDocView() const;
-
 voidSetSaveRelINet( bool b );
 boolIsSaveRelINet() const;
 
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 2aa0a8e22047..01820c08adb7 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -207,8 +207,8 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
 case SID_ATTR_SAVEDOCVIEW :
 {
 bRet = true;
-if 
(!aSaveOptions.IsReadOnly(SvtSaveOptions::EOption::SaveDocView))
-if (!rSet.Put( SfxBoolItem( rPool.GetWhich( 
SID_ATTR_SAVEDOCVIEW ), aSaveOptions.IsSaveDocView(
+if 
(!officecfg::Office::Common::Save::Document::ViewInfo::isReadOnly())
+if (!rSet.Put( SfxBoolItem( rPool.GetWhich( 
SID_ATTR_SAVEDOCVIEW ), 
officecfg::Office::Common::Save::Document::ViewInfo::get(
 bRet = false;
 }
 break;
@@ -489,7 +489,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& 
rSet )
 if ( SfxItemState::SET == 
rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), true, ))
 {
 DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) !=  nullptr, 
"BoolItem expected");
-aSaveOptions.SetSaveDocView(static_cast(pItem)->GetValue());
+
officecfg::Office::Common::Save::Document::ViewInfo::set(static_cast(pItem)->GetValue(), batch);
 }
 
 // Metric
diff --git a/unotools/source/config/saveopt.cxx 
b/unotools/source/config/saveopt.cxx
index 58040c2eafae..76c7e34f3673 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -66,7 +66,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
 bUserAutoSave,
 bDocInfSave,
 bSaveWorkingSet,
-bSaveDocView,
 bSaveRelINet,
 bSaveRelFSys,
 bDoPrettyPrinting,
@@ -83,7 +82,6 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
 bROUserAutoSave,
 bRODocInfSave,
 bROSaveWorkingSet,
-bROSaveDocView,
 bROSaveRelINet,
 bROSaveRelFSys,
 bROWarnAlienFormat,
@@ -106,7 +104,6 @@ public:
 boolIsUserAutoSave() const  { return 
bUserAutoSave; }
 boolIsDocInfoSave() const   { return 
bDocInfSave; }
 boolIsSaveWorkingSet() const{ return 
bSaveWorkingSet; }
-boolIsSaveDocView() const   { return 
bSaveDocView; }
 boolIsSaveRelINet() const   { return 
bSaveRelINet; }
 boolIsSaveRelFSys() const   { return 
bSaveRelFSys; }
 boolIsPrettyPrintingEnabled( ) const{ return 
bDoPrettyPrinting; }
@@ -124,7 +121,6 @@ public:
 voidSetUserAutoSave( bool b );
 voidSetDocInfoSave( bool b );
 voidSetSaveWorkingSet( bool b );
-voidSetSaveDocView( bool b );
 voidSetSaveRelINet( bool b );
 voidSetSaveRelFSys( bool b );
 void   

[Libreoffice-commits] core.git: include/unotools

2021-07-11 Thread Mike Kaganski (via logerrit)
 include/unotools/textsearch.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 797b921afa056d5631ed772a110c5a3e53741bfc
Author: Mike Kaganski 
AuthorDate: Sun Jul 11 13:48:12 2021 +0200
Commit: Mike Kaganski 
CommitDate: Sun Jul 11 14:57:44 2021 +0200

Fix a comment copy-paste error

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

diff --git a/include/unotools/textsearch.hxx b/include/unotools/textsearch.hxx
index 849f4c8c91f5..140200fec83f 100644
--- a/include/unotools/textsearch.hxx
+++ b/include/unotools/textsearch.hxx
@@ -178,7 +178,7 @@ public:
 
 RETURN values   ==  true: something is found
 - pStart start pos of the found text,
-- pStart end pos of the found text,
+- pEnd end pos of the found text,
 - pSrchResult - the search result with all found
  positions. Is only filled with more positions
  if the regular expression handles groups.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-06 Thread Eike Rathke (via logerrit)
 include/unotools/localedatawrapper.hxx |   14 ++--
 svl/source/numbers/zforfind.cxx|2 -
 unotools/source/i18n/localedatawrapper.cxx |   48 ++---
 vcl/source/control/field2.cxx  |   23 +
 4 files changed, 64 insertions(+), 23 deletions(-)

New commits:
commit 5e3bfdeb5ea4878a2546a7e1e16d0f3b6482024e
Author: Eike Rathke 
AuthorDate: Tue Jul 6 14:05:58 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Jul 6 17:54:07 2021 +0200

Related: tdf#125035 Introduce LongDateOrder and handle YDM in DateFormatter

This fixes also

unotools/source/i18n/localedatawrapper.cxx:1473: 
LocaleDataWrapper::scanDateOrder: no magic applicable
lv-LV requested
lv-LV loaded

that is the only locale with a YDM long date order.

Change-Id: I776b8706bf5bd3ec11cc46d38fd3613c8df7519f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118482
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/include/unotools/localedatawrapper.hxx 
b/include/unotools/localedatawrapper.hxx
index 70108f8af86a..0a0832b64a13 100644
--- a/include/unotools/localedatawrapper.hxx
+++ b/include/unotools/localedatawrapper.hxx
@@ -52,6 +52,14 @@ enum class DateOrder {
 YMD,
 };
 
+enum class LongDateOrder {
+Invalid = -1,
+MDY = 0,
+DMY,
+YMD,
+YDM
+};
+
 enum class MeasurementSystem {
 Metric,
 US
@@ -80,7 +88,7 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
 OUStringaCurrSymbol;
 OUStringaCurrBankSymbol;
 DateOrder   nDateOrder;
-DateOrder   nLongDateOrder;
+LongDateOrder   nLongDateOrder;
 sal_uInt16  nCurrPositiveFormat;
 sal_uInt16  nCurrNegativeFormat;
 sal_uInt16  nCurrDigits;
@@ -100,7 +108,7 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
 sal_Int32& nBlank, sal_Int32& nSym ) const;
 
 voidloadDateOrders();
-DateOrder   scanDateOrderImpl( const OUString& rCode ) const;
+LongDateOrder   scanDateOrderImpl( const OUString& rCode ) const;
 
 voidImplAddFormatNum( rtl::OUStringBuffer& rBuf,
 sal_Int64 nNumber, sal_uInt16 nDecimals,
@@ -299,7 +307,7 @@ public:
 
 // simple date and time formatting
 DateOrder  getDateOrder() const;
-DateOrder  getLongDateOrder() const;
+LongDateOrder  getLongDateOrder() const;
 /// only numerical values of Gregorian calendar
 OUString   getDate( const Date& rDate ) const;
 OUString   getTime( const tools::Time& rTime, bool bSec = true,
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 4f5fd03ce6be..8b01debbb1d4 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -2728,7 +2728,7 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& 
rString, sal_uInt16 nS
 switch (eScannedType)
 {
 case SvNumFormatType::DATE:
-if (nMonthPos == 1 && pLoc->getLongDateOrder() == DateOrder::MDY)
+if (nMonthPos == 1 && pLoc->getLongDateOrder() == 
LongDateOrder::MDY)
 {
 // #68232# recognize long date separators like ", " in 
"September 5, 1999"
 if (SkipString( pLoc->getLongDateDaySep(), rString, nPos ))
diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index 9765cec1062a..fb70c0657a73 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -691,12 +691,12 @@ DateOrder LocaleDataWrapper::getDateOrder() const
 return nDateOrder;
 }
 
-DateOrder LocaleDataWrapper::getLongDateOrder() const
+LongDateOrder LocaleDataWrapper::getLongDateOrder() const
 {
 return nLongDateOrder;
 }
 
-DateOrder LocaleDataWrapper::scanDateOrderImpl( const OUString& rCode ) const
+LongDateOrder LocaleDataWrapper::scanDateOrderImpl( const OUString& rCode ) 
const
 {
 // Only some european versions were translated, the ones with different
 // keyword combinations are:
@@ -760,18 +760,40 @@ DateOrder LocaleDataWrapper::scanDateOrderImpl( const 
OUString& rCode ) const
 }
 // compare with <= because each position may equal rCode.getLength()
 if ( nDay <= nMonth && nMonth <= nYear )
-return DateOrder::DMY; // also if every position equals 
rCode.getLength()
+return LongDateOrder::DMY; // also if every position equals 
rCode.getLength()
 else if ( nMonth <= nDay && nDay <= nYear )
-return DateOrder::MDY;
+return LongDateOrder::MDY;
 else if ( nYear <= nMonth && nMonth <= nDay )
-return DateOrder::YMD;
+return LongDateOrder::YMD;
+else if ( nYear <= nDay && nDay <= nMonth )
+return LongDateOrder::YDM;
 else
 {
 if 

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

2021-07-06 Thread Eike Rathke (via logerrit)
 include/unotools/localedatawrapper.hxx |   11 ---
 unotools/source/i18n/localedatawrapper.cxx |   40 -
 2 files changed, 51 deletions(-)

New commits:
commit 6e0b7d2aad6f1a041dd9e0e28aa4bf27eb3fc077
Author: Eike Rathke 
AuthorDate: Tue Jul 6 12:25:05 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Jul 6 14:25:49 2021 +0200

Remove now unused LocaleDataWrapper::getLongDate()

Change-Id: I8e9614a4d77aa8b0c0e68a248ea57f921e3ed424
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118476
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/include/unotools/localedatawrapper.hxx 
b/include/unotools/localedatawrapper.hxx
index 1ec554a38b90..70108f8af86a 100644
--- a/include/unotools/localedatawrapper.hxx
+++ b/include/unotools/localedatawrapper.hxx
@@ -307,17 +307,6 @@ public:
 OUString   getDuration( const tools::Time& rTime,
 bool bSec = true, bool b100Sec = false ) const;
 
-/** The CalendarWrapper already MUST
-have loaded a calendar.
-@param bTwoDigitYear
- := full year
-  := year % 100
- */
-OUString   getLongDate( const Date& rDate,
-CalendarWrapper& rCal,
-bool bTwoDigitYear
-) const;
-
 /** Simple number formatting
 @param nNumber
 value * 10**nDecimals
diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index 2bb6769c51ed..9765cec1062a 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -1160,46 +1160,6 @@ OUString LocaleDataWrapper::getTime( const tools::Time& 
rTime, bool bSec, bool b
 return aBuf.makeStringAndClear();
 }
 
-OUString LocaleDataWrapper::getLongDate( const Date& rDate, CalendarWrapper& 
rCal,
-bool bTwoDigitYear ) const
-{
-OUStringBuffer aBuf(20);
-OUStringBuffer aStr(120); // complete guess
-sal_Int16 nVal;
-rCal.setGregorianDateTime( rDate );
-// day of week
-nVal = rCal.getValue( CalendarFieldIndex::DAY_OF_WEEK );
-aStr.append(rCal.getDisplayName( CalendarDisplayIndex::DAY, nVal, 1 ));
-aStr.append(aLocaleDataItem.LongDateDayOfWeekSeparator);
-// day of month
-nVal = rCal.getValue( CalendarFieldIndex::DAY_OF_MONTH );
-ImplAdd2UNum( aBuf, nVal, false/*bDayOfMonthWithLeadingZero*/ );
-OUString aDay = aBuf.makeStringAndClear();
-// month of year
-nVal = rCal.getValue( CalendarFieldIndex::MONTH );
-OUString aMonth( rCal.getDisplayName( CalendarDisplayIndex::MONTH, nVal, 1 
) );
-// year
-nVal = rCal.getValue( CalendarFieldIndex::YEAR );
-if ( bTwoDigitYear )
-ImplAddUNum( aBuf, nVal % 100, 2 );
-else
-ImplAddUNum( aBuf, nVal );
-OUString aYear = aBuf.makeStringAndClear();
-// concatenate
-switch ( getLongDateOrder() )
-{
-case DateOrder::DMY :
-aStr.append(aDay + aLocaleDataItem.LongDateDaySeparator + aMonth + 
aLocaleDataItem.LongDateMonthSeparator + aYear);
-break;
-case DateOrder::MDY :
-aStr.append(aMonth + aLocaleDataItem.LongDateMonthSeparator + aDay 
+ aLocaleDataItem.LongDateDaySeparator + aYear);
-break;
-default:// YMD
-aStr.append(aYear + aLocaleDataItem.LongDateYearSeparator + aMonth 
+ aLocaleDataItem.LongDateMonthSeparator + aDay);
-}
-return aStr.makeStringAndClear();
-}
-
 OUString LocaleDataWrapper::getDuration( const tools::Time& rTime, bool bSec, 
bool b100Sec ) const
 {
 OUStringBuffer aBuf(128);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-02 Thread Noel Grandin (via logerrit)
 include/unotools/fontcfg.hxx   |3 +--
 unotools/source/config/fontcfg.cxx |4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 211a63a780659b404541cae619d10f204a8bfe65
Author: Noel Grandin 
AuthorDate: Sun May 2 12:45:42 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun May 2 18:00:02 2021 +0200

sal_uLong->sal_uInt32 in ImplFontAttrs

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

diff --git a/include/unotools/fontcfg.hxx b/include/unotools/fontcfg.hxx
index bf457e02ba13..99520e39528b 100644
--- a/include/unotools/fontcfg.hxx
+++ b/include/unotools/fontcfg.hxx
@@ -21,7 +21,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -46,7 +45,7 @@ enum class DefaultFontType;
 // Note that the bit flags must match the entries in the pAttribNames array in
 // unotools/source/config/fontcfg.cxx.
 
-enum class ImplFontAttrs : sal_uLong
+enum class ImplFontAttrs : sal_uInt32
 {
 None  = 0x,
 Default   = 0x0001, ///< Default-Font like Andale Sans UI, Palace 
Script, Albany, Thorndale, Cumberland, ...
diff --git a/unotools/source/config/fontcfg.cxx 
b/unotools/source/config/fontcfg.cxx
index d94a7bfdc661..7f6d68e8a40f 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -939,7 +939,7 @@ FontWidth FontSubstConfiguration::getSubstWidth( const 
css::uno::Reference< XNam
 ImplFontAttrs FontSubstConfiguration::getSubstType( const css::uno::Reference< 
XNameAccess >& rFont,
 const OUString& rType ) 
const
 {
-sal_uLong type = 0;
+sal_uInt32 type = 0;
 try
 {
 Any aAny = rFont->getByName( rType );
@@ -955,7 +955,7 @@ ImplFontAttrs FontSubstConfiguration::getSubstType( const 
css::uno::Reference< X
 for( int k = 0; k < 32; k++ )
 if( aToken.equalsIgnoreAsciiCaseAscii( pAttribNames[k] ) )
 {
-type |= sal_uLong(1) << k;
+type |= sal_uInt32(1) << k;
 break;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/unotools sc/inc sc/source

2021-02-21 Thread Noel (via logerrit)
 include/unotools/weakref.hxx |  132 +++
 sc/inc/cellsuno.hxx  |4 
 sc/source/core/data/dpobject.cxx |3 
 sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx   |   15 -
 sc/source/filter/xml/XMLChangeTrackingExportHelper.hxx   |4 
 sc/source/filter/xml/xmlexprt.cxx|8 
 sc/source/ui/Accessibility/AccessibleCell.cxx|8 
 sc/source/ui/Accessibility/AccessibleCsvControl.cxx  |   14 -
 sc/source/ui/Accessibility/AccessibleDocument.cxx|   15 -
 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx |2 
 sc/source/ui/Accessibility/AccessibleEditObject.cxx  |7 
 sc/source/ui/Accessibility/AccessiblePageHeader.cxx  |2 
 sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx  |2 
 sc/source/ui/Accessibility/AccessiblePreviewCell.cxx |2 
 sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx   |2 
 sc/source/ui/Accessibility/AccessiblePreviewTable.cxx|2 
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |   10 
 sc/source/ui/app/drwtrans.cxx|2 
 sc/source/ui/app/inputwin.cxx|1 
 sc/source/ui/app/seltrans.cxx|4 
 sc/source/ui/drawfunc/fuins2.cxx |5 
 sc/source/ui/inc/AccessibleCsvControl.hxx|2 
 sc/source/ui/inc/AccessibleDocument.hxx  |4 
 sc/source/ui/inc/inputwin.hxx|2 
 sc/source/ui/inc/seltrans.hxx|2 
 sc/source/ui/inc/tphfedit.hxx|4 
 sc/source/ui/inc/viewfunc.hxx|2 
 sc/source/ui/pagedlg/tphfedit.cxx|   39 +--
 sc/source/ui/unoobj/cellsuno.cxx |   17 -
 sc/source/ui/unoobj/chart2uno.cxx|2 
 sc/source/ui/unoobj/docuno.cxx   |9 
 sc/source/ui/unoobj/fmtuno.cxx   |2 
 sc/source/ui/unoobj/shapeuno.cxx |7 
 sc/source/ui/unoobj/textuno.cxx  |   30 +-
 sc/source/ui/unoobj/viewuno.cxx  |   10 
 sc/source/ui/vba/vbaworkbooks.cxx|4 
 sc/source/ui/view/drawvie4.cxx   |5 
 sc/source/ui/view/gridwin5.cxx   |2 
 sc/source/ui/view/hintwin.cxx|   11 
 sc/source/ui/view/preview.cxx|2 
 sc/source/ui/view/viewfun3.cxx   |5 
 41 files changed, 247 insertions(+), 158 deletions(-)

New commits:
commit 78040af9acea0ab681aa54ff23844b647bc9b4f3
Author: Noel 
AuthorDate: Sun Feb 21 12:33:10 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 21 16:13:31 2021 +0100

loplugin:refcounting in sc

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

diff --git a/include/unotools/weakref.hxx b/include/unotools/weakref.hxx
new file mode 100644
index ..7fdf5acba698
--- /dev/null
+++ b/include/unotools/weakref.hxx
@@ -0,0 +1,132 @@
+/* -*- 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 .
+ */
+
+/*
+ * This file is part of LibreOffice published API.
+ */
+#pragma once
+
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+namespace cppu
+{
+class OWeakObject;
+}
+
+namespace unotools
+{
+/** The WeakReference<> holds a weak reference to an object.
+
+That object must implement the css::uno::XWeak interface.
+
+The WeakReference itself is *not* thread safe, just as
+Reference itself isn't, but the implementation of the listeners etc.
+behind it *is* thread-safe, so multiple threads can 

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

2021-01-29 Thread Mike Kaganski (via logerrit)
 include/unotools/moduleoptions.hxx   |3 ---
 unotools/source/config/moduleoptions.cxx |   23 ++-
 2 files changed, 6 insertions(+), 20 deletions(-)

New commits:
commit 497452595bccf939e1a7e6b54b964e34504e5075
Author: Mike Kaganski 
AuthorDate: Fri Jan 29 07:11:38 2021 +0100
Commit: Mike Kaganski 
CommitDate: Fri Jan 29 12:55:08 2021 +0100

Replace rtl::Static with function-local static here

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

diff --git a/include/unotools/moduleoptions.hxx 
b/include/unotools/moduleoptions.hxx
index 3293560c3733..1324e4d06e18 100644
--- a/include/unotools/moduleoptions.hxx
+++ b/include/unotools/moduleoptions.hxx
@@ -27,7 +27,6 @@
 #include 
 #include 
 
-namespace osl { class Mutex; }
 namespace com::sun::star::frame { class XModel; }
 namespace com::sun::star::beans { struct PropertyValue; }
 
@@ -168,8 +167,6 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtModuleOptions 
final : public utl::de
 css::uno::Sequence < OUString > GetAllServiceNames();
 
 private:
-UNOTOOLS_DLLPRIVATE static ::osl::Mutex& impl_GetOwnStaticMutex();
-
 std::shared_ptr   m_pImpl;
 
 };  // class SvtModuleOptions
diff --git a/unotools/source/config/moduleoptions.cxx 
b/unotools/source/config/moduleoptions.cxx
index 1468501220ec..ea3db01585c2 100644
--- a/unotools/source/config/moduleoptions.cxx
+++ b/unotools/source/config/moduleoptions.cxx
@@ -761,6 +761,12 @@ void SvtModuleOptions_Impl::MakeReadonlyStatesAvailable()
 namespace {
 //global
 std::weak_ptr g_pModuleOptions;
+
+osl::Mutex& impl_GetOwnStaticMutex()
+{
+static osl::Mutex s_Mutex;
+return s_Mutex;
+}
 }
 
 
/*-
@@ -907,23 +913,6 @@ bool SvtModuleOptions::IsDataBase() const
 return m_pImpl->IsModuleInstalled( EModule::DATABASE );
 }
 
-namespace
-{
-class theModuleOptionsMutex : public rtl::Static {};
-}
-/*-
-@short  return a reference to a static mutex
-@descr  These class is threadsafe.
-We create a static mutex only for one time and use it to 
protect our refcount and container
-member!
-@return A reference to a static mutex member.
-@threadsafe yes
-*//*-*/
-::osl::Mutex& SvtModuleOptions::impl_GetOwnStaticMutex()
-{
-return theModuleOptionsMutex::get();
-}
-
 OUString SvtModuleOptions::GetModuleName( EModule eModule ) const
 {
 switch( eModule )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/unotools unotools/source xmlsecurity/inc xmlsecurity/source

2020-12-08 Thread Noel (via logerrit)
 include/unotools/securityoptions.hxx   |   14 ++---
 unotools/source/config/securityoptions.cxx |   36 ++---
 xmlsecurity/inc/macrosecurity.hxx  |2 
 xmlsecurity/source/component/documentdigitalsignatures.cxx |   22 +++
 xmlsecurity/source/dialogs/macrosecurity.cxx   |   24 
 5 files changed, 47 insertions(+), 51 deletions(-)

New commits:
commit d7ddc292b94583942d4990e132bd08bcaee9edf2
Author: Noel 
AuthorDate: Tue Dec 8 11:57:57 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Dec 8 11:57:24 2020 +0100

use proper struct for trusted authors

instead of passing around a Sequence, there is no need
to use UNO types here.

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

diff --git a/include/unotools/securityoptions.hxx 
b/include/unotools/securityoptions.hxx
index 85ae5e6d1522..7a339a90bcf8 100644
--- a/include/unotools/securityoptions.hxx
+++ b/include/unotools/securityoptions.hxx
@@ -63,17 +63,17 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtSecurityOptions 
final : public utl::
 BlockUntrustedRefererLinks
 };
 
-typedef css::uno::Sequence< OUString > Certificate;
-
-/*
-// MT: Doesn't work for sequence...
 struct Certificate
 {
 OUString SubjectName;
 OUString SerialNumber;
 OUString RawData;
+
+bool operator==(const Certificate& other) const
+{
+return SubjectName == other.SubjectName && SerialNumber == 
other.SerialNumber && RawData == other.RawData;
+}
 };
-*/
 
 public:
  SvtSecurityOptions();
@@ -155,8 +155,8 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtSecurityOptions 
final : public utl::
 
 bool isTrustedLocationUriForUpdatingLinks(OUString const & uri) const;
 
-css::uno::Sequence< Certificate >  GetTrustedAuthors   (   
) const;
-void   SetTrustedAuthors   ( const 
css::uno::Sequence< Certificate >& rAuthors);
+std::vector< Certificate >   GetTrustedAuthors() const;
+void SetTrustedAuthors( const std::vector< 
Certificate >& rAuthors );
 
 // for bool options only!
 boolIsOptionSet ( EOption eOption   ) 
const;
diff --git a/unotools/source/config/securityoptions.cxx 
b/unotools/source/config/securityoptions.cxx
index 51318039a7f7..7acb0ff2d3c0 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -41,7 +41,7 @@ using namespace ::com::sun::star::uno;
 
 #define ROOTNODE_SECURITY   "Office.Common/Security/Scripting"
 #define DEFAULT_SECUREURL   Sequence< OUString >()
-#define DEFAULT_TRUSTEDAUTHORS  Sequence< 
SvtSecurityOptions::Certificate >()
+#define DEFAULT_TRUSTEDAUTHORS  std::vector< 
SvtSecurityOptions::Certificate >()
 
 #define PROPERTYNAME_SECUREURL  u"SecureURL"
 #define PROPERTYNAME_DOCWARN_SAVEORSEND u"WarnSaveOrSendDoc"
@@ -120,8 +120,8 @@ class SvtSecurityOptions_Impl : public ConfigItem
 
 inline bool IsMacroDisabled (  
 ) const;
 
-const Sequence< SvtSecurityOptions::Certificate >& GetTrustedAuthors(  

 ) const { return m_seqTrustedAuthors;}
-voidSetTrustedAuthors   ( 
const Sequence< SvtSecurityOptions::Certificate >& rAuthors 
  );
+const std::vector< SvtSecurityOptions::Certificate >& 
GetTrustedAuthors() const { return m_seqTrustedAuthors;}
+voidSetTrustedAuthors   ( const std::vector< 
SvtSecurityOptions::Certificate >& rAuthors );
 
 boolIsOptionSet ( SvtSecurityOptions::EOption 
eOption   ) const;
 voidSetOption   ( SvtSecurityOptions::EOption 
eOption, bool bValue  );
@@ -151,7 +151,7 @@ class SvtSecurityOptions_Impl : public ConfigItem
 boolm_bCtrlClickHyperlink;
 boolm_bBlockUntrustedRefererLinks;
 sal_Int32   m_nSecLevel;
-Sequence< SvtSecurityOptions::Certificate > m_seqTrustedAuthors;
+std::vector< SvtSecurityOptions::Certificate > m_seqTrustedAuthors;
 boolm_bDisableMacros;
 
 boolm_bROSecureURLs;
@@ -330,7 +330,7 @@ void 

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

2020-10-25 Thread Arnaud Versini (via logerrit)
 include/unotools/accessiblerelationsethelper.hxx  |6 
 unotools/source/accessibility/accessiblerelationsethelper.cxx |  122 ++
 2 files changed, 35 insertions(+), 93 deletions(-)

New commits:
commit 9411511e647f0847506bd1143a19f33af79d376f
Author: Arnaud Versini 
AuthorDate: Sun Oct 25 16:39:38 2020 +0100
Commit: Noel Grandin 
CommitDate: Sun Oct 25 18:12:05 2020 +0100

UNOTOOLS : simplify AccessibleRelationHelper by removing useless impl 
pattern

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

diff --git a/include/unotools/accessiblerelationsethelper.hxx 
b/include/unotools/accessiblerelationsethelper.hxx
index 6417401796d5..b4edb6b95159 100644
--- a/include/unotools/accessiblerelationsethelper.hxx
+++ b/include/unotools/accessiblerelationsethelper.hxx
@@ -25,9 +25,7 @@
 #include 
 #include 
 #include 
-#include 
-
-class AccessibleRelationSetHelperImpl;
+#include 
 
 //= XAccessibleRelationSet helper classes
 
@@ -123,7 +121,7 @@ private:
 /// Mutex guarding this object.
 ::osl::Mutex maMutex;
 /// The implementation of this helper interface.
-std::unique_ptrmpHelperImpl;
+std::vector maRelations;
 };
 
 }
diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx 
b/unotools/source/accessibility/accessiblerelationsethelper.cxx
index 8f70623435dc..02b3ad572e34 100644
--- a/unotools/source/accessibility/accessiblerelationsethelper.cxx
+++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx
@@ -22,108 +22,34 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 using namespace ::utl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
 
-class AccessibleRelationSetHelperImpl
+namespace
 {
-public:
-AccessibleRelationSetHelperImpl();
-AccessibleRelationSetHelperImpl(const AccessibleRelationSetHelperImpl& 
rImpl);
-
-/// @throws uno::RuntimeException
-sal_Int32 getRelationCount() const;
-/// @throws lang::IndexOutOfBoundsException
-/// @throws uno::RuntimeException
-AccessibleRelation const & getRelation( sal_Int32 nIndex ) const;
-/// @throws uno::RuntimeException
-bool containsRelation( sal_Int16 aRelationType ) const;
-/// @throws uno::RuntimeException
-AccessibleRelation getRelationByType( sal_Int16 aRelationType ) const;
-/// @throws uno::RuntimeException
-void AddRelation(const AccessibleRelation& rRelation);
-
-private:
-std::vector maRelations;
-};
-
-AccessibleRelationSetHelperImpl::AccessibleRelationSetHelperImpl()
-{
-}
-
-AccessibleRelationSetHelperImpl::AccessibleRelationSetHelperImpl(const 
AccessibleRelationSetHelperImpl& rImpl)
-: maRelations(rImpl.maRelations)
-{
-}
-
-sal_Int32 AccessibleRelationSetHelperImpl::getRelationCount() const
-{
-return maRelations.size();
-}
-
-AccessibleRelation const & AccessibleRelationSetHelperImpl::getRelation( 
sal_Int32 nIndex ) const
-{
-if ((nIndex < 0) || (o3tl::make_unsigned(nIndex) >= maRelations.size()))
-throw lang::IndexOutOfBoundsException();
-return maRelations[nIndex];
-}
-
-bool AccessibleRelationSetHelperImpl::containsRelation( sal_Int16 
aRelationType ) const
-{
-AccessibleRelation defaultRelation; // default is INVALID
-AccessibleRelation relationByType = getRelationByType(aRelationType);
-return relationByType.RelationType != defaultRelation.RelationType;
-}
-
-AccessibleRelation AccessibleRelationSetHelperImpl::getRelationByType( 
sal_Int16 aRelationType ) const
-{
-sal_Int32 nCount(getRelationCount());
-sal_Int32 i(0);
-while (i < nCount)
-{
-if (maRelations[i].RelationType == aRelationType)
-return maRelations[i];
-i++;
-}
-return AccessibleRelation();
-}
-
-void AccessibleRelationSetHelperImpl::AddRelation(const AccessibleRelation& 
rRelation)
-{
-sal_Int32 nCount(getRelationCount());
-sal_Int32 i(0);
-bool bFound(false);
-while ((i < nCount) && !bFound)
+AccessibleRelation lcl_getRelationByType( std::vector& 
raRelations, sal_Int16 aRelationType )
 {
-if (maRelations[i].RelationType == rRelation.RelationType)
-bFound = true;
-else
-i++;
+for (const auto& aRelation: raRelations)
+{
+if (aRelation.RelationType == aRelationType)
+return aRelation;
+}
+return AccessibleRelation();
 }
-if (bFound)
-maRelations[i].TargetSet = 
comphelper::concatSequences(maRelations[i].TargetSet, rRelation.TargetSet);
-else
-maRelations.push_back(rRelation);
 }
-
 //=  internal  
 
 AccessibleRelationSetHelper::AccessibleRelationSetHelper ()
-: mpHelperImpl(new AccessibleRelationSetHelperImpl)
 {
 }
 
 

[Libreoffice-commits] core.git: include/unotools

2020-10-19 Thread Arnaud Versini (via logerrit)
 include/unotools/accessiblestatesethelper.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 73933ed0a207f1cf210cc4a7d329755bd885f871
Author: Arnaud Versini 
AuthorDate: Mon Oct 19 13:48:40 2020 +0200
Commit: Arnaud Versini 
CommitDate: Mon Oct 19 18:55:57 2020 +0200

UNOTOOLS : remove unused include since 
54cbe9458033f50d9f608b1462d65e8514cbb636

Change-Id: I48ffb5454727518217dcfa60a34ece6f459341f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104521
Tested-by: Jenkins
Reviewed-by: Arnaud Versini 

diff --git a/include/unotools/accessiblestatesethelper.hxx 
b/include/unotools/accessiblestatesethelper.hxx
index 140375503fb1..b772a54af603 100644
--- a/include/unotools/accessiblestatesethelper.hxx
+++ b/include/unotools/accessiblestatesethelper.hxx
@@ -24,7 +24,6 @@
 #include 
 #include 
 #include 
-#include 
 
 //= XAccessibleStateSet helper classes
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/unotools officecfg/registry sw/source sw/uiconfig unotools/source

2020-09-24 Thread Michael Stahl (via logerrit)
 include/unotools/compatibility.hxx|4 
 officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs |8 +
 sw/source/core/doc/DocumentSettingManager.cxx |2 
 sw/source/core/view/viewsh.cxx|5 -
 sw/source/ui/config/optcomp.cxx   |   48 
--
 sw/uiconfig/swriter/ui/optcompatpage.ui   |1 
 unotools/source/config/compatibility.cxx  |2 
 7 files changed, 62 insertions(+), 8 deletions(-)

New commits:
commit 68aec8fd57eda8c05926b7f361dc102772f2c501
Author: Michael Stahl 
AuthorDate: Wed Sep 23 18:51:54 2020 +0200
Commit: Michael Stahl 
CommitDate: Thu Sep 24 20:58:13 2020 +0200

tdf#134782 sw,unotools,officecfg: adapt configuration and UI

Store AddParaLineSpacingToTableCells in configuration as
"AddTableLineSpacing", consistently inconsistent like AddTableSpacing
(the  elements are not subject to translation).

Adapt SwCompatibilityOptPage with some ugly hacks to allow 3 different
states (TriState) for the corresponding checkbox that map to false/false,
true/false and true/true.

The checkbox widget doesn't allow to change *to* indeterminate but at
least the status of the document can be displayed this way,
with a non-obvious tweak to optcompatpage.ui to reference "checktri1"
column.

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

diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index feae53faec8c..39674470e125 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -62,6 +62,10 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityEntry
 MsWordTrailingBlanks,
 SubtractFlysAnchoredAtFlys,
 EmptyDbFieldHidesPara,
+/// special entry: optcomp.cxx converts the other values to
+/// integers but not this one because it doesn't have its own
+/// checkbox, so keep it at the end!
+AddTableLineSpacing,
 
 /* Should be at the end. Do not remove it. */
 INVALID
diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
index 10468d11e3f4..5b89f9498005 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
@@ -76,7 +76,13 @@
   
   
 
-  ???
+  Add paragraph and table spacing at bottom of table cells
+
+true
+  
+  
+
+  Add paragraph line spacing at bottom of table cells
 
 true
   
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index febce5528ea7..5f609221752f 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -117,7 +117,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc 
)
 mbAddExternalLeading= !aOptions.GetDefault( 
SvtCompatibilityEntry::Index::NoExtLeading );
 mbOldLineSpacing= aOptions.GetDefault( 
SvtCompatibilityEntry::Index::UseLineSpacing );
 mbAddParaSpacingToTableCells= aOptions.GetDefault( 
SvtCompatibilityEntry::Index::AddTableSpacing );
-mbAddParaLineSpacingToTableCells= aOptions.GetDefault( 
SvtCompatibilityEntry::Index::AddTableSpacing ); // FIXME? separate UI?
+mbAddParaLineSpacingToTableCells= aOptions.GetDefault( 
SvtCompatibilityEntry::Index::AddTableLineSpacing );
 mbUseFormerObjectPos= aOptions.GetDefault( 
SvtCompatibilityEntry::Index::UseObjectPositioning );
 mbUseFormerTextWrapping = aOptions.GetDefault( 
SvtCompatibilityEntry::Index::UseOurTextWrapping );
 mbConsiderWrapOnObjPos  = aOptions.GetDefault( 
SvtCompatibilityEntry::Index::ConsiderWrappingStyle );
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 7f2f6e4466bb..52a82345ef65 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -822,10 +822,13 @@ void SwViewShell::SetUseVirDev( bool bNewVirtual )
 void SwViewShell::SetAddParaSpacingToTableCells( bool 
_bAddParaSpacingToTableCells )
 {
 IDocumentSettingAccess& rIDSA = getIDocumentSettingAccess();
-if ( rIDSA.get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS) != 
_bAddParaSpacingToTableCells )
+if (rIDSA.get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS) != 
_bAddParaSpacingToTableCells
+|| rIDSA.get(DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS) 
!= 

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

2020-09-07 Thread Arnaud Versini (via logerrit)
 include/unotools/accessiblestatesethelper.hxx  |4 
 unotools/source/accessibility/accessiblestatesethelper.cxx |  133 +++--
 2 files changed, 38 insertions(+), 99 deletions(-)

New commits:
commit 54cbe9458033f50d9f608b1462d65e8514cbb636
Author: Arnaud Versini 
AuthorDate: Sun Sep 6 19:01:24 2020 +0200
Commit: Arnaud Versini 
CommitDate: Mon Sep 7 11:20:09 2020 +0200

UNOTOOLS : simplify AccessibleStateSetHelper by not using an impl class

Change-Id: Iae7a028d2845d8b0bef2aefdce2ae00fa7f5660f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102110
Tested-by: Jenkins
Reviewed-by: Arnaud Versini 

diff --git a/include/unotools/accessiblestatesethelper.hxx 
b/include/unotools/accessiblestatesethelper.hxx
index e8277f648903..140375503fb1 100644
--- a/include/unotools/accessiblestatesethelper.hxx
+++ b/include/unotools/accessiblestatesethelper.hxx
@@ -26,8 +26,6 @@
 #include 
 #include 
 
-class AccessibleStateSetHelperImpl;
-
 //= XAccessibleStateSet helper classes
 
 //... namespace utl ...
@@ -134,7 +132,7 @@ private:
 /// Mutex guarding this object.
 ::osl::Mutex maMutex;
 /// The implementation of this helper interface.
-std::unique_ptr   mpHelperImpl;
+sal_uInt64 maStates;
 };
 
 }
diff --git a/unotools/source/accessibility/accessiblestatesethelper.cxx 
b/unotools/source/accessibility/accessiblestatesethelper.cxx
index 9a180a4677ad..cec1f6bcd615 100644
--- a/unotools/source/accessibility/accessiblestatesethelper.cxx
+++ b/unotools/source/accessibility/accessiblestatesethelper.cxx
@@ -28,110 +28,32 @@ using namespace ::utl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::accessibility;
 
-class AccessibleStateSetHelperImpl
+namespace
 {
-public:
-AccessibleStateSetHelperImpl();
-AccessibleStateSetHelperImpl(const AccessibleStateSetHelperImpl& rImpl);
-
-/// @throws uno::RuntimeException
-bool IsEmpty () const;
-/// @throws uno::RuntimeException
-bool Contains (sal_Int16 aState) const;
-/// @throws uno::RuntimeException
-uno::Sequence GetStates() const;
-/// @throws uno::RuntimeException
-void AddState(sal_Int16 aState);
-/// @throws uno::RuntimeException
-void RemoveState(sal_Int16 aState);
-
-inline void AddStates( const sal_Int64 _nStates );
-
-private:
-sal_uInt64 maStates;
-};
-
-AccessibleStateSetHelperImpl::AccessibleStateSetHelperImpl()
-: maStates(0)
-{
-}
-
-AccessibleStateSetHelperImpl::AccessibleStateSetHelperImpl(const 
AccessibleStateSetHelperImpl& rImpl)
-: maStates(rImpl.maStates)
-{
-}
-
-inline bool AccessibleStateSetHelperImpl::IsEmpty () const
-{
-return maStates == 0;
-}
-
-inline bool AccessibleStateSetHelperImpl::Contains (sal_Int16 aState) const
-{
-DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
-sal_uInt64 aTempBitSet(1);
-aTempBitSet <<= aState;
-return ((aTempBitSet & maStates) != 0);
-}
-
-inline uno::Sequence AccessibleStateSetHelperImpl::GetStates() const
-{
-uno::Sequence aRet(BITFIELDSIZE);
-sal_Int16* pSeq = aRet.getArray();
-sal_Int16 nStateCount(0);
-for (sal_Int16 i = 0; i < BITFIELDSIZE; ++i)
-if (Contains(i))
-{
-*pSeq = i;
-++pSeq;
-++nStateCount;
-}
-aRet.realloc(nStateCount);
-return aRet;
-}
-
-inline void AccessibleStateSetHelperImpl::AddStates( const sal_Int64 _nStates )
-{
-maStates |= _nStates;
+bool lcl_contains(sal_uInt64 aStates, sal_uInt64 aState)
+{
+DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
+sal_uInt64 aTempBitSet(1);
+aTempBitSet <<= aState;
+return ((aTempBitSet & aStates) != 0);
+}
 }
-
-inline void AccessibleStateSetHelperImpl::AddState(sal_Int16 aState)
-{
-DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
-sal_uInt64 aTempBitSet(1);
-aTempBitSet <<= aState;
-maStates |= aTempBitSet;
-}
-
-inline void AccessibleStateSetHelperImpl::RemoveState(sal_Int16 aState)
-{
-DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
-sal_uInt64 aTempBitSet(1);
-aTempBitSet <<= aState;
-aTempBitSet = ~aTempBitSet;
-maStates &= aTempBitSet;
-}
-
 //=  internal  
 
 AccessibleStateSetHelper::AccessibleStateSetHelper ()
-: mpHelperImpl(new AccessibleStateSetHelperImpl)
+: maStates(0)
 {
 }
 
 AccessibleStateSetHelper::AccessibleStateSetHelper ( const sal_Int64 
_nInitialStates )
-: mpHelperImpl(new AccessibleStateSetHelperImpl)
+: maStates(_nInitialStates)
 {
-mpHelperImpl->AddStates( _nInitialStates );
 }
 
 AccessibleStateSetHelper::AccessibleStateSetHelper (const 
AccessibleStateSetHelper& rHelper)
-: cppu::WeakImplHelper(rHelper)
+: cppu::WeakImplHelper(rHelper),
+  maStates(rHelper.maStates)
 {
-if 

[Libreoffice-commits] core.git: include/unotools include/xmloff sc/source xmloff/source

2020-05-08 Thread Michael Stahl (via logerrit)
 include/unotools/saveopt.hxx   |1 
 include/xmloff/maptype.hxx |4 +-
 include/xmloff/xmlprmap.hxx|5 ++
 sc/source/filter/xml/xmlstyle.cxx  |4 +-
 xmloff/source/chart/PropertyMap.hxx|4 +-
 xmloff/source/draw/sdpropls.cxx|   34 +-
 xmloff/source/style/PageMasterStyleMap.cxx |4 +-
 xmloff/source/style/xmlexppr.cxx   |   53 -
 xmloff/source/text/txtprmap.cxx|   16 
 9 files changed, 91 insertions(+), 34 deletions(-)

New commits:
commit f1dbaac9e4b68941d845a5f0ab7b204e12de14de
Author: Michael Stahl 
AuthorDate: Fri Apr 24 13:02:17 2020 +0200
Commit: Michael Stahl 
CommitDate: Fri May 8 21:29:29 2020 +0200

xmloff: ODF export: rework version checks in SvXMLExportPropertyMapper

There's some issues with the version checks here:

* The requirement is to retain support for ODF 1.2 extended,
  but some attributes are in ODF 1.3, while others require ODF 1.3
  extended, so a single version number can't be used to compare

* A recurring problem is that new extension attributes are erroneously
  exported to standard namespaces;
  there is the pre-existing buggy case of style:hyperlink to consider...

* Currently it's possible to distinguish multiple extended version but
  the only minimum version that's actually used is the minimum one
  ODFSVER_012_EXT_COMPAT

Rework this to use a different check, by:

* distinguishing extension attributes from standard attributes via
  their namespace, to avoid such bugs by construction

* interpreting the version number always as a standard ODF version number:

if the attribute is in extension namespace:
if the minimum standard version is met, ignore
else:
if the minimum standard version is met, export

* adapting all XMLPropertyMapEntry to use ODFSVER_FUTURE_EXTENDED for
  extension attributes (TODO: check which of these should be ODFSVER_013)

This should have an effect on the drawext:fontwork* attributes, which
need ODFSVER_FUTURE_EXTENDED to be exported now.

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

diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 029ab6f0b1cb..2f0460e21fbc 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -79,6 +79,7 @@ public:
 ODFSVER_012_EXTENDED = 11,  ///< ODF 1.2 extended
 ODFSVER_013 = 12,   ///< ODF 1.3
 ODFSVER_013_EXTENDED = 13,  ///< ODF 1.3 extended
+ODFSVER_FUTURE_EXTENDED = 1000 | ODFSVER_EXTENDED, ///< current 
extension, unknown future ODF version
 
 // The latest defined standard. Adapt when a new one is published.
 ODFSVER_LATEST = ODFSVER_012,   ///< @internal DO NOT 
USE in comparisons
diff --git a/include/xmloff/maptype.hxx b/include/xmloff/maptype.hxx
index ac6033e6dfe1..b09d48b31e6b 100644
--- a/include/xmloff/maptype.hxx
+++ b/include/xmloff/maptype.hxx
@@ -86,7 +86,9 @@ struct XMLPropertyMapEntry
 sal_uInt32 mnType;
 
 sal_Int16   mnContextId;/// User defined id for context filtering
-/// no export when the used ODF version is lower than this
+/** no export to standard namespace when the used ODF version is lower 
than this;
+no export to extension namespace when the used ODF version is at least 
this
+  */
 SvtSaveOptions::ODFSaneDefaultVersion mnEarliestODFVersionForExport;
 
 /** Flag to specify whether entry is only used during import.
diff --git a/include/xmloff/xmlprmap.hxx b/include/xmloff/xmlprmap.hxx
index 2b53f2e83d53..19e9ab80c0c4 100644
--- a/include/xmloff/xmlprmap.hxx
+++ b/include/xmloff/xmlprmap.hxx
@@ -81,7 +81,10 @@ public:
 /** returns the entry context id. -1 is a valid index here. */
 sal_Int16 GetEntryContextId( sal_Int32 nIndex ) const;
 
-/** returns the earliest odf version for which this property should be 
exported. */
+/** returns the earliest ODF version for which this property should be
+exported as standard ODF element, which is the earliest ODF version
+for which the property should not be exported as extension element.
+ */
 SvtSaveOptions::ODFSaneDefaultVersion 
GetEarliestODFVersionForExport(sal_Int32 nIndex) const;
 
 /** Returns the index of an entry with the given XML-name and namespace
diff --git a/sc/source/filter/xml/xmlstyle.cxx 
b/sc/source/filter/xml/xmlstyle.cxx
index 7f38d5217042..ff38c1cbdaaf 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -52,9 +52,9 @@ using namespace ::formula;
 
 #define MAP(name,prefix,token,type,context)  { name, sizeof(name)-1, prefix, 
token, 

[Libreoffice-commits] core.git: include/unotools

2020-05-01 Thread Michael Stahl (via logerrit)
 include/unotools/saveopt.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9608f72347a8ec99f454802cc3cabc6e32d92370
Author: Michael Stahl 
AuthorDate: Wed Apr 22 20:18:09 2020 +0200
Commit: Eike Rathke 
CommitDate: Fri May 1 21:53:09 2020 +0200

ODF export: fix wrong definition of ODFSVER_LATEST_EXTENDED

The only real use of ODFSVER_LATEST_EXTENDED is as translated value of
the default ODFVER_LATEST; it must match ODFSVER_012_EXTENDED
which is larger than ODFSVER_LATEST | ODFSVER_EXTENDED because
it *is* used in comparisons as the return value of
GetODFSaneDefaultVersion().
(Guess the comment means not to use it as literal in comparisons.)

Change-Id: I6ac5e012f314e86acdcb7ac7d615c747cd7b8a52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92726
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 7c189534d2da..029ab6f0b1cb 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -81,8 +81,8 @@ public:
 ODFSVER_013_EXTENDED = 13,  ///< ODF 1.3 extended
 
 // The latest defined standard. Adapt when a new one is published.
-ODFSVER_LATEST = ODFSVER_012,   ///< 
@internal DO NOT USE in comparisons
-ODFSVER_LATEST_EXTENDED = ODFSVER_LATEST | ODFSVER_EXTENDED ///< 
@internal DO NOT USE in comparisons
+ODFSVER_LATEST = ODFSVER_012,   ///< @internal DO NOT 
USE in comparisons
+ODFSVER_LATEST_EXTENDED = ODFSVER_012_EXTENDED  ///< @internal DO NOT 
USE in comparisons
 };
 
 SvtSaveOptions();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-31 Thread Johnny_M (via logerrit)
 include/unotools/textsearch.hxx |4 ++--
 unotools/source/i18n/textsearch.cxx |6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit fd7e4706d80d1769803b7b4ac57df4c80a5c80f2
Author: Johnny_M 
AuthorDate: Fri Mar 27 14:14:11 2020 +0100
Commit: Michael Weghorn 
CommitDate: Tue Mar 31 15:36:50 2020 +0200

Translate German variable names

Ende -> End

Change-Id: Ia3df5ee48e0d61051d99ac93e62c8a6dceafb41d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91218
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/unotools/textsearch.hxx b/include/unotools/textsearch.hxx
index 14a9558f237e..68af444d8023 100644
--- a/include/unotools/textsearch.hxx
+++ b/include/unotools/textsearch.hxx
@@ -183,7 +183,7 @@ public:
 /* search in the (selected) text the search string:
 rScrTxt - the text, in which we search
 pStart  - start position for the search
-pEnde   - end position for the search
+pEnd- end position for the search
 
 RETURN values   ==  true: something is found
 - pStart start pos of the found text,
@@ -192,7 +192,7 @@ public:
  positions. Is only filled with more positions
  if the regular expression handles groups.
 
-== false: nothing found, pStart,pEnde unchanged.
+== false: nothing found, pStart, pEnd unchanged.
 
 Definitions: start pos always inclusive, end pos always exclusive!
  The position must always in the right direction!
diff --git a/unotools/source/i18n/textsearch.cxx 
b/unotools/source/i18n/textsearch.cxx
index 2a657109b110..42b995f7051c 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -274,14 +274,14 @@ bool TextSearch::searchForward( const OUString  )
 }
 
 bool TextSearch::SearchBackward( const OUString & rStr, sal_Int32* pStart,
-sal_Int32* pEnde, SearchResult* pRes )
+sal_Int32* pEnd, SearchResult* pRes )
 {
 bool bRet = false;
 try
 {
 if( xTextSearch.is() )
 {
-SearchResult aRet( xTextSearch->searchBackward( rStr, *pStart, 
*pEnde ));
+SearchResult aRet( xTextSearch->searchBackward( rStr, *pStart, 
*pEnd ));
 if( aRet.subRegExpressions )
 {
 bRet = true;
@@ -289,7 +289,7 @@ bool TextSearch::SearchBackward( const OUString & rStr, 
sal_Int32* pStart,
 // and the endposition is always exclusive.
 // The caller of this function will have in startPos the
 // lower pos. and end
-*pEnde = aRet.startOffset[ 0 ];
+*pEnd = aRet.startOffset[ 0 ];
 *pStart = aRet.endOffset[ 0 ];
 if( pRes )
 *pRes = aRet;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/unotools

2020-03-29 Thread Julien Nabet (via logerrit)
 include/unotools/configitem.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ba5b51a22848c3e4af38676197bc1f663b33bb2e
Author: Julien Nabet 
AuthorDate: Sat Mar 28 21:10:09 2020 +0100
Commit: Noel Grandin 
CommitDate: Sun Mar 29 09:06:43 2020 +0200

Fix is_typed_flags for ConfigItemMode (unotools/configitem)

Since DelayedUpdate removed with:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=67ff7348756ec88d09fc00e6d284ba5b579e9b33
author  Noel Grandin  2018-12-06 10:05:06 
+0200
committer   Noel Grandin  2018-12-07 
10:35:44 +0100
commit  67ff7348756ec88d09fc00e6d284ba5b579e9b33 (patch)
treed9bc9015abadce440e6637e280286e04e9ba062a
parent  1e6cc2c8564e86465594f6651490f529dafb3aaf (diff)
remove unused ConfigItemMode::DelayedUpdate
unused ever since

commit c1758889cbd5e8e4afb1044425c908715eb3e1cd
Date:   Fri Nov 11 22:48:37 2011 +0100
Heavily simplified utl::ConfigManager.

and rename ConfigItemMode::ImmediateUpdate to NONE, since it doesn't
mean that anymore
Change-Id: I3f5e5a63cbbc12f15a4af104fc6e007cdf10cab3

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

diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx
index 16153e20715f..0c24857aef7b 100644
--- a/include/unotools/configitem.hxx
+++ b/include/unotools/configitem.hxx
@@ -52,7 +52,7 @@ enum class ConfigItemMode
 
 namespace o3tl
 {
-template<> struct typed_flags : 
is_typed_flags {};
+template<> struct typed_flags : 
is_typed_flags {};
 }
 
 namespace utl
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/unotools unotools/source unoxml/source uui/source

2020-03-16 Thread Noel Grandin (via logerrit)
 include/unotools/configitem.hxx |2 +-
 include/unotools/intlwrapper.hxx|2 +-
 include/unotools/streamhelper.hxx   |2 +-
 include/unotools/tempfile.hxx   |2 +-
 include/unotools/transliterationwrapper.hxx |2 +-
 include/unotools/viewoptions.hxx|4 ++--
 unotools/source/config/configvaluecontainer.cxx |2 +-
 unotools/source/config/defaultoptions.cxx   |4 ++--
 unotools/source/config/fontcfg.cxx  |8 
 unotools/source/config/lingucfg.cxx |2 +-
 unotools/source/config/pathoptions.cxx  |4 ++--
 unotools/source/config/viewoptions.cxx  |2 +-
 unotools/source/misc/wincodepage.cxx|   12 ++--
 unoxml/source/dom/document.cxx  |2 +-
 unoxml/source/rdf/librdf_repository.cxx |2 +-
 uui/source/fltdlg.cxx   |2 +-
 uui/source/logindlg.hxx |4 ++--
 uui/source/passworddlg.hxx  |2 +-
 18 files changed, 30 insertions(+), 30 deletions(-)

New commits:
commit 6d40302d89e1a72841c8a64733c7a26080a65cb8
Author: Noel Grandin 
AuthorDate: Sun Mar 15 18:31:45 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 16 08:21:14 2020 +0100

Revert "loplugin:constfields in unotools..uui"

This reverts commit d8ac55e3e53564aca4b0bade5a5b5cb01b4519b1.

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

diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx
index edeaf03af55c..16153e20715f 100644
--- a/include/unotools/configitem.hxx
+++ b/include/unotools/configitem.hxx
@@ -74,7 +74,7 @@ namespace utl
 m_xHierarchyAccess;
 css::uno::Reference< css::util::XChangesListener >
 xChangeLstnr;
-ConfigItemMode const  m_nMode;
+ConfigItemMode  m_nMode;
 boolm_bIsModified;
 boolm_bEnableInternalNotification;
 sal_Int16   m_nInValueChange;
diff --git a/include/unotools/intlwrapper.hxx b/include/unotools/intlwrapper.hxx
index 47ded1a273a9..8a893eb78aad 100644
--- a/include/unotools/intlwrapper.hxx
+++ b/include/unotools/intlwrapper.hxx
@@ -50,7 +50,7 @@ class LocaleDataWrapper;
 class UNOTOOLS_DLLPUBLIC IntlWrapper
 {
 private:
-LanguageTag const maLanguageTag;
+LanguageTag maLanguageTag;
 css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
 std::unique_ptr  pLocaleData;
diff --git a/include/unotools/streamhelper.hxx 
b/include/unotools/streamhelper.hxx
index 5b2b7f762157..05c5a5b45e84 100644
--- a/include/unotools/streamhelper.hxx
+++ b/include/unotools/streamhelper.hxx
@@ -38,7 +38,7 @@ class UNOTOOLS_DLLPUBLIC OInputStreamHelper final : public 
cppu::WeakImplHelper<
 ::osl::Mutexm_aMutex;
 SvLockBytesRef  m_xLockBytes;
 sal_uInt64  m_nActPos;
-sal_Int32 const   m_nAvailable;   // this is typically the 
chunk(buffer) size
+sal_Int32   m_nAvailable;   // this is typically the chunk(buffer) size
 
 public:
 OInputStreamHelper(const SvLockBytesRef& _xLockBytes,
diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
index b20a4f2fdf40..60ae7710c59c 100644
--- a/include/unotools/tempfile.hxx
+++ b/include/unotools/tempfile.hxx
@@ -48,7 +48,7 @@ class UNOTOOLS_DLLPUBLIC TempFile
 OUStringaName;
 std::unique_ptr
 pStream;
-bool constbIsDirectory;
+boolbIsDirectory;
 boolbKillingFileEnabled;
 
 public:
diff --git a/include/unotools/transliterationwrapper.hxx 
b/include/unotools/transliterationwrapper.hxx
index 882975bac2a5..a87cf29ca32c 100644
--- a/include/unotools/transliterationwrapper.hxx
+++ b/include/unotools/transliterationwrapper.hxx
@@ -43,7 +43,7 @@ class UNOTOOLS_DLLPUBLIC TransliterationWrapper
 {
 css::uno::Reference< css::i18n::XExtendedTransliteration > xTrans;
 LanguageTag aLanguageTag;
-TransliterationFlags const nType;
+TransliterationFlags nType;
 mutable bool bFirstCall;
 
 TransliterationWrapper( const TransliterationWrapper& ) = delete;
diff --git a/include/unotools/viewoptions.hxx b/include/unotools/viewoptions.hxx
index 461e5ead6e26..8eb088077b54 100644
--- a/include/unotools/viewoptions.hxx
+++ b/include/unotools/viewoptions.hxx
@@ -234,8 +234,8 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions 
final : public utl::deta
 
 /// specify which list of views in configuration is used! This can't 
be a static value!!!
 /// ... because we need this value to work with right static data 
container.
-EViewType 

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

2020-02-04 Thread Michael Stahl (via logerrit)
 include/unotools/saveopt.hxx   |2 +-
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |5 +
 unotools/source/config/saveopt.cxx |6 --
 3 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit d571a509aa324db9a425110a67ea142d157256b2
Author: Michael Stahl 
AuthorDate: Mon Feb 3 17:21:37 2020 +0100
Commit: Michael Stahl 
CommitDate: Tue Feb 4 16:15:42 2020 +0100

deb#949754: unotools,officecfg: don't ODF export using ODFVER_UNKNOWN

The problem was that commit ef39938dea14666a5835b6ae85091c1010f8ae8d
temporarily added ODF 1.3 version strings to the optsavepage.ui,
just to get translations for them; unfortunately the dialog itself
was not adapted to the new values, so when you select them the
result is 0, or ODFVER_UNKNOWN... fortunately this was reverted
before 6.4.0.3.

The value ODFVER_UNKNOWN is very dubious and without an obvious purpose;
http://specs.openoffice.org/appwide/odf/odf_1-2_migration.odt
mentions it but provides no details.

Hence let's interpret it the same as ODFVER_LATEST for export purposes.

Also add the value ODFVER_012_EXT_COMPAT to the configuration, because
this is actually used.

Also fix a copypasta in SvtSaveOptions_Impl::IsReadOnly(), where the
wrong flag is checked for OdfDefaultVersion.

Change-Id: Ie276f0ef3cead3ffa016ba939aede74581fb0257
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87900
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
Reviewed-by: Michael Stahl 

diff --git a/include/unotools/saveopt.hxx b/include/unotools/saveopt.hxx
index 7c4d3adc0dc8..7c189534d2da 100644
--- a/include/unotools/saveopt.hxx
+++ b/include/unotools/saveopt.hxx
@@ -58,7 +58,7 @@ public:
  */
 enum ODFDefaultVersion
 {
-ODFVER_UNKNOWN = 0, // unknown
+ODFVER_UNKNOWN = 0, // unknown - very dubious, avoid using
 ODFVER_010 = 1, // ODF 1.0
 ODFVER_011 = 2, // ODF 1.1
 DO_NOT_USE = 3, // Do not use this, only here for 
compatibility with pre OOo 3.2 configuration
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 675f173e5b36..dbe38f526f05 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2478,6 +2478,11 @@
 ODFVER_012
   
 
+
+  
+ODFVER_012_EXT_COMPAT
+  
+
 
   
 ODFVER_LATEST
diff --git a/unotools/source/config/saveopt.cxx 
b/unotools/source/config/saveopt.cxx
index 650ec5586b8d..6d6b39743eb9 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -322,7 +322,7 @@ bool SvtSaveOptions_Impl::IsReadOnly( 
SvtSaveOptions::EOption eOption ) const
 bReadOnly = bROLoadDocPrinter;
 break;
 case SvtSaveOptions::EOption::OdfDefaultVersion :
-bReadOnly = bROLoadDocPrinter;
+bReadOnly = bROODFDefaultVersion;
 break;
 }
 return bReadOnly;
@@ -932,7 +932,9 @@ void SvtSaveOptions::SetODFDefaultVersion( 
SvtSaveOptions::ODFDefaultVersion eVe
 
 SvtSaveOptions::ODFDefaultVersion SvtSaveOptions::GetODFDefaultVersion() const
 {
-return pImp->pSaveOpt->GetODFDefaultVersion();
+auto const nRet = pImp->pSaveOpt->GetODFDefaultVersion();
+SAL_WARN_IF(nRet == ODFVER_UNKNOWN, "unotools.config", "DefaultVersion is 
ODFVER_UNKNOWN?");
+return (nRet == ODFVER_UNKNOWN) ? ODFVER_LATEST : nRet;
 }
 
 SvtSaveOptions::ODFSaneDefaultVersion 
SvtSaveOptions::GetODFSaneDefaultVersion() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/unotools unodevtools/inc unodevtools/source unotools/source unoxml/inc unoxml/source

2019-12-24 Thread Noel Grandin (via logerrit)
 include/unotools/confignode.hxx |6 +++---
 include/unotools/configvaluecontainer.hxx   |4 ++--
 include/unotools/resmgr.hxx |2 +-
 unodevtools/inc/options.hxx |4 ++--
 unodevtools/source/unodevtools/options.cxx  |4 ++--
 unotools/source/config/configvaluecontainer.cxx |4 ++--
 unotools/source/config/lingucfg.cxx |2 +-
 unotools/source/config/saveopt.cxx  |2 +-
 unotools/source/i18n/resmgr.cxx |2 +-
 unotools/source/misc/syslocale.cxx  |2 +-
 unotools/source/misc/unotoolsservices.cxx   |2 +-
 unoxml/inc/node.hxx |4 ++--
 unoxml/source/dom/characterdata.cxx |8 
 unoxml/source/dom/element.cxx   |   12 ++--
 unoxml/source/dom/node.cxx  |8 
 unoxml/source/dom/processinginstruction.cxx |4 ++--
 unoxml/source/rdf/librdf_repository.cxx |8 
 unoxml/source/service/services.cxx  |2 +-
 unoxml/source/xpath/xpathobject.cxx |2 +-
 19 files changed, 41 insertions(+), 41 deletions(-)

New commits:
commit 56063d30628ee2497a7c559d7de42d26e9cfc8ae
Author: Noel Grandin 
AuthorDate: Tue Dec 24 10:36:27 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Dec 24 17:28:50 2019 +0100

sal_Char->char in unoxml

Change-Id: Ie14ea8349e5dc698a11b3447429b3ca7cbab9bb3
Reviewed-on: https://gerrit.libreoffice.org/85774
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/confignode.hxx b/include/unotools/confignode.hxx
index 156c5a05381b..9e3d57ee8b9a 100644
--- a/include/unotools/confignode.hxx
+++ b/include/unotools/confignode.hxx
@@ -81,7 +81,7 @@ namespace utl
 */
 OConfigurationNode  openNode(const OUString& _rPath) const throw();
 
-OConfigurationNode  openNode( const sal_Char* _pAsciiPath ) const
+OConfigurationNode  openNode( const char* _pAsciiPath ) const
 {
 return openNode( OUString::createFromAscii( _pAsciiPath ) );
 }
@@ -112,7 +112,7 @@ namespace utl
 */
 css::uno::Any   getNodeValue(const OUString& _rPath) const throw();
 
-css::uno::Any   getNodeValue( const sal_Char* _pAsciiPath ) const
+css::uno::Any   getNodeValue( const char* _pAsciiPath ) const
 {
 return getNodeValue( OUString::createFromAscii( _pAsciiPath ) );
 }
@@ -125,7 +125,7 @@ namespace utl
 */
 boolsetNodeValue(const OUString& _rPath, const 
css::uno::Any& _rValue) const throw();
 
-boolsetNodeValue( const sal_Char* _pAsciiPath, const 
css::uno::Any& _rValue ) const
+boolsetNodeValue( const char* _pAsciiPath, const 
css::uno::Any& _rValue ) const
 {
 return setNodeValue( OUString::createFromAscii( _pAsciiPath ), 
_rValue );
 }
diff --git a/include/unotools/configvaluecontainer.hxx 
b/include/unotools/configvaluecontainer.hxx
index 5d51b1e7dcaa..4190f76b5829 100644
--- a/include/unotools/configvaluecontainer.hxx
+++ b/include/unotools/configvaluecontainer.hxx
@@ -82,7 +82,7 @@ namespace utl
 OConfigurationValueContainer(
 const css::uno::Reference< css::uno::XComponentContext >& _rxORB,
 ::osl::Mutex& _rAccessSafety,
-const sal_Char* _pConfigLocation,
+const char* _pConfigLocation,
 const sal_Int32 _nLevels
 );
 
@@ -104,7 +104,7 @@ namespace utl
 is the type of your accessor. This type must be supported by 
the configuration.
 */
 voidregisterExchangeLocation(
-const sal_Char* _pRelativePathAscii,
+const char* _pRelativePathAscii,
 void* _pContainer,
 const css::uno::Type& _rValueType
 );
diff --git a/include/unotools/resmgr.hxx b/include/unotools/resmgr.hxx
index 400f3a74f389..d1c64e399ffe 100644
--- a/include/unotools/resmgr.hxx
+++ b/include/unotools/resmgr.hxx
@@ -29,7 +29,7 @@ typedef OUString (*ResHookProc)(const OUString& rStr);
 
 namespace Translate
 {
-UNOTOOLS_DLLPUBLIC std::locale Create(const sal_Char* pPrefixName, const 
LanguageTag& rLocale = SvtSysLocale().GetUILanguageTag());
+UNOTOOLS_DLLPUBLIC std::locale Create(const char* pPrefixName, const 
LanguageTag& rLocale = SvtSysLocale().GetUILanguageTag());
 UNOTOOLS_DLLPUBLIC OUString get(const char* pId, const std::locale );
 UNOTOOLS_DLLPUBLIC OUString nget(const char* pId, int n, const std::locale 
);
 UNOTOOLS_DLLPUBLIC void SetReadStringHook( ResHookProc pProc );
diff --git a/unodevtools/inc/options.hxx b/unodevtools/inc/options.hxx
index f459009e190b..882d5c6488bf 100644
--- a/unodevtools/inc/options.hxx
+++ b/unodevtools/inc/options.hxx
@@ -27,12 +27,12 @@
 namespace unodevtools {
 
 
-bool 

[Libreoffice-commits] core.git: include/unotools

2019-10-31 Thread Noel Grandin (via logerrit)
 include/unotools/accessiblerelationsethelper.hxx |2 +-
 include/unotools/accessiblestatesethelper.hxx|2 +-
 include/unotools/cmdoptions.hxx  |2 +-
 include/unotools/compatibility.hxx   |2 +-
 include/unotools/compatibilityviewoptions.hxx|2 +-
 include/unotools/confignode.hxx  |3 +--
 include/unotools/defaultoptions.hxx  |2 +-
 include/unotools/dynamicmenuoptions.hxx  |2 +-
 include/unotools/eventcfg.hxx|2 +-
 include/unotools/extendedsecurityoptions.hxx |2 +-
 include/unotools/fltrcfg.hxx |2 +-
 include/unotools/fontoptions.hxx |2 +-
 include/unotools/historyoptions.hxx  |2 +-
 include/unotools/lingucfg.hxx|2 +-
 include/unotools/misccfg.hxx |2 +-
 include/unotools/moduleoptions.hxx   |2 +-
 include/unotools/optionsdlg.hxx  |2 +-
 include/unotools/pathoptions.hxx |2 +-
 include/unotools/printwarningoptions.hxx |2 +-
 include/unotools/progresshandlerwrap.hxx |2 +-
 include/unotools/saveopt.hxx |2 +-
 include/unotools/securityoptions.hxx |2 +-
 include/unotools/streamhelper.hxx|2 +-
 include/unotools/streamwrap.hxx  |5 ++---
 include/unotools/syslocaleoptions.hxx|2 +-
 include/unotools/useroptions.hxx |2 +-
 include/unotools/viewoptions.hxx |2 +-
 27 files changed, 28 insertions(+), 30 deletions(-)

New commits:
commit 2721cd2e9cf12c64b5e4456e231a3ed80b95349a
Author: Noel Grandin 
AuthorDate: Wed Oct 30 15:23:59 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 31 07:03:06 2019 +0100

loplugin:finalclasses in unotools

Change-Id: I0fa349db5dab3406aa93d40d4d2f41e517bf60fa
Reviewed-on: https://gerrit.libreoffice.org/81799
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/accessiblerelationsethelper.hxx 
b/include/unotools/accessiblerelationsethelper.hxx
index 05d169230adc..6417401796d5 100644
--- a/include/unotools/accessiblerelationsethelper.hxx
+++ b/include/unotools/accessiblerelationsethelper.hxx
@@ -39,7 +39,7 @@ namespace utl
 This base class provides an implementation of the
 AccessibleRelationSet service.
 */
-class UNOTOOLS_DLLPUBLIC AccessibleRelationSetHelper
+class UNOTOOLS_DLLPUBLIC AccessibleRelationSetHelper final
 :   public cppu::WeakImplHelper< 
css::accessibility::XAccessibleRelationSet >
 {
 public:
diff --git a/include/unotools/accessiblestatesethelper.hxx 
b/include/unotools/accessiblestatesethelper.hxx
index 0093e618a0af..e8277f648903 100644
--- a/include/unotools/accessiblestatesethelper.hxx
+++ b/include/unotools/accessiblestatesethelper.hxx
@@ -38,7 +38,7 @@ namespace utl
 This base class provides an implementation of the
 AccessibleStateSet service.
 */
-class UNOTOOLS_DLLPUBLIC AccessibleStateSetHelper
+class UNOTOOLS_DLLPUBLIC AccessibleStateSetHelper final
 :   public cppu::WeakImplHelper< css::accessibility::XAccessibleStateSet >
 {
 public:
diff --git a/include/unotools/cmdoptions.hxx b/include/unotools/cmdoptions.hxx
index 6beadc644de9..b28c20638fc7 100644
--- a/include/unotools/cmdoptions.hxx
+++ b/include/unotools/cmdoptions.hxx
@@ -50,7 +50,7 @@ class SvtCommandOptions_Impl;
 @devstatus  ready to use
 
*//*-*/
 
-class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtCommandOptions : public 
utl::detail::Options
+class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtCommandOptions final : public 
utl::detail::Options
 {
 friend class SvtCommandOptions_Impl;
 
diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index ed3e14f5026d..24f2da53e590 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -181,7 +181,7 @@ class SvtCompatibilityOptions_Impl;
 @descr  Make it possible to configure dynamic menu structures of 
menus like "new" or "wizard".
 @devstatus  ready to use
 
*//*-*/
-class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options
+class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions final : public 
utl::detail::Options
 {
 public:
 SvtCompatibilityOptions();
diff --git a/include/unotools/compatibilityviewoptions.hxx 
b/include/unotools/compatibilityviewoptions.hxx
index ce1f4aab42e4..6030c5834f4e 100644
--- a/include/unotools/compatibilityviewoptions.hxx
+++ b/include/unotools/compatibilityviewoptions.hxx
@@ -23,7 +23,7 @@ class SvtCompatibilityViewOptions_Impl;
 /// Compatibility settings which 

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

2019-08-27 Thread Stephan Bergmann (via logerrit)
 include/unotools/tempfile.hxx   |4 
 sw/qa/extras/ooxmlexport/ooxmllinks.cxx |7 +--
 unotools/source/ucbhelper/tempfile.cxx  |6 ++
 3 files changed, 11 insertions(+), 6 deletions(-)

New commits:
commit 3bed509302127f0bb82898b2637c4372aee796ef
Author: Stephan Bergmann 
AuthorDate: Tue Aug 27 10:30:47 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 27 15:07:48 2019 +0200

Use a direct way to get at the temp dir

...in code originally added with 2b2f1352c72280dd25ed3bef090a3c708ee4b964
"tdf#86087 Save relative links in DOCX", by introducing
utl::TempFile::GetTempNameBaseDirectory

Change-Id: Ic0e8b54896a3829c081255404ef92b96f1724a2a
Reviewed-on: https://gerrit.libreoffice.org/78174
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
index 57f0fef8a940..b77d6e3a798f 100644
--- a/include/unotools/tempfile.hxx
+++ b/include/unotools/tempfile.hxx
@@ -132,6 +132,10 @@ public:
 It is not a URL because all URLs must be "UCB compatible", 
so there may be no suitable URL at all.
 */
 static OUString SetTempNameBaseDirectory( const OUString  );
+
+// Return the URL of the temp directory (the one set with 
SetTempNameBaseDirectory or the
+// default tempfile folder):
+static OUString GetTempNameBaseDirectory();
 };
 
 }
diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx 
b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
index 476c4fc5408d..6bfeb8cda870 100644
--- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
@@ -47,12 +47,7 @@
  : aOriginalURL.GetLastName(); 
\

\
 /* Get temp path */
\
-OUString sTempDir = utl::TempFile::CreateTempName();   
\
-INetURLObject aTempURL;
\
-aTempURL.setFSysPath(sTempDir, FSysStyle::Detect); 
\
-/* remove file name */ 
\
-aTempURL.removeSegment();  
\
-sTempDir = INetURLObject::GetScheme(aTempURL.GetProtocol()) + 
aTempURL.GetURLPath();   \
+OUString sTempDir = utl::TempFile::GetTempNameBaseDirectory(); 
\

\
 /* Create & apply new URL */   
\
 OUString sOriginalFileInTempDir = sTempDir + sFileName;
\
diff --git a/unotools/source/ucbhelper/tempfile.cxx 
b/unotools/source/ucbhelper/tempfile.cxx
index 9e582658bd89..83c2effa919e 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -468,6 +468,12 @@ OUString TempFile::SetTempNameBaseDirectory( const 
OUString  )
 
 return aTmp;
 }
+
+OUString TempFile::GetTempNameBaseDirectory()
+{
+return ConstructTempDir_Impl(nullptr);
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-24 Thread Noel Grandin (via logerrit)
 include/unotools/localedatawrapper.hxx  |2 +-
 unotools/source/config/lingucfg.cxx |6 +++---
 unotools/source/config/misccfg.cxx  |8 +++-
 unotools/source/config/syslocaleoptions.cxx |4 ++--
 unotools/source/i18n/localedatawrapper.cxx  |2 +-
 5 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit f693d23170036bd6116458e655c2f3b34b3cd926
Author: Noel Grandin 
AuthorDate: Fri Aug 23 21:00:39 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 24 09:03:09 2019 +0200

loplugin:returnconstval in unotools

Change-Id: I8bfc0d52c8a68268a12e3dab890402d964d48eba
Reviewed-on: https://gerrit.libreoffice.org/78036
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/localedatawrapper.hxx 
b/include/unotools/localedatawrapper.hxx
index 04650e29f7b6..fd0e457943eb 100644
--- a/include/unotools/localedatawrapper.hxx
+++ b/include/unotools/localedatawrapper.hxx
@@ -211,7 +211,7 @@ public:
 Indian grouping. The sal_Int32* getConstArray() can be passed directly
 to the ::rtl::math::doubleToString() methods as argument for the
 pGroups parameter. */
-const css::uno::Sequence< sal_Int32 > getDigitGrouping() const;
+css::uno::Sequence< sal_Int32 > getDigitGrouping() const;
 
 // Functionality of class International methods, LocaleItem
 
diff --git a/unotools/source/config/lingucfg.cxx 
b/unotools/source/config/lingucfg.cxx
index 70efeba7b6c5..7c7a6b700cc8 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -68,7 +68,7 @@ static bool lcl_SetLocale( LanguageType , const 
uno::Any  )
 return bSucc;
 }
 
-static const OUString lcl_LanguageToCfgLocaleStr( LanguageType nLanguage )
+static OUString lcl_LanguageToCfgLocaleStr( LanguageType nLanguage )
 {
 OUString aRes;
 if (LANGUAGE_SYSTEM != nLanguage)
@@ -148,7 +148,7 @@ class SvtLinguConfigItem : public utl::ConfigItem
 SvtLinguOptions aOpt;
 
 static bool GetHdlByName( sal_Int32 , const OUString , 
bool bFullPropName = false );
-static const uno::Sequence< OUString > GetPropertyNames();
+static uno::Sequence< OUString > GetPropertyNames();
 voidLoadOptions( const uno::Sequence< OUString > 
 );
 boolSaveOptions( const uno::Sequence< OUString > 
 );
 
@@ -256,7 +256,7 @@ static struct NamesToHdl
 {nullptr,nullptr,  
-1}
 };
 
-const uno::Sequence< OUString > SvtLinguConfigItem::GetPropertyNames()
+uno::Sequence< OUString > SvtLinguConfigItem::GetPropertyNames()
 {
 uno::Sequence< OUString > aNames;
 
diff --git a/unotools/source/config/misccfg.cxx 
b/unotools/source/config/misccfg.cxx
index e8bf4023479f..4941773afb65 100644
--- a/unotools/source/config/misccfg.cxx
+++ b/unotools/source/config/misccfg.cxx
@@ -44,7 +44,7 @@ private:
 boolbNotFound;
 sal_Int32   nYear2000;  // two digit year representation
 
-static const css::uno::Sequence GetPropertyNames();
+static css::uno::Sequence GetPropertyNames();
 voidLoad();
 
 virtual voidImplCommit() final override;
@@ -114,17 +114,15 @@ void SfxMiscCfg::SetYear2000( sal_Int32 nSet )
 nYear2000 = nSet;
 }
 
-const Sequence SfxMiscCfg::GetPropertyNames()
+Sequence SfxMiscCfg::GetPropertyNames()
 {
-const OUString pProperties[] =
+return
 {
 OUString("Print/Warning/PaperSize"),
 OUString("Print/Warning/PaperOrientation"),
 OUString("Print/Warning/NotFound"),
 OUString("DateFormat/TwoDigitYear")
 };
-const Sequence< OUString > seqPropertyNames( pProperties, 4 );
-return seqPropertyNames;
 }
 
 void SfxMiscCfg::Load()
diff --git a/unotools/source/config/syslocaleoptions.cxx 
b/unotools/source/config/syslocaleoptions.cxx
index 1876855d1008..f3942f5b7c4d 100644
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -75,7 +75,7 @@ class SvtSysLocaleOptions_Impl : public utl::ConfigItem
 boolm_bRODecimalSeparator;
 boolm_bROIgnoreLanguageChange;
 
-static  const Sequence< /* const */ OUString >  GetPropertyNames();
+static Sequence  GetPropertyNames();
 voidMakeRealLocale();
 voidMakeRealUILocale();
 
@@ -128,7 +128,7 @@ public:
 #define PROPERTYHANDLE_DATEPATTERNS 4
 #define PROPERTYHANDLE_IGNORELANGCHANGE 5
 
-const Sequence< OUString > SvtSysLocaleOptions_Impl::GetPropertyNames()
+Sequence< OUString > SvtSysLocaleOptions_Impl::GetPropertyNames()
 {
 return Sequence< OUString >
 {
diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index 8a16ec556f47..ec306acfa07a 100644
--- a/unotools/source/i18n/localedatawrapper.cxx

[Libreoffice-commits] core.git: include/unotools

2019-07-26 Thread Caolán McNamara (via logerrit)
 include/unotools/fltrcfg.hxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit bfcd3b24bc065488b729c0846e74f2efabb3451e
Author: Caolán McNamara 
AuthorDate: Fri Jul 26 08:31:24 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 26 12:18:05 2019 +0200

cid#1401328 Uncaught exception

Change-Id: I3585fc84437d084670727b048d3b26231c76e659
Reviewed-on: https://gerrit.libreoffice.org/76352
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/unotools/fltrcfg.hxx b/include/unotools/fltrcfg.hxx
index bc5630cac444..8ea6a7fbfa1a 100644
--- a/include/unotools/fltrcfg.hxx
+++ b/include/unotools/fltrcfg.hxx
@@ -19,6 +19,7 @@
 #ifndef INCLUDED_UNOTOOLS_FLTRCFG_HXX
 #define INCLUDED_UNOTOOLS_FLTRCFG_HXX
 
+#include 
 #include 
 #include 
 #include 
@@ -27,7 +28,7 @@ struct SvtFilterOptions_Impl;
 class UNOTOOLS_DLLPUBLIC SvtFilterOptions : public utl::ConfigItem
 {
 private:
-std::unique_ptr pImpl;
+std::unique_ptr> pImpl;
 
 virtual voidImplCommit() override;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/unotools officecfg/registry sfx2/source unotools/source

2019-05-19 Thread Stephan Bergmann (via logerrit)
 include/unotools/configmgr.hxx |2 --
 officecfg/registry/schema/org/openoffice/Setup.xcs |1 -
 sfx2/source/view/viewfrm.cxx   |4 ++--
 unotools/source/config/configmgr.cxx   |6 --
 4 files changed, 2 insertions(+), 11 deletions(-)

New commits:
commit c12922a584ee7a150252de938087b82fd584b9d5
Author: Stephan Bergmann 
AuthorDate: Fri May 17 16:22:10 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Sun May 19 20:34:08 2019 +0200

Fix nillability of ooSetupLastVersion

...that had been introduced with 5187d3ae495a07373a12fd5980c9269bc8ce3f8f
"Resolves: tdf#69042 - Add a 'What's New' infobar":

* Make the default value nil instead of an empty string.

* A nilable prop can't reuse the legacy utl::ConfigManager framework to 
obtain
  string prop values, so drop it from there and directly use the 
direct-access
  functionality in SfxViewFrame::Notify.

Change-Id: I5fc67a3d7e0fcb44a218889ecf8c69e81661567e
Reviewed-on: https://gerrit.libreoffice.org/72485
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/include/unotools/configmgr.hxx b/include/unotools/configmgr.hxx
index e5b9f9c2f358..e79629834db4 100644
--- a/include/unotools/configmgr.hxx
+++ b/include/unotools/configmgr.hxx
@@ -53,8 +53,6 @@ public:
 
 static OUString getProductVersion();
 
-static OUString getLastProductVersion();
-
 static OUString getVendor();
 
 static void storeConfigItems();
diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs 
b/officecfg/registry/schema/org/openoffice/Setup.xcs
index 9d93e7eb6a64..96d062c3bc30 100644
--- a/officecfg/registry/schema/org/openoffice/Setup.xcs
+++ b/officecfg/registry/schema/org/openoffice/Setup.xcs
@@ -265,7 +265,6 @@
   Specifies the version number of the previously used product for
   whats-new comparison.
 
-
   
   
 
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 18d71c170ea9..2ee2b9c82976 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1233,8 +1233,8 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const 
SfxHint& rHint )
 {
 OUString sSetupVersion = 
utl::ConfigManager::getProductVersion();
 sal_Int32 iCurrent = 
sSetupVersion.getToken(0,'.').toInt32() * 10 + 
sSetupVersion.getToken(1,'.').toInt32();
-OUString sLastVersion = 
utl::ConfigManager::getLastProductVersion();
-if (sLastVersion.isEmpty()) sLastVersion="0.0";
+OUString sLastVersion
+= 
officecfg::Setup::Product::ooSetupLastVersion::get().value_or("0.0");
 sal_Int32 iLast = sLastVersion.getToken(0,'.').toInt32() * 
10 + sLastVersion.getToken(1,'.').toInt32();
 if ((iCurrent > iLast) && 
!Application::IsHeadlessModeEnabled() && !bIsUITest)
 {
diff --git a/unotools/source/config/configmgr.cxx 
b/unotools/source/config/configmgr.cxx
index 859fd1c50498..05b1e5874643 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -135,12 +135,6 @@ OUString utl::ConfigManager::getProductVersion() {
 "Product/ooSetupVersion");
 }
 
-OUString utl::ConfigManager::getLastProductVersion() {
-return getConfigurationString(
-"/org.openoffice.Setup",
-"Product/ooSetupLastVersion");
-}
-
 OUString utl::ConfigManager::getVendor() {
 return getConfigurationString(
 "/org.openoffice.Setup",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/unotools officecfg/registry sw/source sw/uiconfig unotools/Library_utl.mk unotools/source

2019-02-16 Thread Libreoffice Gerrit user
 include/unotools/compatibilityviewoptions.hxx |   40 ++
 include/unotools/itemholderbase.hxx   |1 
 officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs |   13 
 sw/source/ui/config/optcomp.cxx   |   29 +
 sw/source/uibase/inc/optcomp.hxx  |7 
 sw/uiconfig/swriter/ui/optcompatpage.ui   |   81 
 unotools/Library_utl.mk   |1 
 unotools/source/config/compatibilityviewoptions.cxx   |  171 
++
 unotools/source/config/itemholder1.cxx|5 
 9 files changed, 347 insertions(+), 1 deletion(-)

New commits:
commit 11669b9cf970d953d41b8dd2c5ce85d6fa7e31ef
Author: Tamás Zolnai 
AuthorDate: Fri Feb 15 18:34:56 2019 +0100
Commit: Tamás Zolnai 
CommitDate: Sat Feb 16 15:58:02 2019 +0100

MSForms: Introduce a new compatibility flag to enable MS compatible Forms 
menu

* It's a global option not a document level setting (like other 
compatibility
options) so I created a separate section on the GUI for this option on the
same tab page.
* In the configuration the option is placed under Compatibility/View since
the existing Compatibility/FormattingOptions seems related to document 
formating
and not the GUI.
* Since it was added with a new configuration root I needed to add also a 
new
ConfigItem derviative class to handle this option.

Change-Id: I54668ae9808a1ca3c3b7fe81f2f201720257b3fb
Reviewed-on: https://gerrit.libreoffice.org/67902
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai 

diff --git a/include/unotools/compatibilityviewoptions.hxx 
b/include/unotools/compatibilityviewoptions.hxx
new file mode 100644
index ..573979714e7e
--- /dev/null
+++ b/include/unotools/compatibilityviewoptions.hxx
@@ -0,0 +1,40 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_SVTOOLS_COMPATIBILITYVIEWOPTIONS_HXX
+#define INCLUDED_SVTOOLS_COMPATIBILITYVIEWOPTIONS_HXX
+
+#include 
+#include 
+#include 
+
+class SvtCompatibilityViewOptions_Impl;
+
+/// Compatibility settings which affects the GUI. These are not document level 
settings
+/// (like SvtCompatibilityOptions), but global options affecting the 
application's
+/// behavior in general.
+class UNOTOOLS_DLLPUBLIC SvtCompatibilityViewOptions : public 
utl::detail::Options
+{
+public:
+SvtCompatibilityViewOptions();
+virtual ~SvtCompatibilityViewOptions() override;
+
+bool HasMSOCompatibleFormsMenu() const;
+void SetMSOCompatibleFormsMenu(bool bSet);
+
+private:
+/// Return a reference to a static mutex
+UNOTOOLS_DLLPRIVATE static osl::Mutex& GetOwnStaticMutex();
+
+std::shared_ptr m_pImpl;
+};
+
+#endif // #ifndef INCLUDED_SVTOOLS_COMPATIBILITYVIEWOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/unotools/itemholderbase.hxx 
b/include/unotools/itemholderbase.hxx
index 865d45e8b4d8..b401de3435c1 100644
--- a/include/unotools/itemholderbase.hxx
+++ b/include/unotools/itemholderbase.hxx
@@ -37,6 +37,7 @@ enum class EItem
 CmdOptions,
 ColorConfig   ,   // 2
 Compatibility ,
+CompatibilityView ,
 CTLOptions,   // 2
 
 DefaultOptions,
diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
index a47d27074cba..7c587319beef 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
@@ -151,5 +151,18 @@
 
   
 
+
+  
+Compatibility options affecting GUI
+  
+  
+
+
+  Specifies whether Forms menu should be customized for an MSO 
workflow. The MS compatible Forms menu contains only MS compatible form 
controls.
+  Reorganize Forms menu to have it MS compatible.
+
+false
+  
+
   
 
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 1204eacc6314..dbb622ece3ad 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -51,10 +51,14 @@ SwCompatibilityOptPage::SwCompatibilityOptPage(vcl::Window* 
pParent, const SfxIt
 , m_pWrtShell(nullptr)
 , m_pImpl(new SwCompatibilityOptPage_Impl)
 , m_nSavedOptions(0)
+, m_bSavedMSFormsMenuOption(false)
 {
 get(m_pMain, 

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

2018-12-06 Thread Libreoffice Gerrit user
 include/unotools/fontcvt.hxx |6 +-
 unotools/source/misc/fontcvt.cxx |2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)

New commits:
commit e57d61f9c052c4ebb3f940a67ed6dddf26ad5cf0
Author: Noel Grandin 
AuthorDate: Wed Dec 5 17:00:48 2018 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 7 07:39:31 2018 +0100

the FontToSubsFontFlags enum is not a bitmask

Change-Id: I76a777a1da15df60f283b8f3fbfd36dd05244705
Reviewed-on: https://gerrit.libreoffice.org/64717
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/fontcvt.hxx b/include/unotools/fontcvt.hxx
index f24a5e3e48ae..2877e18972ea 100644
--- a/include/unotools/fontcvt.hxx
+++ b/include/unotools/fontcvt.hxx
@@ -28,12 +28,8 @@
 enum class FontToSubsFontFlags
 {
 IMPORT   = 0x01,
-EXPORT   = 0x02,
+EXPORT   = 0x02
 };
-namespace o3tl
-{
-template<> struct typed_flags : 
is_typed_flags {};
-}
 
 typedef void* FontToSubsFontConverter;
 UNOTOOLS_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter( 
const OUString& rFontName, FontToSubsFontFlags nFlags );
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index 8a47fdb27495..663954c1bfc1 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1387,7 +1387,7 @@ FontToSubsFontConverter CreateFontToSubsFontConverter( 
const OUString& rOrgName,
 
 OUString aName = GetEnglishSearchFontName( rOrgName );
 
-if ( nFlags & FontToSubsFontFlags::IMPORT )
+if ( nFlags == FontToSubsFontFlags::IMPORT )
 {
 const int nEntries = 2; // only StarMath+StarBats
 for( int i = 0; i < nEntries; ++i )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-11-13 Thread Libreoffice Gerrit user
 include/unotools/datetime.hxx |1 
 sfx2/source/dialog/dinfdlg.cxx|   42 +++---
 unotools/source/misc/datetime.cxx |9 
 3 files changed, 14 insertions(+), 38 deletions(-)

New commits:
commit bad2196674764d67f19b276c1f6327dc3394e01a
Author: Samuel Mehrbrodt 
AuthorDate: Mon Nov 12 08:21:20 2018 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Tue Nov 13 12:06:30 2018 +0100

Use shared methods instead of duplicated code

Change-Id: I42836dcd1ef3f95d90e6e8897efff9cab7cc23fd
Reviewed-on: https://gerrit.libreoffice.org/63276
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/unotools/datetime.hxx b/include/unotools/datetime.hxx
index bd630e2ffca2..2f55faedbc2a 100644
--- a/include/unotools/datetime.hxx
+++ b/include/unotools/datetime.hxx
@@ -38,6 +38,7 @@ namespace utl
 UNOTOOLS_DLLPUBLIC const LocaleDataWrapper& GetLocaleData();
 UNOTOOLS_DLLPUBLIC DateTime GetDateTime(const css::util::DateTime& _rDT);
 UNOTOOLS_DLLPUBLIC OUString GetDateTimeString(const css::util::DateTime& 
_rDT);
+UNOTOOLS_DLLPUBLIC OUString GetDateTimeString(sal_Int32 _nDate, sal_Int32 
_nTime);
 UNOTOOLS_DLLPUBLIC OUString GetDateString(const css::util::DateTime& _rDT);
 
 UNOTOOLS_DLLPUBLIC void typeConvert(const Date& _rDate, css::util::Date& 
_rOut);
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 9f11b03295bd..9199e25ba2e5 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -24,9 +24,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -703,42 +705,6 @@ void SfxDocumentDescPage::Reset(const SfxItemSet *rSet)
 }
 }
 
-namespace
-{
-OUString GetDateTimeString( sal_Int32 _nDate, sal_Int32 _nTime )
-{
-const LocaleDataWrapper& rWrapper( 
Application::GetSettings().GetLocaleDataWrapper() );
-
-Date aDate( _nDate );
-tools::Time aTime( _nTime * tools::Time::nanoPerCenti );
-OUString aStr = rWrapper.getDate( aDate )
-  + ", "
-  + rWrapper.getTime( aTime );
-return aStr;
-}
-
-// copy from xmlsecurity/source/dialog/resourcemanager.cxx
-OUString GetContentPart( const OUString& _rRawString, const OUString& 
_rPartId )
-{
-OUString s;
-
-sal_Int32  nContStart = _rRawString.indexOf( _rPartId );
-if ( nContStart != -1 )
-{
-nContStart = nContStart + _rPartId.getLength();
-++nContStart; // now its start of content, directly after Id
-
-sal_Int32  nContEnd = _rRawString.indexOf( ',', nContStart );
-if (nContEnd != -1)
-s = _rRawString.copy( nContStart, nContEnd - nContStart );
-else
-s = _rRawString.copy(nContStart);
-}
-
-return s;
-}
-}
-
 SfxDocumentPage::SfxDocumentPage(vcl::Window* pParent, const SfxItemSet& 
rItemSet)
 : SfxTabPage(pParent, "DocumentInfoPage", "sfx/ui/documentinfopage.ui", 
)
 , bEnableUseUserData( false )
@@ -888,9 +854,9 @@ void SfxDocumentPage::ImplUpdateSignatures()
 else if ( aInfos.getLength() == 1 )
 {
 const security::DocumentSignatureInformation& rInfo = aInfos[ 
0 ];
-s = GetDateTimeString( rInfo.SignatureDate, 
rInfo.SignatureTime );
+s = utl::GetDateTimeString( rInfo.SignatureDate, 
rInfo.SignatureTime );
 s += ", ";
-s += GetContentPart( rInfo.Signer->getSubjectName(), "CN" );
+s += 
comphelper::xmlsec::GetContentPart(rInfo.Signer->getSubjectName());
 }
 m_pSignedValFt->SetText( s );
 }
diff --git a/unotools/source/misc/datetime.cxx 
b/unotools/source/misc/datetime.cxx
index 979db79e13cd..3c2da9f6586e 100644
--- a/unotools/source/misc/datetime.cxx
+++ b/unotools/source/misc/datetime.cxx
@@ -212,6 +212,15 @@ OUString GetDateTimeString(const css::util::DateTime& _rDT)
 return rLoDa.getDate(aDT) + " " + rLoDa.getTime(aDT);
 }
 
+OUString GetDateTimeString(sal_Int32 _nDate, sal_Int32 _nTime)
+{
+const LocaleDataWrapper& rLoDa = GetLocaleData();
+
+Date aDate(_nDate);
+tools::Time aTime(_nTime * tools::Time::nanoPerCenti);
+return rLoDa.getDate(aDate) + ", " + rLoDa.getTime(aTime);
+}
+
 OUString GetDateString(const css::util::DateTime& _rDT)
 {
 return GetLocaleData().getDate(GetDateTime(_rDT));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-11-04 Thread Libreoffice Gerrit user
 include/unotools/localedatawrapper.hxx |2 
 unotools/source/i18n/localedatawrapper.cxx |  419 +++--
 2 files changed, 168 insertions(+), 253 deletions(-)

New commits:
commit d9013f6a3961c8651ca3d024acef67428884726e
Author: Noel Grandin 
AuthorDate: Mon Oct 29 12:11:23 2018 +0200
Commit: Noel Grandin 
CommitDate: Mon Nov 5 07:38:35 2018 +0100

loplugin:useuniqueptr in LocaleDataWrapper

just use OUStringBuffer here, and consequently avoid re-implementing
such string-buffer handling code

Change-Id: I61e39dada6f46478b9d289f0310bb6846eb9868b
Reviewed-on: https://gerrit.libreoffice.org/62646
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/localedatawrapper.hxx 
b/include/unotools/localedatawrapper.hxx
index 3e97eeb2b7f9..04650e29f7b6 100644
--- a/include/unotools/localedatawrapper.hxx
+++ b/include/unotools/localedatawrapper.hxx
@@ -119,7 +119,7 @@ class UNOTOOLS_DLLPUBLIC LocaleDataWrapper
 voidgetDefaultCalendarImpl();
 voidgetSecondaryCalendarImpl();
 
-sal_Unicode*ImplAddFormatNum( sal_Unicode* pBuf,
+voidImplAddFormatNum( rtl::OUStringBuffer& rBuf,
 sal_Int64 nNumber, sal_uInt16 nDecimals,
 bool bUseThousandSep, bool bTrailingZeros ) const;
 
diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index b9b4b78a85c2..c7c651b3c9dc 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -1119,7 +1119,7 @@ const css::uno::Sequence< sal_Int32 > 
LocaleDataWrapper::getDigitGrouping() cons
 // The ImplAdd... methods are taken from class International and modified to
 // suit the needs.
 
-static sal_Unicode* ImplAddUNum( sal_Unicode* pBuf, sal_uInt64 nNumber )
+static void ImplAddUNum( OUStringBuffer& rBuf, sal_uInt64 nNumber )
 {
 // fill temp buffer with digits
 sal_Unicode aTempBuf[64];
@@ -1136,15 +1136,12 @@ static sal_Unicode* ImplAddUNum( sal_Unicode* pBuf, 
sal_uInt64 nNumber )
 do
 {
 pTempBuf--;
-*pBuf = *pTempBuf;
-pBuf++;
+rBuf.append(*pTempBuf);
 }
 while ( pTempBuf != aTempBuf );
-
-return pBuf;
 }
 
-static sal_Unicode* ImplAddUNum( sal_Unicode* pBuf, sal_uInt64 nNumber, int 
nMinLen )
+static void ImplAddUNum( OUStringBuffer& rBuf, sal_uInt64 nNumber, int nMinLen 
)
 {
 // fill temp buffer with digits
 sal_Unicode aTempBuf[64];
@@ -1161,8 +1158,7 @@ static sal_Unicode* ImplAddUNum( sal_Unicode* pBuf, 
sal_uInt64 nNumber, int nMin
 // fill with zeros up to the minimal length
 while ( nMinLen > 0 )
 {
-*pBuf = '0';
-pBuf++;
+rBuf.append('0');
 nMinLen--;
 }
 
@@ -1170,25 +1166,22 @@ static sal_Unicode* ImplAddUNum( sal_Unicode* pBuf, 
sal_uInt64 nNumber, int nMin
 do
 {
 pTempBuf--;
-*pBuf = *pTempBuf;
-pBuf++;
+rBuf.append(*pTempBuf);
 }
 while ( pTempBuf != aTempBuf );
-
-return pBuf;
 }
 
-static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, sal_Int64 nNumber, int 
nMinLen )
+static void ImplAddNum( OUStringBuffer& rBuf, sal_Int64 nNumber, int nMinLen )
 {
 if (nNumber < 0)
 {
-*pBuf++ = '-';
+rBuf.append('-');
 nNumber = -nNumber;
 }
-return ImplAddUNum( pBuf, nNumber, nMinLen);
+return ImplAddUNum( rBuf, nNumber, nMinLen);
 }
 
-static sal_Unicode* ImplAdd2UNum( sal_Unicode* pBuf, sal_uInt16 nNumber, bool 
bLeading )
+static void ImplAdd2UNum( OUStringBuffer& rBuf, sal_uInt16 nNumber, bool 
bLeading )
 {
 DBG_ASSERT( nNumber < 100, "ImplAdd2UNum() - Number >= 100" );
 
@@ -1196,25 +1189,20 @@ static sal_Unicode* ImplAdd2UNum( sal_Unicode* pBuf, 
sal_uInt16 nNumber, bool bL
 {
 if ( bLeading )
 {
-*pBuf = '0';
-pBuf++;
+rBuf.append('0');
 }
-*pBuf = nNumber + '0';
+rBuf.append(static_cast(nNumber + '0'));
 }
 else
 {
 sal_uInt16 nTemp = nNumber % 10;
 nNumber /= 10;
-*pBuf = nNumber + '0';
-pBuf++;
-*pBuf = nTemp + '0';
+rBuf.append(static_cast(nNumber + '0'));
+rBuf.append(static_cast(nTemp + '0'));
 }
-
-pBuf++;
-return pBuf;
 }
 
-static sal_Unicode* ImplAdd9UNum( sal_Unicode* pBuf, sal_uInt32 nNumber )
+static void ImplAdd9UNum( OUStringBuffer& rBuf, sal_uInt32 nNumber )
 {
 DBG_ASSERT( nNumber < 10, "ImplAdd9UNum() - Number >= 10" 
);
 
@@ -1223,99 +1211,55 @@ static sal_Unicode* ImplAdd9UNum( sal_Unicode* pBuf, 
sal_uInt32 nNumber )
 ostr.width(9);
 ostr << nNumber;
 std::string aStr = ostr.str();
-for(const char *pAB= aStr.c_str(); *pAB != '\0'; ++pAB, ++pBuf)
-{
-*pBuf = *pAB;
-}
-
-return pBuf;
-}
-
-static sal_Unicode* ImplAddString( 

[Libreoffice-commits] core.git: include/unotools solenv/clang-format

2018-10-29 Thread Libreoffice Gerrit user
 include/unotools/streamsection.hxx |   71 -
 solenv/clang-format/blacklist  |1 
 2 files changed, 72 deletions(-)

New commits:
commit 98f4f6442c234df1fc98832c2716348085fdfd83
Author: Gabor Kelemen 
AuthorDate: Sun Oct 28 10:00:35 2018 +0100
Commit: Noel Grandin 
CommitDate: Mon Oct 29 07:19:00 2018 +0100

Drop unused header

Found while cleaning up unotools with IWYU
The same OStreamSection class is is implemented in comphelper
about since 2c23e6959a2dfd45d904308e5c7dfe456408a652 (this was in 2000!)

Change-Id: I464ece9ff84536d5332caa0f285856d3fe358e5b
Reviewed-on: https://gerrit.libreoffice.org/62470
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/streamsection.hxx 
b/include/unotools/streamsection.hxx
deleted file mode 100644
index 74626d2bed4e..
--- a/include/unotools/streamsection.hxx
+++ /dev/null
@@ -1,71 +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_UNOTOOLS_STREAMSECTION_HXX
-#define INCLUDED_UNOTOOLS_STREAMSECTION_HXX
-
-#include 
-#include 
-#include 
-
-namespace utl
-{
-
-/** implements handling for compatibly reading/writing data from/into an 
input/output stream.
-data written in a block secured by this class should be readable by older 
versions which
-use the same mechanism.
-*/
-
-class OStreamSection
-{
-css::uno::Reference< css::io::XMarkableStream >   m_xMarkStream;
-css::uno::Reference< css::io::XDataInputStream >  m_xInStream;
-css::uno::Reference< css::io::XDataOutputStream > m_xOutStream;
-
-sal_Int32   m_nBlockStart;
-sal_Int32   m_nBlockLen;
-
-public:
-/** starts reading of a "skippable" section of data within the given input 
stream
-@param  _rxInputthe stream to read from. Must support the
-css::io::XMarkableStream interface
-*/
-OStreamSection(const css::uno::Reference< css::io::XDataInputStream >& 
_rxInput);
-
-/** starts writing of a "skippable" section of data into the given output 
stream
-@param  _rxOutput   the stream the stream to write to. 
Must support the
-css::io::XMarkableStream interface
-@param  _nPresumedLengthestimation for the length of the 
upcoming section. If greater 0, this
-value will be written as section 
length and corrected (in the dtor) only if
-needed. If you know how much bytes you 
are about to write, you may
-want to use this param, saving some 
stream operations this way.
-*/
-OStreamSection(const css::uno::Reference< css::io::XDataOutputStream >& 
_rxOutput, sal_Int32 _nPresumedLength = 0);
-
-/** dtor. If constructed for writing, the section "opened" by this 
object will be "closed".
-If constructed for reading, any remaining bytes 'til the end of the 
section will be skipped.
-*/
-~OStreamSection();
-};
-
-}   // namespace utl
-
-#endif // INCLUDED_UNOTOOLS_STREAMSECTION_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 882ab4206688..2c9172ff98d4 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -7859,7 +7859,6 @@ include/unotools/searchopt.hxx
 include/unotools/securityoptions.hxx
 include/unotools/sharedunocomponent.hxx
 include/unotools/streamhelper.hxx
-include/unotools/streamsection.hxx
 include/unotools/streamwrap.hxx
 include/unotools/syslocale.hxx
 include/unotools/syslocaleoptions.hxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/unotools sc/inc sc/source solenv/bin unotools/source

2018-10-09 Thread Libreoffice Gerrit user
 include/unotools/resmgr.hxx|1 +
 sc/inc/scresid.hxx |1 +
 sc/inc/strings.hrc |3 ++-
 sc/source/ui/app/scdll.cxx |5 +
 sc/source/ui/dialogs/searchresults.cxx |4 ++--
 sc/source/ui/inc/searchresults.hxx |1 -
 solenv/bin/hrcex   |2 +-
 unotools/source/i18n/resmgr.cxx|   26 ++
 8 files changed, 38 insertions(+), 5 deletions(-)

New commits:
commit 283229f5bc27ce23456b9cbd9aff75ff44707105
Author: Caolán McNamara 
AuthorDate: Fri Oct 5 15:48:01 2018 +0100
Commit: Caolán McNamara 
CommitDate: Tue Oct 9 09:52:33 2018 +0200

Related: tdf#83128 support translation of plural forms

Change-Id: Id3d41099a895ca5423be2ac3d497851bc65eaff7
Reviewed-on: https://gerrit.libreoffice.org/61426
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/unotools/resmgr.hxx b/include/unotools/resmgr.hxx
index 65e730bd0021..8da6aefac60c 100644
--- a/include/unotools/resmgr.hxx
+++ b/include/unotools/resmgr.hxx
@@ -29,6 +29,7 @@ namespace Translate
 {
 UNOTOOLS_DLLPUBLIC std::locale Create(const sal_Char* pPrefixName, const 
LanguageTag& rLocale = SvtSysLocale().GetUILanguageTag());
 UNOTOOLS_DLLPUBLIC OUString get(const char* pId, const std::locale );
+UNOTOOLS_DLLPUBLIC OUString nget(const char* pId, int n, const std::locale 
);
 UNOTOOLS_DLLPUBLIC void SetReadStringHook( ResHookProc pProc );
 UNOTOOLS_DLLPUBLIC ResHookProc GetReadStringHook();
 UNOTOOLS_DLLPUBLIC OUString ExpandVariables(const OUString& rString);
diff --git a/sc/inc/scresid.hxx b/sc/inc/scresid.hxx
index e7bdb167ca5d..5a63bd809fb5 100644
--- a/sc/inc/scresid.hxx
+++ b/sc/inc/scresid.hxx
@@ -24,6 +24,7 @@
 #include "scdllapi.h"
 
 OUString SC_DLLPUBLIC ScResId(const char* pId);
+OUString SC_DLLPUBLIC ScResId(const char* pId, int nCardinality);
 
 #endif // SC_SCRESMGR_HXX
 
diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index 17916a1ab5ba..dc606e3bd379 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/strings.hrc
@@ -21,6 +21,7 @@
 #define INCLUDED_SC_INC_STRINGS_HRC
 
 #define NC_(Context, String) (Context "\004" u8##String)
+#define NNC_(Context, StringSingular, StringPlural) (Context "\004" 
u8##StringSingular "\004" u8##StringPlural)
 
 // Strings for interface names ---
 
@@ -49,7 +50,7 @@
 #define SCSTR_RENAMEOBJECT  NC_("SCSTR_RENAMEOBJECT", 
"Name Object")
 #define STR_INSERTGRAPHIC   NC_("STR_INSERTGRAPHIC", 
"Insert Image")
 #define STR_QUERYROTATION   NC_("STR_QUERYROTATION", 
"This image is rotated. Would you like to rotate it into standard orientation?")
-#define SCSTR_TOTAL NC_("SCSTR_TOTAL", "%1 
results found")
+#define SCSTR_TOTAL NNC_("SCSTR_TOTAL", "1 
result found", "%1 results found")
 #define SCSTR_SKIPPED   NC_("SCSTR_SKIPPED", 
"(only %1 are listed)")
 // Attribute
 #define SCSTR_PROTECTDOCNC_("SCSTR_PROTECTDOC", 
"Protect Spreadsheet Structure")
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 406a0eac4c34..435cb6fa1549 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -113,6 +113,11 @@ OUString ScResId(const char* pId)
 return Translate::get(pId, SC_MOD()->GetResLocale());
 }
 
+OUString ScResId(const char* pId, int nCardinality)
+{
+return Translate::nget(pId, nCardinality, SC_MOD()->GetResLocale());
+}
+
 void ScDLL::Init()
 {
 if ( SfxApplication::GetModule(SfxToolsModule::Calc) )// Module 
already active
diff --git a/sc/source/ui/dialogs/searchresults.cxx 
b/sc/source/ui/dialogs/searchresults.cxx
index 38facd11121b..436e0ec0ab99 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -26,7 +26,6 @@ namespace sc {
 SearchResultsDlg::SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* 
pParent ) :
 ModelessDialog(pParent, "SearchResultsDialog", 
"modules/scalc/ui/searchresults.ui"),
 aSkipped( ScResId( SCSTR_SKIPPED ) ),
-aTotal( ScResId( SCSTR_TOTAL ) ),
 mpBindings(_pBindings), mpDoc(nullptr)
 {
 get(mpSearchResults, "lbSearchResults");
@@ -148,7 +147,8 @@ void SearchResultsDlg::FillResults( ScDocument* pDoc, const 
ScRangeList 
 }
 }
 
-OUString aSearchResults = ScGlobal::ReplaceOrAppend( aTotal, "%1", 
OUString::number( aList.mnCount ) );
+OUString aTotal(ScResId(SCSTR_TOTAL, aList.mnCount));
+OUString aSearchResults = aTotal.replaceFirst("%1", 
OUString::number(aList.mnCount));
 if (aList.mnCount > ListWrapper::mnMaximum)
 aSearchResults += " " + ScGlobal::ReplaceOrAppend( aSkipped, "%1", 
OUString::number( ListWrapper::mnMaximum ) );
 mpSearchResults->SetText(aSearchResults);
diff 

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

2018-10-01 Thread Libreoffice Gerrit user
 include/unotools/options.hxx   |1 +
 unotools/source/config/options.cxx |   12 
 2 files changed, 13 insertions(+)

New commits:
commit f780a64a4f62bb7884d9dcfd984dc96ab737b34e
Author: Stephan Bergmann 
AuthorDate: Mon Oct 1 18:01:31 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Oct 1 23:16:00 2018 +0200

Consistently have both copy functions for utl::ConfigurationBroadcaster

The ctor was added with d1e47b1428abf1732ab4d5e219b210760d4152e0 "enhance
useuniqueptr loplugin" apparently because it was needed and the implicitly
declared one stareted to be defined as deleted, while the assignment op was
left implicitly defined as deleted (presumably because it wasn't needed 
anyway).

Adding a non-deleted definition of the assignment op probably is a good move
towards consistency, and was assumed it could help avoid new Clang trunk
-Werror,-Wdefaulted-function-deleted in derived ConfigItem
(include/unotools/configitem.hxx), but which appears not to be the case.

And ConfigurationBroadcaster can't easily switch from copy to move 
semantics, as
SdOptionsLayoutItem::Clone needs SdOptionsLayoutItem copy ctor needs
SdOptionsLayout copy ctor needs SdOptionsGeneric copy ctor needs
SdOptionsItem copy ctor needs utl::ConfigItem copy ctor needs
utl::ConfigurationBroadcaster copy ctor.

Change-Id: Ie1f4e72eacb9b6b776103c4cf04a959acfa6648f
Reviewed-on: https://gerrit.libreoffice.org/61208
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/include/unotools/options.hxx b/include/unotools/options.hxx
index 22a731b501ef..8df85d04858c 100644
--- a/include/unotools/options.hxx
+++ b/include/unotools/options.hxx
@@ -80,6 +80,7 @@ namespace utl {
 ConfigurationBroadcaster();
 ConfigurationBroadcaster(ConfigurationBroadcaster const & );
 virtual ~ConfigurationBroadcaster();
+ConfigurationBroadcaster & operator =(ConfigurationBroadcaster const & 
other);
 virtual void BlockBroadcasts( bool bBlock );
 };
 
diff --git a/unotools/source/config/options.cxx 
b/unotools/source/config/options.cxx
index 11a396287ad8..977f185b42b8 100644
--- a/unotools/source/config/options.cxx
+++ b/unotools/source/config/options.cxx
@@ -42,6 +42,18 @@ ConfigurationBroadcaster::~ConfigurationBroadcaster()
 {
 }
 
+ConfigurationBroadcaster & ConfigurationBroadcaster::operator =(
+ConfigurationBroadcaster const & other)
+{
+if ( != this) {
+mpList.reset(
+other.mpList == nullptr ? nullptr : new 
IMPL_ConfigurationListenerList(*other.mpList));
+m_nBroadcastBlocked = other.m_nBroadcastBlocked;
+m_nBlockedHint = other.m_nBlockedHint;
+}
+return *this;
+}
+
 void ConfigurationBroadcaster::AddListener( utl::ConfigurationListener* 
pListener )
 {
 if ( !mpList )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/unotools unotools/source unoxml/source uui/source

2018-09-19 Thread Libreoffice Gerrit user
 include/unotools/configitem.hxx|2 +-
 include/unotools/intlwrapper.hxx   |2 +-
 include/unotools/streamhelper.hxx  |2 +-
 include/unotools/tempfile.hxx  |2 +-
 include/unotools/transliterationwrapper.hxx|2 +-
 include/unotools/viewoptions.hxx   |4 ++--
 unotools/source/config/configvaluecontainer.cxx|2 +-
 unotools/source/config/defaultoptions.cxx  |4 ++--
 unotools/source/config/extendedsecurityoptions.cxx |2 +-
 unotools/source/config/fontcfg.cxx |8 
 unotools/source/config/lingucfg.cxx|2 +-
 unotools/source/config/optionsdlg.cxx  |   16 +---
 unotools/source/config/pathoptions.cxx |4 ++--
 unotools/source/config/viewoptions.cxx |2 +-
 unotools/source/misc/wincodepage.cxx   |   12 ++--
 unoxml/source/dom/document.cxx |2 +-
 unoxml/source/rdf/librdf_repository.cxx|2 +-
 uui/source/fltdlg.cxx  |2 +-
 uui/source/logindlg.hxx|4 ++--
 uui/source/passworddlg.hxx |2 +-
 20 files changed, 40 insertions(+), 38 deletions(-)

New commits:
commit d8ac55e3e53564aca4b0bade5a5b5cb01b4519b1
Author: Noel Grandin 
AuthorDate: Mon Sep 17 12:23:50 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 19 08:44:52 2018 +0200

loplugin:constfields in unotools..uui

Change-Id: I9d9cfd107bea9556cbc505e977838fb13bd25e2a
Reviewed-on: https://gerrit.libreoffice.org/60573
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx
index 302fa0bdde5b..e49e7a552709 100644
--- a/include/unotools/configitem.hxx
+++ b/include/unotools/configitem.hxx
@@ -77,7 +77,7 @@ namespace utl
 m_xHierarchyAccess;
 css::uno::Reference< css::util::XChangesListener >
 xChangeLstnr;
-ConfigItemMode  m_nMode;
+ConfigItemMode const  m_nMode;
 boolm_bIsModified;
 boolm_bEnableInternalNotification;
 sal_Int16   m_nInValueChange;
diff --git a/include/unotools/intlwrapper.hxx b/include/unotools/intlwrapper.hxx
index ffcb3313b349..cf1ea94682f4 100644
--- a/include/unotools/intlwrapper.hxx
+++ b/include/unotools/intlwrapper.hxx
@@ -48,7 +48,7 @@
 class UNOTOOLS_DLLPUBLIC IntlWrapper
 {
 private:
-LanguageTag maLanguageTag;
+LanguageTag const maLanguageTag;
 css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
 std::unique_ptr  pLocaleData;
diff --git a/include/unotools/streamhelper.hxx 
b/include/unotools/streamhelper.hxx
index 3758aec86286..99e9e708aa97 100644
--- a/include/unotools/streamhelper.hxx
+++ b/include/unotools/streamhelper.hxx
@@ -38,7 +38,7 @@ class UNOTOOLS_DLLPUBLIC OInputStreamHelper : public 
cppu::WeakImplHelper
 pStream;
-boolbIsDirectory;
+bool constbIsDirectory;
 boolbKillingFileEnabled;
 
 public:
diff --git a/include/unotools/transliterationwrapper.hxx 
b/include/unotools/transliterationwrapper.hxx
index 0726d6caf139..7afdbf44411e 100644
--- a/include/unotools/transliterationwrapper.hxx
+++ b/include/unotools/transliterationwrapper.hxx
@@ -39,7 +39,7 @@ class UNOTOOLS_DLLPUBLIC TransliterationWrapper
 {
 css::uno::Reference< css::i18n::XExtendedTransliteration > xTrans;
 LanguageTag aLanguageTag;
-TransliterationFlags nType;
+TransliterationFlags const nType;
 mutable bool bFirstCall;
 
 TransliterationWrapper( const TransliterationWrapper& ) = delete;
diff --git a/include/unotools/viewoptions.hxx b/include/unotools/viewoptions.hxx
index 83bc1922b965..0948925756d2 100644
--- a/include/unotools/viewoptions.hxx
+++ b/include/unotools/viewoptions.hxx
@@ -235,8 +235,8 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions : 
public utl::detail::Op
 
 /// specify which list of views in configuration is used! This can't 
be a static value!!!
 /// ... because we need this value to work with right static data 
container.
-EViewType   m_eViewType;
-OUString m_sViewName;
+EViewType const   m_eViewType;
+OUString const m_sViewName;
 
 /*Attention
 
diff --git a/unotools/source/config/configvaluecontainer.cxx 
b/unotools/source/config/configvaluecontainer.cxx
index 894e665cf9fc..ce9853aaa0b4 100644
--- a/unotools/source/config/configvaluecontainer.cxx
+++ b/unotools/source/config/configvaluecontainer.cxx
@@ -43,7 +43,7 @@ namespace utl
 struct NodeValueAccessor
 {
 private:
-OUString

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

2018-08-13 Thread Libreoffice Gerrit user
 include/unotools/configmgr.hxx   |4 
 unotools/source/config/configmgr.cxx |2 ++
 2 files changed, 6 insertions(+)

New commits:
commit 9a26c243a8c81724b557355471818f7fe238ed64
Author: Caolán McNamara 
AuthorDate: Mon Aug 13 16:22:30 2018 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 13 22:15:42 2018 +0200

short-circuit IsFuzzing when FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION 
defined

Change-Id: Ib82daad19185de3d271adee3cdb6d39a35e9c082
Reviewed-on: https://gerrit.libreoffice.org/58941
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/unotools/configmgr.hxx b/include/unotools/configmgr.hxx
index fd2dbb2455c2..5205c9d1664e 100644
--- a/include/unotools/configmgr.hxx
+++ b/include/unotools/configmgr.hxx
@@ -74,7 +74,11 @@ public:
 // Avoid using the config layer and rely on defaults which is only useful
 // for special test tool targets (typically fuzzing) where start-up speed
 // is of the essence
+#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
+static constexpr bool IsFuzzing() { return true; }
+#else
 static bool IsFuzzing();
+#endif
 static void EnableFuzzing();
 
 private:
diff --git a/unotools/source/config/configmgr.cxx 
b/unotools/source/config/configmgr.cxx
index 664282e289d9..d07f6c164598 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -199,10 +199,12 @@ void utl::ConfigManager::doStoreConfigItems() {
 
 static bool bIsFuzzing = false;
 
+#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 bool utl::ConfigManager::IsFuzzing()
 {
 return bIsFuzzing;
 }
+#endif
 
 void utl::ConfigManager::EnableFuzzing()
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-27 Thread Libreoffice Gerrit user
 include/unotools/collatorwrapper.hxx |2 --
 include/unotools/compatibility.hxx   |1 -
 include/unotools/configitem.hxx  |5 +
 include/unotools/confignode.hxx  |4 
 unotools/source/config/compatibility.cxx |4 
 unotools/source/i18n/collatorwrapper.cxx |4 
 6 files changed, 5 insertions(+), 15 deletions(-)

New commits:
commit 7f0bdd5e88ed49eebe3c0c8edabecffdddeaff4f
Author: Stephan Bergmann 
AuthorDate: Thu Jul 26 13:46:27 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jul 27 08:19:50 2018 +0200

unotools: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)

...by explicitly defaulting the copy/move functions (and, where needed in 
turn,
also a default ctor) for classes that have a user-declared dtor that does
nothing other than an implicitly-defined one would do, but needs to be user-
declared because it is virtual and potentially serves as a key function to
emit the vtable, or is non-public, etc.; and by removing explicitly user-
provided functions that do the same as their implicitly-defined 
counterparts,
but may prevent implicitly declared copy functions from being defined as 
non-
deleted in the future.  (Even if such a user-provided function was declared
non-inline in an include file, the apparently-used implicitly-defined copy
functions are already include, so why bother with non-inline functions.)

Change-Id: Iaa08ef916a2d266e011a2cb66592b377cb1eb23c
Reviewed-on: https://gerrit.libreoffice.org/58095
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/include/unotools/collatorwrapper.hxx 
b/include/unotools/collatorwrapper.hxx
index 823ba03aada0..77a22d63682a 100644
--- a/include/unotools/collatorwrapper.hxx
+++ b/include/unotools/collatorwrapper.hxx
@@ -37,8 +37,6 @@ class UNOTOOLS_DLLPUBLIC CollatorWrapper
 CollatorWrapper (
 const css::uno::Reference< css::uno::XComponentContext > 
);
 
-~CollatorWrapper();
-
sal_Int32
 compareString (
 const OUString& s1, const OUString& s2) const;
diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index b48d453fb3fc..cc79b28da922 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -67,7 +67,6 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityEntry
 };
 
 SvtCompatibilityEntry();
-~SvtCompatibilityEntry();
 
 static OUString getName( const Index rIdx );
 
diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx
index 5a842a1193be..302fa0bdde5b 100644
--- a/include/unotools/configitem.hxx
+++ b/include/unotools/configitem.hxx
@@ -165,6 +165,11 @@ namespace utl
 public:
 virtual ~ConfigItem() override;
 
+ConfigItem(ConfigItem const &) = default;
+ConfigItem(ConfigItem &&) = default;
+ConfigItem & operator =(ConfigItem const &) = default;
+ConfigItem & operator =(ConfigItem &&) = default;
+
 /** is called from the ConfigManager before application ends of 
from the
 PropertyChangeListener if the sub tree broadcasts changes. */
 virtual voidNotify( const 
css::uno::Sequence& aPropertyNames)=0;
diff --git a/include/unotools/confignode.hxx b/include/unotools/confignode.hxx
index 09c9bb266308..5bf4a1473da3 100644
--- a/include/unotools/confignode.hxx
+++ b/include/unotools/confignode.hxx
@@ -221,10 +221,6 @@ namespace utl
 const bool i_bUpdatable
 );
 
-/// copy ctor
-OConfigurationTreeRoot(const OConfigurationTreeRoot& _rSource)
-:OConfigurationNode(_rSource), m_xCommitter(_rSource.m_xCommitter) 
{ }
-
 /** open a new top-level configuration node
 
 opens a new node which is the root if an own configuration sub 
tree. This is what "top level" means: The
diff --git a/unotools/source/config/compatibility.cxx 
b/unotools/source/config/compatibility.cxx
index de876fd30fec..b552dc7de5bd 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -67,10 +67,6 @@ SvtCompatibilityEntry::SvtCompatibilityEntry()
 setDefaultEntry( false );
 }
 
-SvtCompatibilityEntry::~SvtCompatibilityEntry()
-{
-}
-
 OUString SvtCompatibilityEntry::getName( const Index rIdx )
 {
 static const char* sPropertyName[] =
diff --git a/unotools/source/i18n/collatorwrapper.cxx 
b/unotools/source/i18n/collatorwrapper.cxx
index 0b962264370c..4da1398e0636 100644
--- a/unotools/source/i18n/collatorwrapper.cxx
+++ b/unotools/source/i18n/collatorwrapper.cxx
@@ -30,10 +30,6 @@ CollatorWrapper::CollatorWrapper ( const uno::Reference< 
uno::XComponentContext
 mxInternationalCollator = i18n::Collator::create( rxContext );
 }
 
-CollatorWrapper::~CollatorWrapper()
-{
-}
-
 sal_Int32
 CollatorWrapper::compareString (const 

[Libreoffice-commits] core.git: include/unotools officecfg/registry sfx2/source svx/source unotools/source

2018-04-26 Thread Caolán McNamara
 include/unotools/viewoptions.hxx  |4 -
 officecfg/registry/schema/org/openoffice/Office/Views.xcs |2 
 sfx2/source/appl/newhelp.cxx  |8 +--
 sfx2/source/dialog/tabdlg.cxx |4 -
 svx/source/form/datanavi.cxx  |8 +--
 unotools/source/config/viewoptions.cxx|   29 ++
 6 files changed, 27 insertions(+), 28 deletions(-)

New commits:
commit 8d09602d3382596facd716d8261a83d6883aa734
Author: Caolán McNamara 
Date:   Wed Apr 25 13:04:43 2018 +0100

identify tab pages by name for save/storing active tab

Change-Id: Id66f8ff62ed08724702572f457b9fc857d567e89
Reviewed-on: https://gerrit.libreoffice.org/53465
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/unotools/viewoptions.hxx b/include/unotools/viewoptions.hxx
index 77e495d807fc..83bc1922b965 100644
--- a/include/unotools/viewoptions.hxx
+++ b/include/unotools/viewoptions.hxx
@@ -174,8 +174,8 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtViewOptions : 
public utl::detail::Op
 @onerrorAn assertion is thrown in debug version. Otherwise we 
do nothing!
 
*//*-*/
 
-sal_Int32 GetPageID(   ) const;
-void  SetPageID( sal_Int32 nID );
+OString GetPageID() const;
+void  SetPageID(const OString& rID);
 
 
/*-
 @short  use it to set/get the visual state of a window
diff --git a/officecfg/registry/schema/org/openoffice/Office/Views.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Views.xcs
index 63524a1d3815..a5e1998c090f 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Views.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Views.xcs
@@ -46,7 +46,7 @@
   Includes information (position,size, and states) about the 
used vcl window.
 
   
-  
+  
 
   Represents the number of an active tab page inside a 
dialog.
 
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 8a561d3b471f..a8234eaa99bf 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1427,11 +1427,11 @@ 
SfxHelpIndexWindow_Impl::SfxHelpIndexWindow_Impl(SfxHelpWindow_Impl* _pParent)
 
 m_pTabCtrl->SetActivatePageHdl( LINK( this, SfxHelpIndexWindow_Impl, 
ActivatePageHdl ) );
 
-sal_Int32 nPageId = m_pTabCtrl->GetPageId("index");
+OString sPageId("index");
 SvtViewOptions aViewOpt( EViewType::TabDialog, CONFIGNAME_INDEXWIN );
 if ( aViewOpt.Exists() )
-nPageId = aViewOpt.GetPageID();
-m_pTabCtrl->SetCurPageId( static_cast(nPageId) );
+sPageId = aViewOpt.GetPageID();
+m_pTabCtrl->SetCurPageId(m_pTabCtrl->GetPageId(sPageId));
 ActivatePageHdl( m_pTabCtrl );
 m_pActiveLB->SetSelectHdl( LINK( this, SfxHelpIndexWindow_Impl, SelectHdl 
) );
 
@@ -1460,7 +1460,7 @@ void SfxHelpIndexWindow_Impl::dispose()
 delete static_cast(m_pActiveLB->GetEntryData(i));
 
 SvtViewOptions aViewOpt( EViewType::TabDialog, CONFIGNAME_INDEXWIN );
-aViewOpt.SetPageID( static_cast(m_pTabCtrl->GetCurPageId()) );
+aViewOpt.SetPageID(m_pTabCtrl->GetPageName(m_pTabCtrl->GetCurPageId()));
 
 disposeBuilder();
 m_pActiveLB.clear();
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index f31e12784316..afc827db416d 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -591,7 +591,7 @@ void SfxTabDialog::Start_Impl()
 SetWindowState(OUStringToOString(aDlgOpt.GetWindowState(), 
RTL_TEXTENCODING_ASCII_US));
 
 // initial TabPage from Program/Help/config
-nActPage = static_cast(aDlgOpt.GetPageID());
+nActPage = m_pTabCtrl->GetPageId(aDlgOpt.GetPageID());
 
 if ( USHRT_MAX != m_nAppPageId )
 nActPage = m_nAppPageId;
@@ -775,7 +775,7 @@ void SfxTabDialog::SavePosAndId()
 SvtViewOptions aDlgOpt(EViewType::TabDialog, 
OStringToOUString(GetHelpId(),RTL_TEXTENCODING_UTF8));
 
aDlgOpt.SetWindowState(OStringToOUString(GetWindowState(WindowStateMask::Pos),RTL_TEXTENCODING_ASCII_US));
 // to-do replace with name of page when all pages are converted to .ui
-aDlgOpt.SetPageID( m_pTabCtrl->GetCurPageId() );
+aDlgOpt.SetPageID(m_pTabCtrl->GetPageName(m_pTabCtrl->GetCurPageId()));
 }
 
 
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index cdaabee98f10..3a7f2a2e7b40 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1377,11 +1377,11 @@ namespace svxform
 
 // 

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

2018-04-25 Thread Noel Grandin
 include/unotools/ucbstreamhelper.hxx  |   15 +--
 unotools/source/ucbhelper/ucbstreamhelper.cxx |   34 +-
 vcl/source/graphic/GraphicLoader.cxx  |4 +--
 3 files changed, 26 insertions(+), 27 deletions(-)

New commits:
commit 7c9d8afd913c17100aa4185e3b044137f225c81f
Author: Noel Grandin 
Date:   Wed Apr 25 10:22:25 2018 +0200

Revert "make UcbStreamHelper return SvStream by std::unique_ptr"

This reverts commit eeefb8c440b514cefdc4e82cc06843da9eabeb13.

this was pushed in error

diff --git a/include/unotools/ucbstreamhelper.hxx 
b/include/unotools/ucbstreamhelper.hxx
index d89048500bcd..68309d094acf 100644
--- a/include/unotools/ucbstreamhelper.hxx
+++ b/include/unotools/ucbstreamhelper.hxx
@@ -25,7 +25,6 @@
 #include 
 
 #include 
-#include 
 
 namespace com
 {
@@ -53,13 +52,13 @@ namespace utl
 class UNOTOOLS_DLLPUBLIC UcbStreamHelper
 {
 public:
-static std::unique_ptr CreateStream( const OUString& 
rFileName, StreamMode eOpenMode );
-static std::unique_ptr CreateStream( const OUString& 
rFileName, StreamMode eOpenMode,
- bool bFileExists );
-static std::unique_ptr CreateStream( const 
css::uno::Reference < css::io::XInputStream >& xStream );
-static std::unique_ptr CreateStream( const 
css::uno::Reference < css::io::XStream >& xStream );
-static std::unique_ptr CreateStream( const 
css::uno::Reference < css::io::XInputStream >& xStream, bool bCloseStream );
-static std::unique_ptr CreateStream( const 
css::uno::Reference < css::io::XStream >& xStream, bool bCloseStream );
+static SvStream*CreateStream( const OUString& rFileName, 
StreamMode eOpenMode );
+static SvStream*CreateStream( const OUString& rFileName, 
StreamMode eOpenMode,
+  bool bFileExists );
+static SvStream*CreateStream( const css::uno::Reference < 
css::io::XInputStream >& xStream );
+static SvStream*CreateStream( const css::uno::Reference < 
css::io::XStream >& xStream );
+static SvStream*CreateStream( const css::uno::Reference < 
css::io::XInputStream >& xStream, bool bCloseStream );
+static SvStream*CreateStream( const css::uno::Reference < 
css::io::XStream >& xStream, bool bCloseStream );
 };
 }
 
diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx 
b/unotools/source/ucbhelper/ucbstreamhelper.cxx
index 87f7d903a481..63260f632b91 100644
--- a/unotools/source/ucbhelper/ucbstreamhelper.cxx
+++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx
@@ -42,11 +42,11 @@ using namespace ::com::sun::star::beans;
 namespace utl
 {
 
-static std::unique_ptr lcl_CreateStream( const OUString& rFileName, 
StreamMode eOpenMode,
+static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode 
eOpenMode,
const Reference < XInteractionHandler >& 
xInteractionHandler,
bool bEnsureFileExists )
 {
-std::unique_ptr pStream;
+SvStream* pStream = nullptr;
 UcbLockBytesRef xLockBytes;
 if ( eOpenMode & StreamMode::WRITE )
 {
@@ -119,7 +119,7 @@ static std::unique_ptr lcl_CreateStream( const 
OUString& rFileName, St
 eOpenMode, 
xInteractionHandler );
 if ( xLockBytes.is() )
 {
-pStream.reset(new SvStream( xLockBytes.get() ));
+pStream = new SvStream( xLockBytes.get() );
 pStream->SetBufferSize( 4096 );
 pStream->SetError( xLockBytes->GetError() );
 }
@@ -137,7 +137,7 @@ static std::unique_ptr lcl_CreateStream( const 
OUString& rFileName, St
 return pStream;
 }
 
-std::unique_ptr UcbStreamHelper::CreateStream( const OUString& 
rFileName, StreamMode eOpenMode )
+SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode 
eOpenMode )
 {
 // related tdf#99312
 // create a specialized interaction handler to manages Web certificates 
and Web credentials when needed
@@ -149,7 +149,7 @@ std::unique_ptr UcbStreamHelper::CreateStream( 
const OUString& rFileNa
 return lcl_CreateStream( rFileName, eOpenMode, xIHScoped, true /* 
bEnsureFileExists */ );
 }
 
-std::unique_ptr UcbStreamHelper::CreateStream( const OUString& 
rFileName, StreamMode eOpenMode,
+SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode 
eOpenMode,
  bool bFileExists )
 {
 // related tdf#99312
@@ -162,13 +162,13 @@ std::unique_ptr UcbStreamHelper::CreateStream( 
const OUString& rFileNa
 }
 
 
-std::unique_ptr UcbStreamHelper::CreateStream( const Reference < 
XInputStream >& xStream )
+SvStream* UcbStreamHelper::CreateStream( const Reference < XInputStream >& 
xStream )
 {
-std::unique_ptr pStream;
+SvStream* pStream = nullptr;
 UcbLockBytesRef 

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

2017-12-19 Thread Stephan Bergmann
 include/unotools/itemholderbase.hxx|1 -
 unotools/source/config/itemholder1.cxx |5 -
 unotools/source/config/saveopt.cxx |3 ---
 3 files changed, 9 deletions(-)

New commits:
commit 66cd725b5f386d48252a620fb58415ddb65388ef
Author: Stephan Bergmann 
Date:   Mon Dec 18 15:24:58 2017 +0100

Don't leak SvtSaveOptions instance through ItemHolder1::holdConfigItem

...where ItemHolder1 apparently leaks the items ever since

> commit ef2c49c9a5788e35249d8d5406a09c84ecd062ee
> Author: Rüdiger Timm 
> Date:   Fri Nov 11 07:50:10 2005 +
>
> INTEGRATION: CWS perform06 (1.6.60); FILE MERGED
> 2005/11/07 13:32:40 as 1.6.60.2: #i56589# dont cache 
GlobalEventConfig() inside ItemHolder1^... combination of static pointer and 
WeakImplHelper cant not work
> 2005/10/25 08:04:02 as 1.6.60.1: #i56589# hold config items alive 
till office die

That started to cause problems when 78a6ce17f06fbe13b806fd563e85a4fe60d3bcfc
"DELETEZ->std::unique_ptr in toolkit,unotools" now stopped to leak the 
global

  static std::unique_ptr pOptions;

in unotools/source/config/saveopt.cxx when any SvtSaveOptions instances are
leaked, so that at least PythonTest_pyuno_pytests_testcollections started to
fail in ASan builds now when that global pOptions is destroyed at exit.

I don't see a good reason for that ItemHolder1::holdConfigItem stuff here, 
so
lets try and drop it from SvtSaveOptions at least.

Change-Id: I6d44708fc4e2e5dfafaa9bfe8f3fa2f854ae0952
Reviewed-on: https://gerrit.libreoffice.org/46726
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/include/unotools/itemholderbase.hxx 
b/include/unotools/itemholderbase.hxx
index 9cb50417c163..94c20059abf9 100644
--- a/include/unotools/itemholderbase.hxx
+++ b/include/unotools/itemholderbase.hxx
@@ -66,7 +66,6 @@ enum class EItem
 PrintFileOptions  ,   // 2
 PrintWarningOptions   ,
 
-SaveOptions   ,
 SecurityOptions   ,
 SysLocaleOptions  ,   // 2
 
diff --git a/unotools/source/config/itemholder1.cxx 
b/unotools/source/config/itemholder1.cxx
index f3dfcc98af5e..91a44af5d715 100644
--- a/unotools/source/config/itemholder1.cxx
+++ b/unotools/source/config/itemholder1.cxx
@@ -39,7 +39,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -177,10 +176,6 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
 rItem.pItem.reset( new ::utl::MiscCfg() );
 break;
 
-case EItem::SaveOptions :
-rItem.pItem.reset( new SvtSaveOptions() );
-break;
-
 case EItem::SecurityOptions :
 rItem.pItem.reset( new SvtSecurityOptions() );
 break;
diff --git a/unotools/source/config/saveopt.cxx 
b/unotools/source/config/saveopt.cxx
index 35b721702f21..657eb6563488 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -32,7 +32,6 @@
 #include 
 #include 
 #include 
-#include "itemholder1.hxx"
 #include 
 
 using namespace utl;
@@ -805,8 +804,6 @@ SvtSaveOptions::SvtSaveOptions()
 pOptions.reset(new SvtLoadSaveOptions_Impl);
 pOptions->pSaveOpt.reset(new SvtSaveOptions_Impl);
 pOptions->pLoadOpt.reset( new SvtLoadOptions_Impl);
-
-ItemHolder1::holdConfigItem(EItem::SaveOptions);
}
++nRefCount;
 pImp = pOptions.get();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/unotools

2017-12-06 Thread Miklos Vajna
 include/unotools/ucbstreamhelper.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ae17566542777ad55620f7d03b3dbf559a51da3f
Author: Miklos Vajna 
Date:   Wed Dec 6 09:43:28 2017 +0100

unotools: remove not needed UcbStreamHelper inheritance

This class only has static member functions, nothing requires that
inheritance.

Change-Id: I31db802d0a9dcda01772b1e09a68af770868358d
Reviewed-on: https://gerrit.libreoffice.org/45924
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/include/unotools/ucbstreamhelper.hxx 
b/include/unotools/ucbstreamhelper.hxx
index 42bdc4ad7714..68309d094acf 100644
--- a/include/unotools/ucbstreamhelper.hxx
+++ b/include/unotools/ucbstreamhelper.hxx
@@ -49,7 +49,7 @@ namespace utl
 {
 class UcbLockBytesHandler;
 
-class UNOTOOLS_DLLPUBLIC UcbStreamHelper : public SvStream
+class UNOTOOLS_DLLPUBLIC UcbStreamHelper
 {
 public:
 static SvStream*CreateStream( const OUString& rFileName, 
StreamMode eOpenMode );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-10-13 Thread Caolán McNamara
 include/unotools/pathoptions.hxx|2 
 include/vcl/IconThemeScanner.hxx|6 -
 officecfg/registry/data/org/openoffice/Office/Paths.xcu |5 +
 unotools/source/config/pathoptions.cxx  |   11 ++-
 vcl/source/app/IconThemeScanner.cxx |   56 +---
 vcl/source/app/settings.cxx |   13 +++
 vcl/source/image/ImplImageTree.cxx  |   43 +++-
 7 files changed, 90 insertions(+), 46 deletions(-)

New commits:
commit d4e5e20a29402a305da533357fe538beb45afb96
Author: Caolán McNamara 
Date:   Thu Oct 12 14:48:56 2017 +0100

tdf#110742 add support for icon themes via extension manager

Change-Id: Ic33c086ef67cdcb634d9f03f84799c234fe3beec
Reviewed-on: https://gerrit.libreoffice.org/43341
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/unotools/pathoptions.hxx b/include/unotools/pathoptions.hxx
index 37e172632298..2334e0b56852 100644
--- a/include/unotools/pathoptions.hxx
+++ b/include/unotools/pathoptions.hxx
@@ -52,6 +52,7 @@ public:
 PATH_GALLERY,
 PATH_GRAPHIC,
 PATH_HELP,
+PATH_ICONSET,
 PATH_LINGUISTIC,
 PATH_MODULE,
 PATH_PALETTE,
@@ -86,6 +87,7 @@ public:
 const OUString& GetHelpPath() const;
 const OUString& GetLinguisticPath() const;
 const OUString& GetModulePath() const;
+const OUString& GetIconsetPath() const;
 const OUString& GetPalettePath() const;
 const OUString& GetPluginPath() const;
 const OUString& GetStoragePath() const;
diff --git a/include/vcl/IconThemeScanner.hxx b/include/vcl/IconThemeScanner.hxx
index 028173e9de59..7bb6f46e6cda 100644
--- a/include/vcl/IconThemeScanner.hxx
+++ b/include/vcl/IconThemeScanner.hxx
@@ -14,6 +14,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -27,7 +28,6 @@ class DirectoryItem;
 }
 
 namespace vcl {
-class IconThemeInfo;
 
 /** This class scans a folder for icon themes and provides the results.
  */
@@ -67,13 +67,11 @@ private:
 /** Scan a directory for icon themes.
  *
  * @return
- * This method will return true on success.
  * There are several cases when this method will fail:
  * - The directory does not exist
  * - There are no files which which match the pattern images_xxx.zip
  */
-bool
-ScanDirectoryForIconThemes(const OUString );
+void ScanDirectoryForIconThemes(const OUString );
 
 /** Adds the provided icon theme by path.
  */
diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu 
b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
index 55db320e8b15..d52e619d0445 100644
--- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
@@ -118,6 +118,11 @@
 $(userurl)/wordbook
   
 
+
+  
+
+  
+
 
   
 
diff --git a/unotools/source/config/pathoptions.cxx 
b/unotools/source/config/pathoptions.cxx
index 998ff53d0072..634fa2639015 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -111,6 +111,7 @@ class SvtPathOptions_Impl
 const OUString& GetLinguisticPath() { return GetPath( 
SvtPathOptions::PATH_LINGUISTIC ); }
 const OUString& GetModulePath() { return GetPath( 
SvtPathOptions::PATH_MODULE ); }
 const OUString& GetPalettePath() { return GetPath( 
SvtPathOptions::PATH_PALETTE ); }
+const OUString& GetIconsetPath() { return GetPath( 
SvtPathOptions::PATH_ICONSET); }
 const OUString& GetPluginPath() { return GetPath( 
SvtPathOptions::PATH_PLUGIN ); }
 const OUString& GetStoragePath() { return GetPath( 
SvtPathOptions::PATH_STORAGE ); }
 const OUString& GetTempPath() { return GetPath( 
SvtPathOptions::PATH_TEMP ); }
@@ -182,6 +183,7 @@ static const PropertyStruct aPropNames[] =
 { "Gallery",SvtPathOptions::PATH_GALLERY},
 { "Graphic",SvtPathOptions::PATH_GRAPHIC},
 { "Help",   SvtPathOptions::PATH_HELP   },
+{ "Iconset",SvtPathOptions::PATH_ICONSET},
 { "Linguistic", SvtPathOptions::PATH_LINGUISTIC },
 { "Module", SvtPathOptions::PATH_MODULE },
 { "Palette",SvtPathOptions::PATH_PALETTE},
@@ -234,7 +236,8 @@ const OUString& SvtPathOptions_Impl::GetPath( 
SvtPathOptions::Paths ePath )
 osl::FileBase::getSystemPathFromFileURL( aPathValue, aResult );
 aPathValue = aResult;
 }
-else if (ePath == SvtPathOptions::PATH_PALETTE)
+else if (ePath == SvtPathOptions::PATH_PALETTE ||
+ ePath == SvtPathOptions::PATH_ICONSET)
 {
 auto ctx = 

[Libreoffice-commits] core.git: include/unotools sfx2/source svtools/source unotools/source

2017-10-06 Thread Noel Grandin
 include/unotools/pathoptions.hxx|3 +++
 sfx2/source/appl/appcfg.cxx |9 +
 svtools/source/misc/templatefoldercache.cxx |   14 +++---
 unotools/source/config/pathoptions.cxx  |   18 +-
 4 files changed, 36 insertions(+), 8 deletions(-)

New commits:
commit aacf28c8ab48ca969308a2fb1bdff32e159228db
Author: Noel Grandin 
Date:   Fri Oct 6 12:04:39 2017 +0200

Revert "remove handing of deprecated Storage path option"

This reverts commit b71fdc67ed1efd421b9b1c747708958e8e09f73c.

since Jochen indicates that there is a bug in it

Change-Id: I786a7885a308cb43b99d9930ed385a75bbcd9495
Reviewed-on: https://gerrit.libreoffice.org/43192
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/pathoptions.hxx b/include/unotools/pathoptions.hxx
index 99791e5cc0fc..37e172632298 100644
--- a/include/unotools/pathoptions.hxx
+++ b/include/unotools/pathoptions.hxx
@@ -56,6 +56,7 @@ public:
 PATH_MODULE,
 PATH_PALETTE,
 PATH_PLUGIN,
+PATH_STORAGE,
 PATH_TEMP,
 PATH_TEMPLATE,
 PATH_USERCONFIG,
@@ -87,6 +88,7 @@ public:
 const OUString& GetModulePath() const;
 const OUString& GetPalettePath() const;
 const OUString& GetPluginPath() const;
+const OUString& GetStoragePath() const;
 const OUString& GetTempPath() const;
 const OUString& GetTemplatePath() const;
 const OUString& GetUserConfigPath() const;
@@ -112,6 +114,7 @@ public:
 voidSetModulePath( const OUString& rPath );
 voidSetPalettePath( const OUString& rPath );
 voidSetPluginPath( const OUString& rPath );
+voidSetStoragePath( const OUString& rPath );
 voidSetTempPath( const OUString& rPath );
 voidSetTemplatePath( const OUString& rPath );
 voidSetUserConfigPath( const OUString& rPath );
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 27ec3ad2f1df..7153cf17b4d1 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -433,6 +433,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
 case SvtPathOptions::PATH_MODULE:   
osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetModulePath(), aValue ); 
break;
 case SvtPathOptions::PATH_PALETTE:  aValue = 
aPathCfg.GetPalettePath(); break;
 case SvtPathOptions::PATH_PLUGIN:   
osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetPluginPath(), aValue ); 
break;
+case SvtPathOptions::PATH_STORAGE:  
osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetStoragePath(), aValue ); 
break;
 case SvtPathOptions::PATH_TEMP: aValue = 
aPathCfg.GetTempPath(); break;
 case SvtPathOptions::PATH_TEMPLATE: aValue = 
aPathCfg.GetTemplatePath(); break;
 case SvtPathOptions::PATH_USERCONFIG:   aValue = 
aPathCfg.GetUserConfigPath(); break;
@@ -790,6 +791,14 @@ void SfxApplication::SetOptions(const SfxItemSet )
 break;
 }
 
+case SvtPathOptions::PATH_STORAGE:
+{
+OUString aTmp;
+if( osl::FileBase::getSystemPathFromFileURL( sValue, 
aTmp ) == osl::FileBase::E_None )
+aPathOptions.SetStoragePath( aTmp );
+break;
+}
+
 case SvtPathOptions::PATH_TEMP: 
aPathOptions.SetTempPath( sValue );break;
 case SvtPathOptions::PATH_TEMPLATE: 
aPathOptions.SetTemplatePath( sValue );break;
 case SvtPathOptions::PATH_USERCONFIG:   
aPathOptions.SetUserConfigPath( sValue );break;
diff --git a/svtools/source/misc/templatefoldercache.cxx 
b/svtools/source/misc/templatefoldercache.cxx
index ab3db5afa563..f83e11dcdf0a 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -691,20 +691,20 @@ namespace svt
 // close any old stream instance
 closeCacheStream( );
 
-// get the temp directory
-OUString sTempURL = implParseSmart( SvtPathOptions().GetTempPath() );
-INetURLObject aTempURL( sTempURL );
-if ( INetProtocol::NotValid == aTempURL.GetProtocol() )
+// get the storage directory
+OUString sStorageURL = implParseSmart( 
SvtPathOptions().GetStoragePath() );
+INetURLObject aStorageURL( sStorageURL );
+if ( INetProtocol::NotValid == aStorageURL.GetProtocol() )
 {
-OSL_FAIL( "TemplateFolderCacheImpl::openCacheStream: invalid temp 
path!" );
+OSL_FAIL( 

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

2017-10-05 Thread Noel Grandin
 include/unotools/accessiblerelationsethelper.hxx|6 ++
 include/unotools/accessiblestatesethelper.hxx   |6 ++
 include/vbahelper/vbacollectionimpl.hxx |1 -
 include/vbahelper/vbahelper.hxx |1 -
 include/vbahelper/vbashaperange.hxx |1 -
 include/vbahelper/vbashapes.hxx |1 -
 unotools/source/misc/desktopterminationobserver.cxx |3 +--
 unoxml/source/dom/attr.hxx  |3 ---
 unoxml/source/dom/cdatasection.hxx  |1 -
 unoxml/source/dom/comment.hxx   |2 --
 unoxml/source/dom/documentfragment.hxx  |2 --
 unoxml/source/dom/documenttype.hxx  |2 --
 unoxml/source/dom/entity.hxx|2 --
 unoxml/source/dom/entityreference.hxx   |1 -
 unoxml/source/dom/notation.hxx  |1 -
 unoxml/source/dom/processinginstruction.hxx |1 -
 unoxml/source/events/mouseevent.hxx |1 -
 unoxml/source/events/mutationevent.hxx  |1 -
 vbahelper/source/vbahelper/vbalineformat.hxx|1 -
 19 files changed, 5 insertions(+), 32 deletions(-)

New commits:
commit 2bdf80be4c822378ba101703e4051a37c8f2ad41
Author: Noel Grandin 
Date:   Thu Oct 5 10:25:29 2017 +0200

loplugin:finalclasses in unotools..vbahelper

Change-Id: I9350f9d37eaba99a1d74e103c969a9dcfe795497
Reviewed-on: https://gerrit.libreoffice.org/43160
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/accessiblerelationsethelper.hxx 
b/include/unotools/accessiblerelationsethelper.hxx
index d49e1dbb5ac7..bbbefcd2b1ff 100644
--- a/include/unotools/accessiblerelationsethelper.hxx
+++ b/include/unotools/accessiblerelationsethelper.hxx
@@ -51,7 +51,7 @@ public:
 //=  internal  
 AccessibleRelationSetHelper ();
 AccessibleRelationSetHelper (const AccessibleRelationSetHelper& rHelper);
-protected:
+private:
 virtual ~AccessibleRelationSetHelper() override;
 public:
 
@@ -124,11 +124,9 @@ public:
 virtual css::uno::Sequence SAL_CALL
 getImplementationId() override;
 
-protected:
+private:
 /// Mutex guarding this object.
 ::osl::Mutex maMutex;
-
-private:
 /// The implementation of this helper interface.
 std::unique_ptrmpHelperImpl;
 };
diff --git a/include/unotools/accessiblestatesethelper.hxx 
b/include/unotools/accessiblestatesethelper.hxx
index a9cd22b9e282..4091153df059 100644
--- a/include/unotools/accessiblestatesethelper.hxx
+++ b/include/unotools/accessiblestatesethelper.hxx
@@ -62,7 +62,7 @@ public:
 AccessibleStateSetHelper ( const sal_Int64 _nInitialStates );
 
 AccessibleStateSetHelper ( const AccessibleStateSetHelper& rHelper );
-protected:
+private:
 virtual ~AccessibleStateSetHelper() override;
 public:
 
@@ -135,11 +135,9 @@ public:
 virtual css::uno::Sequence SAL_CALL
 getImplementationId() override;
 
-protected:
+private:
 /// Mutex guarding this object.
 ::osl::Mutex maMutex;
-
-private:
 /// The implementation of this helper interface.
 std::unique_ptr   mpHelperImpl;
 };
diff --git a/include/vbahelper/vbacollectionimpl.hxx 
b/include/vbahelper/vbacollectionimpl.hxx
index 94afa6daee1a..790e68f86907 100644
--- a/include/vbahelper/vbacollectionimpl.hxx
+++ b/include/vbahelper/vbacollectionimpl.hxx
@@ -172,7 +172,6 @@ private:
 }
 };
 
-protected:
 XNamedVec mXNamedVec;
 typename XNamedVec::iterator cachePos;
 public:
diff --git a/include/vbahelper/vbahelper.hxx b/include/vbahelper/vbahelper.hxx
index c007257e64c3..3643874ef5d5 100644
--- a/include/vbahelper/vbahelper.hxx
+++ b/include/vbahelper/vbahelper.hxx
@@ -176,7 +176,6 @@ public:
 
 class VBAHELPER_DLLPUBLIC ShapeHelper
 {
-protected:
 css::uno::Reference< css::drawing::XShape > xShape;
 public:
 /// @throws css::script::BasicErrorException
diff --git a/include/vbahelper/vbashaperange.hxx 
b/include/vbahelper/vbashaperange.hxx
index 9a6a798c4cb0..89cde7643125 100644
--- a/include/vbahelper/vbashaperange.hxx
+++ b/include/vbahelper/vbashaperange.hxx
@@ -56,7 +56,6 @@ class VBAHELPER_DLLPUBLIC ScVbaShapeRange : public 
ScVbaShapeRange_BASE
 private:
 css::uno::Reference< css::drawing::XDrawPage > m_xDrawPage;
 css::uno::Reference< css::drawing::XShapes > m_xShapes;
-protected:
 css::uno::Reference< css::frame::XModel > m_xModel;
 virtual OUString getServiceImplName() override;
 virtual css::uno::Sequence getServiceNames() override;
diff --git a/include/vbahelper/vbashapes.hxx b/include/vbahelper/vbashapes.hxx
index e933cc57da59..3c956c10eb37 100644
--- a/include/vbahelper/vbashapes.hxx
+++ b/include/vbahelper/vbashapes.hxx
@@ -58,7 +58,6 @@ private:
 

[Libreoffice-commits] core.git: include/unotools sfx2/source svtools/source unotools/source

2017-10-05 Thread Jochen Nitschke
 include/unotools/pathoptions.hxx|3 ---
 sfx2/source/appl/appcfg.cxx |9 -
 svtools/source/misc/templatefoldercache.cxx |   14 +++---
 unotools/source/config/pathoptions.cxx  |   18 +-
 4 files changed, 8 insertions(+), 36 deletions(-)

New commits:
commit b71fdc67ed1efd421b9b1c747708958e8e09f73c
Author: Jochen Nitschke 
Date:   Sat Aug 12 15:00:52 2017 +0200

remove handing of deprecated Storage path option

The only user of StoragePath was
TemplateFolderCacheImpl::openCacheStream which uses TempPath for
the cache file now.

Change-Id: Ia21b5aa804222f28a3af3779a0ecc4789c1860b3
Reviewed-on: https://gerrit.libreoffice.org/41087
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/pathoptions.hxx b/include/unotools/pathoptions.hxx
index 37e172632298..99791e5cc0fc 100644
--- a/include/unotools/pathoptions.hxx
+++ b/include/unotools/pathoptions.hxx
@@ -56,7 +56,6 @@ public:
 PATH_MODULE,
 PATH_PALETTE,
 PATH_PLUGIN,
-PATH_STORAGE,
 PATH_TEMP,
 PATH_TEMPLATE,
 PATH_USERCONFIG,
@@ -88,7 +87,6 @@ public:
 const OUString& GetModulePath() const;
 const OUString& GetPalettePath() const;
 const OUString& GetPluginPath() const;
-const OUString& GetStoragePath() const;
 const OUString& GetTempPath() const;
 const OUString& GetTemplatePath() const;
 const OUString& GetUserConfigPath() const;
@@ -114,7 +112,6 @@ public:
 voidSetModulePath( const OUString& rPath );
 voidSetPalettePath( const OUString& rPath );
 voidSetPluginPath( const OUString& rPath );
-voidSetStoragePath( const OUString& rPath );
 voidSetTempPath( const OUString& rPath );
 voidSetTemplatePath( const OUString& rPath );
 voidSetUserConfigPath( const OUString& rPath );
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 7153cf17b4d1..27ec3ad2f1df 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -433,7 +433,6 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
 case SvtPathOptions::PATH_MODULE:   
osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetModulePath(), aValue ); 
break;
 case SvtPathOptions::PATH_PALETTE:  aValue = 
aPathCfg.GetPalettePath(); break;
 case SvtPathOptions::PATH_PLUGIN:   
osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetPluginPath(), aValue ); 
break;
-case SvtPathOptions::PATH_STORAGE:  
osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetStoragePath(), aValue ); 
break;
 case SvtPathOptions::PATH_TEMP: aValue = 
aPathCfg.GetTempPath(); break;
 case SvtPathOptions::PATH_TEMPLATE: aValue = 
aPathCfg.GetTemplatePath(); break;
 case SvtPathOptions::PATH_USERCONFIG:   aValue = 
aPathCfg.GetUserConfigPath(); break;
@@ -791,14 +790,6 @@ void SfxApplication::SetOptions(const SfxItemSet )
 break;
 }
 
-case SvtPathOptions::PATH_STORAGE:
-{
-OUString aTmp;
-if( osl::FileBase::getSystemPathFromFileURL( sValue, 
aTmp ) == osl::FileBase::E_None )
-aPathOptions.SetStoragePath( aTmp );
-break;
-}
-
 case SvtPathOptions::PATH_TEMP: 
aPathOptions.SetTempPath( sValue );break;
 case SvtPathOptions::PATH_TEMPLATE: 
aPathOptions.SetTemplatePath( sValue );break;
 case SvtPathOptions::PATH_USERCONFIG:   
aPathOptions.SetUserConfigPath( sValue );break;
diff --git a/svtools/source/misc/templatefoldercache.cxx 
b/svtools/source/misc/templatefoldercache.cxx
index f83e11dcdf0a..ab3db5afa563 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -691,20 +691,20 @@ namespace svt
 // close any old stream instance
 closeCacheStream( );
 
-// get the storage directory
-OUString sStorageURL = implParseSmart( 
SvtPathOptions().GetStoragePath() );
-INetURLObject aStorageURL( sStorageURL );
-if ( INetProtocol::NotValid == aStorageURL.GetProtocol() )
+// get the temp directory
+OUString sTempURL = implParseSmart( SvtPathOptions().GetTempPath() );
+INetURLObject aTempURL( sTempURL );
+if ( INetProtocol::NotValid == aTempURL.GetProtocol() )
 {
-OSL_FAIL( "TemplateFolderCacheImpl::openCacheStream: invalid 
storage path!" );
+OSL_FAIL( 

[Libreoffice-commits] core.git: include/unotools svl/source svtools/source unotools/source

2017-09-12 Thread Noel Grandin
 include/unotools/itemholderbase.hxx|   14 ---
 svl/source/config/itemholder2.cxx  |   22 +++
 svl/source/config/itemholder2.hxx  |2 -
 svtools/source/config/itemholder2.cxx  |   33 +
 svtools/source/config/itemholder2.hxx  |2 -
 unotools/source/config/itemholder1.cxx |   62 +
 unotools/source/config/itemholder1.hxx |2 -
 7 files changed, 55 insertions(+), 82 deletions(-)

New commits:
commit 7281f4a73ec3679798a6271ab5a0ad839f278e37
Author: Noel Grandin 
Date:   Mon Sep 11 17:13:03 2017 +0200

use std::unique_ptr in TItemInfo

and inline the TItems typedef

Change-Id: I0c50d12d53ce4b52c330cad8790a65065ebdd82e
Reviewed-on: https://gerrit.libreoffice.org/42182
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/include/unotools/itemholderbase.hxx 
b/include/unotools/itemholderbase.hxx
index 13a11f7e5789..9cb50417c163 100644
--- a/include/unotools/itemholderbase.hxx
+++ b/include/unotools/itemholderbase.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_UNOTOOLS_ITEMHOLDERBASE_HXX
 #define INCLUDED_UNOTOOLS_ITEMHOLDERBASE_HXX
 
+#include 
 #include 
 #include 
 
@@ -80,17 +81,20 @@ enum class EItem
 struct TItemInfo
 {
 TItemInfo()
-: pItem(nullptr)
-, eItem(EItem::UserOptions)
+: eItem(EItem::UserOptions)
 {
 }
 
-utl::detail::Options * pItem;
+TItemInfo(TItemInfo&& other)
+: pItem(std::move(other.pItem))
+, eItem(other.eItem)
+{
+}
+
+std::unique_ptr pItem;
 EItem eItem;
 };
 
-typedef ::std::vector< TItemInfo > TItems;
-
 #endif // INCLUDED_UNOTOOLS_ITEMHOLDERBASE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/config/itemholder2.cxx 
b/svl/source/config/itemholder2.cxx
index 1511b47082a3..b809eba57b1d 100644
--- a/svl/source/config/itemholder2.cxx
+++ b/svl/source/config/itemholder2.cxx
@@ -79,12 +79,8 @@ void ItemHolder2::impl_addItem(EItem eItem)
 {
 ::osl::ResettableMutexGuard aLock(m_aLock);
 
-TItems::const_iterator pIt;
-for (  pIt  = m_lItems.begin();
-   pIt != m_lItems.end()  ;
- ++pIt)
+for ( auto const & rInfo : m_lItems )
 {
-const TItemInfo& rInfo = *pIt;
 if (rInfo.eItem == eItem)
 return;
 }
@@ -93,24 +89,18 @@ void ItemHolder2::impl_addItem(EItem eItem)
 aNewItem.eItem = eItem;
 impl_newItem(aNewItem);
 if (aNewItem.pItem)
-m_lItems.push_back(aNewItem);
+m_lItems.emplace_back(std::move(aNewItem));
 }
 
 void ItemHolder2::impl_releaseAllItems()
 {
-TItems items;
+std::vector< TItemInfo > items;
 {
 ::osl::MutexGuard aLock(m_aLock);
 items.swap(m_lItems);
 }
 
-TItems::iterator pIt;
-for (  pIt  = items.begin();
-   pIt != items.end()  ;
- ++pIt)
-{
-delete pIt->pItem;
-}
+// items will be freed when the block exits
 }
 
 void ItemHolder2::impl_newItem(TItemInfo& rItem)
@@ -118,11 +108,11 @@ void ItemHolder2::impl_newItem(TItemInfo& rItem)
 switch(rItem.eItem)
 {
 case EItem::CJKOptions :
-rItem.pItem = new SvtCJKOptions();
+rItem.pItem.reset( new SvtCJKOptions() );
 break;
 
 case EItem::CTLOptions :
-rItem.pItem = new SvtCTLOptions();
+rItem.pItem.reset( new SvtCTLOptions() );
 break;
 
 default:
diff --git a/svl/source/config/itemholder2.hxx 
b/svl/source/config/itemholder2.hxx
index 3246cc37b4dd..27d9f182ff03 100644
--- a/svl/source/config/itemholder2.hxx
+++ b/svl/source/config/itemholder2.hxx
@@ -30,7 +30,7 @@ class ItemHolder2 : private ItemHolderMutexBase
 // member
 private:
 
-TItems m_lItems;
+std::vector m_lItems;
 
 // c++ interface
 public:
diff --git a/svtools/source/config/itemholder2.cxx 
b/svtools/source/config/itemholder2.cxx
index 5989157f5e8b..2512715caab8 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -91,12 +91,8 @@ void ItemHolder2::impl_addItem(EItem eItem)
 {
 ::osl::ResettableMutexGuard aLock(m_aLock);
 
-TItems::const_iterator pIt;
-for (  pIt  = m_lItems.begin();
-   pIt != m_lItems.end()  ;
- ++pIt)
+for ( auto const & rInfo : m_lItems )
 {
-const TItemInfo& rInfo = *pIt;
 if (rInfo.eItem == eItem)
 return;
 }
@@ -105,26 +101,19 @@ void ItemHolder2::impl_addItem(EItem eItem)
 aNewItem.eItem = eItem;
 impl_newItem(aNewItem);
 if (aNewItem.pItem)
-m_lItems.push_back(aNewItem);
+m_lItems.emplace_back(std::move(aNewItem));
 }
 
 
 void ItemHolder2::impl_releaseAllItems()
 {
-TItems items;
+std::vector items;
 {
 

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

2017-09-06 Thread Stephan Bergmann
 include/unotools/syslocaleoptions.hxx   |2 
 unotools/source/config/syslocaleoptions.cxx |   78 +---
 2 files changed, 48 insertions(+), 32 deletions(-)

New commits:
commit 519925089defb3582c1147c75ef8bf9e5aed02b1
Author: Stephan Bergmann 
Date:   Wed Sep 6 15:43:45 2017 +0200

Don't call NotifyListeners with mutex locked

...as it causes ThreadSanitizer failures during CppunitTest_basic_macros:

> WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) 
(pid=27295)
>   Cycle in lock order graph: M290054517485674432 (0x) => 
M2405 (0x7b0c54c0) => M290054517485674432
>
>   Mutex M2405 acquired here while holding mutex M290054517485674432 in 
main thread:
> #0 pthread_mutex_lock 
compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:3800 
(cppunittester+0x45ad87)
> #1 osl_acquireMutex sal/osl/unx/mutex.cxx:97:16 
(libuno_sal.so.3+0xc1ffa)
> #2 osl::Mutex::acquire() include/osl/mutex.hxx:56:20 
(libutllo.so+0xc06c8)
> #3 osl::Guard::Guard(osl::Mutex&) 
include/osl/mutex.hxx:129:17 (libutllo.so+0xbcccf)
> #4 SvtSysLocaleOptions::SvtSysLocaleOptions() 
unotools/source/config/syslocaleoptions.cxx:504:16 (libutllo.so+0x21a4cd)
> #5 SvNumberFormatterRegistry_Impl::SvNumberFormatterRegistry_Impl() 
svl/source/numbers/zforlist.cxx:184:33 (libsvllo.so+0x3da143)
> #6 SvNumberFormatter::GetFormatterRegistry() 
svl/source/numbers/zforlist.cxx:368:34 (libsvllo.so+0x3e0a70)
> #7 SvNumberFormatter::ImpConstruct(o3tl::strong_int) svl/source/numbers/zforlist.cxx:322:5 (libsvllo.so+0x3dc328)
> #8 
SvNumberFormatter::SvNumberFormatter(com::sun::star::uno::Reference
 const&, o3tl::strong_int) 
svl/source/numbers/zforlist.cxx:263:5 (libsvllo.so+0x3dbcb9)
> #9 SbiScanner::NextSym() basic/source/comp/scanner.cxx:563:31 
(libsblo.so+0x267d29)
> #10 SbiTokenizer::Next() basic/source/comp/token.cxx:327:10 
(libsblo.so+0x2771b8)
> #11 SbModule::SetSource32(rtl::OUString const&) 
basic/source/classes/sbxmod.cxx:912:26 (libsblo.so+0x203ac8)
> #12 StarBASIC::MakeModule(rtl::OUString const&, 
com::sun::star::script::ModuleInfo const&, rtl::OUString const&) 
basic/source/classes/sb.cxx:1065:8 (libsblo.so+0x16559a)
> #13 StarBASIC::MakeModule(rtl::OUString const&, rtl::OUString const&) 
basic/source/classes/sb.cxx:1037:12 (libsblo.so+0x164fdc)
> #14 MacroSnippet::MakeModule(rtl::OUString const&) 
basic/qa/cppunit/basictest.cxx:29:22 (libtest_basic_macros.so+0xa7ac)
> #15 MacroSnippet::LoadSourceFromFile(rtl::OUString const&) 
basic/qa/cppunit/basictest.cxx:72:5 (libtest_basic_macros.so+0xb240)
> #16 (anonymous namespace)::Coverage::run_test(rtl::OUString const&) 
basic/qa/cppunit/basic_coverage.cxx:75:15 (libtest_basic_macros.so+0x113d9)
> #17 (anonymous namespace)::Coverage::process_directory(rtl::OUString 
const&) basic/qa/cppunit/basic_coverage.cxx:126:17 
(libtest_basic_macros.so+0x10f46)
> #18 (anonymous namespace)::Coverage::Coverage_Iterator() 
basic/qa/cppunit/basic_coverage.cxx:141:5 (libtest_basic_macros.so+0x1066e)
> #19 void std::__invoke_impl(std::__invoke_memfun_deref, void ((anonymous 
namespace)::Coverage::* const&)(), (anonymous namespace)::Coverage*&) 
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:227:14
 (libtest_basic_macros.so+0x12ffe)
> #20 std::result_of::type std::__invoke(void ((anonymous namespace)::Coverage::* const&)(), 
(anonymous namespace)::Coverage*&) 
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:250:14
 (libtest_basic_macros.so+0x12eed)
> #21 
_ZNKSt12_Mem_fn_baseIMN12_GLOBAL__N_18CoverageEFvvELb1EEclIJRPS1_EEEDTclsr3stdE8__invokedtdefpT6_M_pmfspclsr3stdE7forwardIT_Efp_EEEDpOS8_
 
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:604:11
 (libtest_basic_macros.so+0x12dcb)
> #22 void std::_Bind::__call(std::tuple<>&&, std::_Index_tuple<0ul>) 
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:933:11
 (libtest_basic_macros.so+0x12d3b)
> #23 void std::_Bind::operator()<, 
void>() 
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:991:17
 (libtest_basic_macros.so+0x12c46)
> #24 std::_Function_handler ((anonymous namespace)::Coverage*)> 
>::_M_invoke(std::_Any_data const&) 
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:1731:2
 (libtest_basic_macros.so+0x1260a)
> #25 std::function::operator()() const 

[Libreoffice-commits] core.git: include/unotools

2017-04-29 Thread Chris Sherlock
 include/unotools/bootstrap.hxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit d1ac762cd6c60d5fe8ffaf335c6358651c969567
Author: Chris Sherlock 
Date:   Sat Apr 29 21:04:15 2017 +1000

unotools: cleanup bootstrap.hxx

Change-Id: I3ab1cc8f8950dc858c8abda27e5eef8c46fe6877
Reviewed-on: https://gerrit.libreoffice.org/37099
Reviewed-by: Chris Sherlock 
Tested-by: Chris Sherlock 

diff --git a/include/unotools/bootstrap.hxx b/include/unotools/bootstrap.hxx
index fc581831e5ac..f00c7b1de8f7 100644
--- a/include/unotools/bootstrap.hxx
+++ b/include/unotools/bootstrap.hxx
@@ -26,10 +26,11 @@
 namespace utl
 {
 /** provides configuration information needed for application startup.
-This class handles the startup information for the office 
application.
+
+This class handles the startup information for the office application.
It encapsulates knowledge of how to retriev such information and how
-   to diagnose failures to retriev required data.
-
+   to diagnose failures to retrieve required data.
+
 */
 class UNOTOOLS_DLLPUBLIC Bootstrap
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-03-28 Thread Jean-Baptiste Faure
 include/unotools/eventcfg.hxx   |2 ++
 unotools/source/config/eventcfg.cxx |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit 7c0054f1b7c3c475bff7a5adfdea0feaecf20748
Author: Jean-Baptiste Faure 
Date:   Mon Mar 27 22:08:26 2017 +0200

tdf#105843 : restore Application Start and Stop events

Change-Id: Ifc99fcf84182edb49cac741f7bb10a1b239d5703
Reviewed-on: https://gerrit.libreoffice.org/35779
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/eventcfg.hxx b/include/unotools/eventcfg.hxx
index 4a855994f552..fe68e3e679dc 100644
--- a/include/unotools/eventcfg.hxx
+++ b/include/unotools/eventcfg.hxx
@@ -31,6 +31,8 @@
 
 enum class GlobalEventId
 {
+STARTAPP,
+CLOSEAPP,
 DOCCREATED,
 CREATEDOC,
 LOADFINISHED,
diff --git a/unotools/source/config/eventcfg.cxx 
b/unotools/source/config/eventcfg.cxx
index 998c4312f837..2e47efdd2905 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -46,6 +46,8 @@ using namespace ::com::sun::star;
 
 static o3tl::enumarray pEventAsciiNames =
 {
+"OnStartApp",
+"OnCloseApp",
 "OnCreate",
 "OnNew",
 "OnLoadFinished",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/unotools include/xmloff include/xmlscript unotools/source uui/source xmlhelp/source xmloff/inc xmloff/source xmlscript/source

2017-01-19 Thread Noel Grandin
 include/unotools/options.hxx |3 -
 include/xmloff/XMLFontAutoStylePool.hxx  |3 -
 include/xmloff/xmlstyle.hxx  |2 
 include/xmlscript/xmllib_imexp.hxx   |4 +
 unotools/source/config/options.cxx   |3 -
 uui/source/interactionhandler.cxx|   13 +---
 xmlhelp/source/cxxhelp/provider/databases.cxx|   18 +++---
 xmlhelp/source/cxxhelp/provider/databases.hxx|5 +
 xmlhelp/source/cxxhelp/provider/db.cxx   |5 -
 xmlhelp/source/cxxhelp/provider/db.hxx   |   20 ++-
 xmlhelp/source/cxxhelp/provider/provider.cxx |7 +-
 xmlhelp/source/cxxhelp/provider/provider.hxx |6 +-
 xmlhelp/source/cxxhelp/provider/resultset.cxx|1 
 xmlhelp/source/cxxhelp/provider/resultset.hxx|2 
 xmlhelp/source/cxxhelp/provider/urlparameter.cxx |   31 ---
 xmloff/inc/XMLFootnoteConfigurationImportContext.hxx |2 
 xmloff/source/style/XMLFontAutoStylePool.cxx |1 
 xmloff/source/style/xmlexppr.cxx |   11 +--
 xmloff/source/style/xmlstyle.cxx |5 -
 xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx |5 -
 xmlscript/source/xmllib_imexp/xmllib_import.cxx  |5 -
 21 files changed, 63 insertions(+), 89 deletions(-)

New commits:
commit 968f6a7f0293c08a73807603f3cb294e4b50bad8
Author: Noel Grandin 
Date:   Thu Jan 19 09:11:39 2017 +0200

new loplugin: useuniqueptr: unotools..xmlscript

Change-Id: I6966d44cff644112dd837adfe7d9c4f459457271
Reviewed-on: https://gerrit.libreoffice.org/33298
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/unotools/options.hxx b/include/unotools/options.hxx
index 552eb51..08773f4f 100644
--- a/include/unotools/options.hxx
+++ b/include/unotools/options.hxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 // bits for broadcasting hints of changes in 
ConfigurationListener::ConfigurationChanged, may be combined
 enum class ConfigurationHints {
@@ -66,7 +67,7 @@ namespace utl {
 // complete broadcasting implementation
 class UNOTOOLS_DLLPUBLIC ConfigurationBroadcaster
 {
-IMPL_ConfigurationListenerList* mpList;
+std::unique_ptr mpList;
 sal_Int32   m_nBroadcastBlocked; // broadcast only if 
this is 0
 ConfigurationHints  m_nBlockedHint;
 
diff --git a/include/xmloff/XMLFontAutoStylePool.hxx 
b/include/xmloff/XMLFontAutoStylePool.hxx
index f508a89..dabb3e5 100644
--- a/include/xmloff/XMLFontAutoStylePool.hxx
+++ b/include/xmloff/XMLFontAutoStylePool.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class XMLFontAutoStylePool_Impl;
 class SvXMLExport;
@@ -34,7 +35,7 @@ class XMLOFF_DLLPUBLIC XMLFontAutoStylePool : public 
salhelper::SimpleReferenceO
 {
 SvXMLExport& rExport;
 
-XMLFontAutoStylePool_Impl *pPool;
+std::unique_ptr pPool;
 std::set m_aNames;
 bool tryToEmbedFonts;
 
diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx
index 975aa0c..8841ec3 100644
--- a/include/xmloff/xmlstyle.hxx
+++ b/include/xmloff/xmlstyle.hxx
@@ -153,7 +153,7 @@ class XMLOFF_DLLPUBLIC SvXMLStylesContext : public 
SvXMLImportContext
 const OUString msTextStyleServiceName;
 
 std::unique_ptr mpImpl;
-SvXMLTokenMap   *mpStyleStylesElemTokenMap;
+std::unique_ptr   mpStyleStylesElemTokenMap;
 
 
 css::uno::Reference< css::container::XNameContainer > mxParaStyles;
diff --git a/include/xmlscript/xmllib_imexp.hxx 
b/include/xmlscript/xmllib_imexp.hxx
index 7c13f6a..c543242 100644
--- a/include/xmlscript/xmllib_imexp.hxx
+++ b/include/xmlscript/xmllib_imexp.hxx
@@ -25,6 +25,8 @@
 #include 
 #include 
 
+#include 
+
 namespace xmlscript
 {
 
@@ -46,7 +48,7 @@ struct XMLSCRIPT_DLLPUBLIC LibDescriptor
 
 struct XMLSCRIPT_DLLPUBLIC LibDescriptorArray
 {
-LibDescriptor* mpLibs;
+std::unique_ptr mpLibs;
 sal_Int32 mnLibCount;
 
 LibDescriptorArray() { mpLibs = nullptr; mnLibCount = 0; }
diff --git a/unotools/source/config/options.cxx 
b/unotools/source/config/options.cxx
index c6e66c5..d3f70ec 100644
--- a/unotools/source/config/options.cxx
+++ b/unotools/source/config/options.cxx
@@ -34,13 +34,12 @@ ConfigurationBroadcaster::ConfigurationBroadcaster()
 
 ConfigurationBroadcaster::~ConfigurationBroadcaster()
 {
-delete mpList;
 }
 
 void ConfigurationBroadcaster::AddListener( utl::ConfigurationListener* 
pListener )
 {
 if ( !mpList )
-mpList = new IMPL_ConfigurationListenerList;
+mpList.reset(new IMPL_ConfigurationListenerList);
 

[Libreoffice-commits] core.git: include/unotools sw/source sw/uiconfig unotools/source

2017-01-18 Thread Vitaliy Anderson
 include/unotools/compatibility.hxx|8 +++-
 sw/source/core/doc/DocumentSettingManager.cxx |5 +--
 sw/source/ui/config/optcomp.cxx   |   34 +++-
 sw/source/uibase/uno/SwXDocumentSettings.cxx  |   13 +++
 sw/uiconfig/swriter/ui/optcompatpage.ui   |1 
 unotools/source/config/compatibility.cxx  |   43 +-
 6 files changed, 85 insertions(+), 19 deletions(-)

New commits:
commit fb4943338317c8f24b143d7d1f0b8f2069af1577
Author: Vitaliy Anderson 
Date:   Fri Jan 13 08:37:39 2017 -0800

tdf#104349, tdf#104668 MS Word compatibility trailing blanks option part 2

Create the option in Tools->Options->LibreOffice Writer->Compatibility

Change-Id: I7c766138db9210d3e7a97eea48b9265ee9762199
Reviewed-on: https://gerrit.libreoffice.org/33148
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index 229190c..551627b 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -40,7 +40,8 @@ enum CompatibilityOptions
 COPT_USE_OUR_TEXTWRAPPING,
 COPT_CONSIDER_WRAPPINGSTYLE,
 COPT_EXPAND_WORDSPACE,
-COPT_PROTECT_FORM
+COPT_PROTECT_FORM,
+COPT_MS_WORD_COMP_TRAILING_BLANKS
 };
 
 
/*-
@@ -61,6 +62,7 @@ enum CompatibilityOptions
 #define COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE
"ConsiderWrappingStyle"
 #define COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE  "ExpandWordSpace"
 #define COMPATIBILITY_PROPERTYNAME_PROTECTFORM  "ProtectForm"
+#define COMPATIBILITY_PROPERTYNAME_MSWORDTRAILINGBLANKS 
"MsWordCompTrailingBlanks"
 
 #define COMPATIBILITY_DEFAULT_NAME  "_default"
 
@@ -132,7 +134,8 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public 
utl::detail::Options
  bool bUseOurTextWrapping,
  bool bConsiderWrappingStyle,
  bool bExpandWordSpace,
- bool bProtectForm );
+ bool bProtectForm,
+ bool bMsWordCompTrailingBlanks );
 
 boolIsUsePrtDevice() const;
 boolIsAddSpacing() const;
@@ -145,6 +148,7 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public 
utl::detail::Options
 boolIsUseOurTextWrapping() const;
 boolIsConsiderWrappingStyle() const;
 boolIsExpandWordSpace() const;
+boolIsMsWordCompTrailingBlanks() const;
 
 private:
 
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index f006682..64644c5 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -109,8 +109,8 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc 
)
 mbUseFormerObjectPos= 
aOptions.IsUseObjectPositioning();
 mbUseFormerTextWrapping = aOptions.IsUseOurTextWrapping();
 mbConsiderWrapOnObjPos  = 
aOptions.IsConsiderWrappingStyle();
-
-mbDoNotJustifyLinesWithManualBreak  = 
!aOptions.IsExpandWordSpace();
+mbDoNotJustifyLinesWithManualBreak  = !aOptions.IsExpandWordSpace();
+mbMsWordCompTrailingBlanks  = 
aOptions.IsMsWordCompTrailingBlanks();
 }
 else
 {
@@ -125,6 +125,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc 
)
 mbUseFormerTextWrapping = false;
 mbConsiderWrapOnObjPos  = false;
 mbDoNotJustifyLinesWithManualBreak  = true;
+mbMsWordCompTrailingBlanks  = false;
 }
 
 // COMPATIBILITY FLAGS END
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 2e72a02..69e54a3 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -57,6 +57,7 @@ struct CompatibilityItem
 boolm_bConsiderWrappingStyle;
 boolm_bExpandWordSpace;
 boolm_bProtectForm;
+boolm_bMsWordCompTrailingBlanks;
 boolm_bIsDefault;
 
 CompatibilityItem( const OUString& _rName, const OUString& _rModule,
@@ -64,7 +65,7 @@ struct CompatibilityItem
bool _bUseOurTabStops, bool _bNoExtLeading, bool 
_bUseLineSpacing,
bool _bAddTableSpacing, bool _bUseObjPos, bool 
_bUseOurTextWrapping,
bool _bConsiderWrappingStyle, bool _bExpandWordSpace, 
bool _bProtectForm,
-   bool _bIsDefault ) :
+   bool _bMsWordCompTrailingBlanks, bool _bIsDefault ) :
 
 m_sName ( _rName ),
 m_sModule   ( 

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

2016-12-07 Thread Stephan Bergmann
 include/unotools/streamwrap.hxx  |5 +
 unotools/source/streaming/streamwrap.cxx |4 
 2 files changed, 9 insertions(+)

New commits:
commit 4788d20ec411d2688af59715944d32fc82ad4d43
Author: Stephan Bergmann 
Date:   Thu Dec 8 08:55:03 2016 +0100

Non-inline virtual dtors of exported classes

Change-Id: I7b3597d48bf7b0196b98c869329d2fb1a46fa8f2

diff --git a/include/unotools/streamwrap.hxx b/include/unotools/streamwrap.hxx
index e2303a1..f0b52aa 100644
--- a/include/unotools/streamwrap.hxx
+++ b/include/unotools/streamwrap.hxx
@@ -82,6 +82,8 @@ class UNOTOOLS_DLLPUBLIC OSeekableInputStreamWrapper : public 
::cppu::ImplInheri
 {
 protected:
 OSeekableInputStreamWrapper() {}
+~OSeekableInputStreamWrapper() override;
+
 public:
 OSeekableInputStreamWrapper(SvStream& _rStream);
 OSeekableInputStreamWrapper(SvStream* _pStream, bool _bOwner = false);
@@ -146,6 +148,9 @@ private:
 
 class UNOTOOLS_DLLPUBLIC OStreamWrapper : public 
::cppu::ImplInheritanceHelper3 < OSeekableInputStreamWrapper, css::io::XStream, 
css::io::XOutputStream, css::io::XTruncate >
 {
+protected:
+~OStreamWrapper() override;
+
 public:
 OStreamWrapper(SvStream& _rStream);
 
diff --git a/unotools/source/streaming/streamwrap.cxx 
b/unotools/source/streaming/streamwrap.cxx
index 92f7aa4..59d751d 100644
--- a/unotools/source/streaming/streamwrap.cxx
+++ b/unotools/source/streaming/streamwrap.cxx
@@ -139,6 +139,8 @@ void OInputStreamWrapper::checkError() const
 
 //= OSeekableInputStreamWrapper
 
+OSeekableInputStreamWrapper::~OSeekableInputStreamWrapper() = default;
+
 OSeekableInputStreamWrapper::OSeekableInputStreamWrapper(SvStream& _rStream)
 {
 SetStream( &_rStream, false );
@@ -276,6 +278,8 @@ sal_Int64 SAL_CALL OSeekableOutputStreamWrapper::getLength( 
 ) throw (IOExceptio
 return (sal_Int64)nEndPos;
 }
 
+OStreamWrapper::~OStreamWrapper() = default;
+
 OStreamWrapper::OStreamWrapper(SvStream& _rStream)
 {
 SetStream( &_rStream, false );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >