[Libreoffice-commits] core.git: sal/rtl

2022-03-01 Thread Mike Kaganski (via logerrit)
 sal/rtl/string.cxx  |   15 ++-
 sal/rtl/strtmpl.hxx |   52 
 sal/rtl/ustring.cxx |   15 ++-
 3 files changed, 20 insertions(+), 62 deletions(-)

New commits:
commit 8ae8bea13565012410ecf13332f4696346294c12
Author: Mike Kaganski 
AuthorDate: Wed Mar 2 10:11:23 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Mar 2 08:54:56 2022 +0100

Drop useless indirection and unused template

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

diff --git a/sal/rtl/string.cxx b/sal/rtl/string.cxx
index 87c65f6069ce..c5d535075354 100644
--- a/sal/rtl/string.cxx
+++ b/sal/rtl/string.cxx
@@ -506,28 +506,33 @@ sal_Bool SAL_CALL rtl_str_toBoolean(const char* pStr) 
SAL_THROW_EXTERN_C()
 
 sal_Int32 SAL_CALL rtl_str_toInt32(const char* pStr, sal_Int16 nRadix) 
SAL_THROW_EXTERN_C()
 {
-return rtl::str::toInt32(pStr, nRadix);
+assert(pStr);
+return rtl::str::toInt(pStr, nRadix);
 }
 
 sal_Int64 SAL_CALL rtl_str_toInt64(const char* pStr, sal_Int16 nRadix) 
SAL_THROW_EXTERN_C()
 {
-return rtl::str::toInt64(pStr, nRadix);
+assert(pStr);
+return rtl::str::toInt(pStr, nRadix);
 }
 
 sal_Int64 SAL_CALL rtl_str_toInt64_WithLength(const char* pStr, sal_Int16 
nRadix,
   sal_Int32 nStrLength) 
SAL_THROW_EXTERN_C()
 {
-return rtl::str::toInt64_WithLength(pStr, nRadix, nStrLength);
+assert(pStr || nStrLength == 0);
+return rtl::str::toInt(std::basic_string_view(pStr, 
nStrLength), nRadix);
 }
 
 sal_uInt32 SAL_CALL rtl_str_toUInt32(const char* pStr, sal_Int16 nRadix) 
SAL_THROW_EXTERN_C()
 {
-return rtl::str::toUInt32(pStr, nRadix);
+assert(pStr);
+return rtl::str::toInt(pStr, nRadix);
 }
 
 sal_uInt64 SAL_CALL rtl_str_toUInt64(const char* pStr, sal_Int16 nRadix) 
SAL_THROW_EXTERN_C()
 {
-return rtl::str::toUInt64(pStr, nRadix);
+assert(pStr);
+return rtl::str::toInt(pStr, nRadix);
 }
 
 rtl_String* rtl_string_ImplAlloc(sal_Int32 nLen) { return 
rtl::str::Alloc(nLen); }
diff --git a/sal/rtl/strtmpl.hxx b/sal/rtl/strtmpl.hxx
index a6b06ad0256e..6988865e8f11 100644
--- a/sal/rtl/strtmpl.hxx
+++ b/sal/rtl/strtmpl.hxx
@@ -834,58 +834,6 @@ template  T toInt(S str, sal_Int16 
nRadix)
 return static_cast(n);
 }
 
-template 
-sal_Int32 toInt32 ( const IMPL_RTL_STRCODE* pStr,
-sal_Int16 nRadix )
-{
-assert(pStr);
-return toInt(pStr, nRadix);
-}
-
-template 
-sal_Int32 toInt32_WithLength  ( const IMPL_RTL_STRCODE* pStr,
-sal_Int16 nRadix,
-sal_Int32 nStrLength)
-
-{
-assert(pStr);
-return toInt(std::basic_string_view(pStr, nStrLength), nRadix);
-}
-
-template 
-sal_Int64 toInt64 ( const IMPL_RTL_STRCODE* pStr,
-sal_Int16 nRadix )
-{
-assert(pStr);
-return toInt(pStr, nRadix);
-}
-
-template 
-sal_Int64 toInt64_WithLength  ( const IMPL_RTL_STRCODE* pStr,
-sal_Int16 nRadix,
-sal_Int32 nStrLength)
-
-{
-assert(pStr);
-return toInt(std::basic_string_view(pStr, nStrLength), nRadix);
-}
-
-template 
-sal_uInt32 toUInt32 ( const IMPL_RTL_STRCODE* pStr,
-  sal_Int16 nRadix )
-{
-assert(pStr);
-return toInt(pStr, nRadix);
-}
-
-template 
-sal_uInt64 toUInt64 ( const IMPL_RTL_STRCODE* pStr,
-  sal_Int16 nRadix )
-{
-assert(pStr);
-return toInt(pStr, nRadix);
-}
-
 /* === */
 /* Internal String-Class help functions*/
 /* === */
diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx
index 62157a6bafca..4451866e4588 100644
--- a/sal/rtl/ustring.cxx
+++ b/sal/rtl/ustring.cxx
@@ -1171,30 +1171,35 @@ sal_Bool SAL_CALL rtl_ustr_toBoolean(const sal_Unicode* 
pStr) SAL_THROW_EXTERN_C
 
 sal_Int32 SAL_CALL rtl_ustr_toInt32(const sal_Unicode* pStr, sal_Int16 nRadix) 
SAL_THROW_EXTERN_C()
 {
-return rtl::str::toInt32(pStr, nRadix);
+assert(pStr);
+return rtl::str::toInt(pStr, nRadix);
 }
 
 sal_Int64 SAL_CALL rtl_ustr_toInt64(const sal_Unicode* pStr, sal_Int16 nRadix) 
SAL_THROW_EXTERN_C()
 {
-return rtl::str::toInt64(pStr, nRadix);
+assert(pStr);
+return rtl::str::toInt(pStr, nRadix);
 }
 
 sal_Int64 SAL_CALL rtl_ustr_toInt64_WithLength(const sal_Unicode* pStr, 
sal_Int16 nRadix,

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

2022-03-01 Thread Noel Grandin (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |   10 +-
 sw/source/filter/ww8/writerhelper.cxx|2 
 sw/source/filter/ww8/writerhelper.hxx|   91 ---
 sw/source/filter/ww8/writerwordglue.cxx  |3 
 sw/source/filter/ww8/wrtw8nds.cxx|   20 ++---
 sw/source/filter/ww8/wrtw8sty.cxx|4 -
 sw/source/filter/ww8/wrtww8.cxx  |2 
 sw/source/filter/ww8/ww8atr.cxx  |6 -
 sw/source/filter/ww8/ww8par.cxx  |4 -
 sw/source/filter/ww8/ww8par2.cxx |2 
 sw/source/filter/ww8/ww8par3.cxx |6 -
 sw/source/filter/ww8/ww8par5.cxx |6 -
 sw/source/filter/ww8/ww8par6.cxx |   12 +--
 13 files changed, 37 insertions(+), 131 deletions(-)

New commits:
commit 2d33c22e55b7af7481cc36a1fff979a33daf8519
Author: Noel Grandin 
AuthorDate: Tue Mar 1 19:20:44 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 2 08:31:49 2022 +0100

remove writerhelper::DefaultItemGet

the TypedWhichId template methods on SfxItemPool supercede this

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

diff --git a/sw/source/filter/ww8/writerhelper.hxx 
b/sw/source/filter/ww8/writerhelper.hxx
index e07c6759d9c6..a9bb8ce04a66 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -248,71 +248,6 @@ namespace sw
 return dynamic_cast(pItem);
 }
 
-/** Extract a default SfxPoolItem derived property from a SfxItemPool
-
-Writer's attributes are retrieved by passing a numeric identifier
-and receiving a SfxPoolItem reference which must then typically be
-cast back to its original type which is both tedious and verbose.
-
-DefaultItemGet returns a reference to the default property of a
-given SfxItemPool for a given property id, e.g. default fontsize
-
-DefaultItemGet uses item_cast () on the retrieved reference to test
-that the retrieved property is of the type that the developer 
thinks
-it is.
-
-@param rPool
-The SfxItemPool whose default property we want
-
-@param eType
-The numeric identifier of the default property to be retrieved
-
-@tplparam T
-A SfxPoolItem derived class of the retrieved property
-
-@exception std::bad_cast Thrown if the property was not a T
-
-@return The T requested
-*/
-template const T & DefaultItemGet(const SfxItemPool &rPool,
-sal_uInt16 eType)
-{
-return item_cast(rPool.GetDefaultItem(eType));
-}
-
-/** Extract a default SfxPoolItem derived property from a SwDoc
-
-Writer's attributes are retrieved by passing a numeric identifier
-and receiving a SfxPoolItem reference which must then typically be
-cast back to its original type which is both tedious and verbose.
-
-DefaultItemGet returns a reference to the default property of a
-given SwDoc (Writer Document) for a given property id, e.g default
-fontsize
-
-DefaultItemGet uses item_cast () on the retrieved reference to test
-that the retrieved property is of the type that the developer 
thinks
-it is.
-
-@param rPool
-The SfxItemPool whose default property we want
-
-@param eType
-The numeric identifier of the default property to be retrieved
-
-@tplparam T
-A SfxPoolItem derived class of the retrieved property
-
-@exception std::bad_cast Thrown if the property was not a T
-
-@return The T requested
-*/
-template const T & DefaultItemGet(const SwDoc &rDoc,
-sal_uInt16 eType)
-{
-return DefaultItemGet(rDoc.GetAttrPool(), eType);
-}
-
 /** Get the Paragraph Styles of a SwDoc
 
 Writer's styles are in one of those dreaded macro based pre-STL
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index ff9304815f78..658cadabba08 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1706,7 +1706,7 @@ const SvxBrushItem* WW8Export::GetCurrentPageBgBrush() 
const
 if (SfxItemState::SET != eState || !pRet || (!pRet->GetGraphic() &&
 pRet->GetColor() == COL_TRANSPARENT))
 {
-pRet = &(DefaultItemGet(m_rDoc,RES_BACKGROUND));
+pRet = &m_rDoc.GetAttrPool().GetDefaultItem(RES_BACKGROUND);
 }
 return pRet;
 }
@@ -3644,12 +3644,12 @@ WW8Ruby::WW8Ruby(const SwTextNode& rNode, const 
SwFormatRuby& rRuby, const MSWor
 pPool = pPool ? pPool : &rExport.m_rDoc.GetAttrPool();
 

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

2022-03-01 Thread Noel Grandin (via logerrit)
 sw/inc/hintids.hxx  |6 ++
 sw/source/core/bastyp/calc.cxx  |6 +++---
 sw/source/core/fields/expfld.cxx|8 
 sw/source/filter/ww8/writerhelper.cxx   |2 +-
 sw/source/filter/ww8/writerhelper.hxx   |   28 
 sw/source/filter/ww8/writerwordglue.cxx |4 ++--
 sw/source/filter/ww8/wrtw8esh.cxx   |2 +-
 sw/source/filter/ww8/wrtw8nds.cxx   |2 +-
 sw/source/filter/ww8/ww8atr.cxx |   12 +---
 sw/source/filter/ww8/ww8par6.cxx|2 +-
 sw/source/uibase/shells/annotsh.cxx |6 --
 sw/source/uibase/shells/drwtxtsh.cxx|8 ++--
 sw/source/uibase/shells/textsh.cxx  |   12 +++-
 13 files changed, 41 insertions(+), 57 deletions(-)

New commits:
commit 919b923e9fe59bd83d954a53c21635317fea0de7
Author: Noel Grandin 
AuthorDate: Tue Mar 1 19:04:01 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 2 08:31:07 2022 +0100

remove writerhelper::ItemGet

the TypedWhichId template methods on SwContentNode supercede this

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

diff --git a/sw/source/filter/ww8/writerhelper.cxx 
b/sw/source/filter/ww8/writerhelper.cxx
index 64cb0d7959c7..740274453dfb 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -592,7 +592,7 @@ namespace sw
 pBreak = &(ItemGet(*pApply, 
RES_BREAK));
 }
 else if (const SwContentNode *pNd = rNd.GetContentNode())
-pBreak = &(ItemGet(*pNd, RES_BREAK));
+pBreak = &pNd->GetAttr(RES_BREAK);
 
 return pBreak && pBreak->GetBreak() == SvxBreak::PageBefore;
 }
diff --git a/sw/source/filter/ww8/writerhelper.hxx 
b/sw/source/filter/ww8/writerhelper.hxx
index 29e9a8e6b495..65d5c2501bc4 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -248,34 +248,6 @@ namespace sw
 return dynamic_cast(pItem);
 }
 
-/** Extract a SfxPoolItem derived property from a SwContentNode
-
-Writer's attributes are retrieved by passing a numeric identifier
-and receiving a SfxPoolItem reference which must then typically be
-cast back to its original type which is both tedious and verbose.
-
-ItemGet uses item_cast () on the retrieved reference to test that 
the
-retrieved property is of the type that the developer thinks it is.
-
-@param rNode
-The SwContentNode to retrieve the property from
-
-@param eType
-The numeric identifier of the property to be retrieved
-
-@tplparam T
-A SfxPoolItem derived class of the retrieved property
-
-@exception std::bad_cast Thrown if the property was not a T
-
-@return The T requested
-*/
-template const T & ItemGet(const SwContentNode &rNode,
-sal_uInt16 eType)
-{
-return item_cast(rNode.GetAttr(eType));
-}
-
 /** Extract a SfxPoolItem derived property from a SwFormat
 
 Writer's attributes are retrieved by passing a numeric identifier
diff --git a/sw/source/filter/ww8/writerwordglue.cxx 
b/sw/source/filter/ww8/writerwordglue.cxx
index fda1043db476..5474148b5c5d 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -532,8 +532,8 @@ namespace sw
 if (!rText.isEmpty())
 nScript = g_pBreakIt->GetBreakIter()->getScriptType(rText, 0);
 
-rtl_TextEncoding eChrSet = ItemGet(rTextNd,
-GetWhichOfScript(RES_CHRATR_FONT, nScript)).GetCharSet();
+TypedWhichId nFontWhichId = 
GetWhichOfScript(RES_CHRATR_FONT, nScript);
+rtl_TextEncoding eChrSet = 
rTextNd.GetAttr(nFontWhichId).GetCharSet();
 eChrSet = GetExtendedTextEncoding(eChrSet);
 
 CharRuns aRunChanges;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index 6ce80301125c..82392ea5106c 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2425,7 +2425,7 @@ bool WinwordAnchoring::ConvertPosition( 
SwFormatHoriOrient& _iorHoriOri,
 {
 SwTextNode& rAnchorTextNode =
 
dynamic_cast(_rFrameFormat.GetAnchor().GetContentAnchor()->nNode.GetNode());
-const SvxFormatBreakItem& rBreak = 
ItemGet(rAnchorTextNode, RES_BREAK);
+const SvxFormatBreakItem& rBreak = rAnchorTextNode.GetAttr(RES_BREAK);
 if (rBreak.GetBreak() == SvxBreak::ColumnBefore)
 {
 bConvDueToAnchoredAtColBreakPara = true;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index bf0d049b1d6a..394203367dc4 

[Libreoffice-commits] core.git: embeddedobj/qa

2022-03-01 Thread Miklos Vajna (via logerrit)
 embeddedobj/qa/cppunit/general.cxx |   17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit a12b4d548cd4173d87d8736ec6a484becb44d943
Author: Miklos Vajna 
AuthorDate: Tue Mar 1 20:17:41 2022 +0100
Commit: Miklos Vajna 
CommitDate: Wed Mar 2 08:14:21 2022 +0100

CppunitTest_embeddedobj_general: put the base class into an anon namespace

Which reduces the probability that the base class name collides with a
symbol from non-test code.

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

diff --git a/embeddedobj/qa/cppunit/general.cxx 
b/embeddedobj/qa/cppunit/general.cxx
index 815656519c83..c7824fe87eaf 100644
--- a/embeddedobj/qa/cppunit/general.cxx
+++ b/embeddedobj/qa/cppunit/general.cxx
@@ -21,8 +21,10 @@
 
 using namespace ::com::sun::star;
 
-/// embeddedobj general tests.
-class EmbeddedobjGeneralTest : public test::BootstrapFixture, public 
unotest::MacrosTest
+namespace
+{
+/// Covers embeddedobj/source/general/ fixes.
+class Test : public test::BootstrapFixture, public unotest::MacrosTest
 {
 private:
 uno::Reference mxComponent;
@@ -33,22 +35,23 @@ public:
 uno::Reference& getComponent() { return mxComponent; }
 };
 
-void EmbeddedobjGeneralTest::setUp()
+void Test::setUp()
 {
 test::BootstrapFixture::setUp();
 
 mxDesktop.set(frame::Desktop::create(mxComponentContext));
 }
 
-void EmbeddedobjGeneralTest::tearDown()
+void Test::tearDown()
 {
 if (mxComponent.is())
 mxComponent->dispose();
 
 test::BootstrapFixture::tearDown();
 }
+}
 
-CPPUNIT_TEST_FIXTURE(EmbeddedobjGeneralTest, testInsertFileConfig)
+CPPUNIT_TEST_FIXTURE(Test, testInsertFileConfig)
 {
 // Explicitly disable Word->Writer mapping for this test.
 std::shared_ptr pBatch(
@@ -82,7 +85,7 @@ CPPUNIT_TEST_FIXTURE(EmbeddedobjGeneralTest, 
testInsertFileConfig)
 CPPUNIT_ASSERT(!xObject.is());
 }
 
-CPPUNIT_TEST_FIXTURE(EmbeddedobjGeneralTest, testInsertFileConfigVsdx)
+CPPUNIT_TEST_FIXTURE(Test, testInsertFileConfigVsdx)
 {
 // Explicitly disable Word->Writer mapping for this test.
 std::shared_ptr pBatch(
@@ -115,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(EmbeddedobjGeneralTest, 
testInsertFileConfigVsdx)
 CPPUNIT_ASSERT(!xObject.is());
 }
 
-CPPUNIT_TEST_FIXTURE(EmbeddedobjGeneralTest, testInsertFileConfigPdf)
+CPPUNIT_TEST_FIXTURE(Test, testInsertFileConfigPdf)
 {
 // Explicitly disable Word->Writer mapping for this test.
 std::shared_ptr pBatch(


[Libreoffice-commits] core.git: helpcontent2

2022-03-01 Thread Adolfo Jayme Barrientos (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5752760f0af5c5c6411d4dc7704b2a683211341f
Author: Adolfo Jayme Barrientos 
AuthorDate: Wed Mar 2 00:47:25 2022 -0600
Commit: Gerrit Code Review 
CommitDate: Wed Mar 2 07:47:25 2022 +0100

Update git submodules

* Update helpcontent2 from branch 'master'
  to e15b650cf80aea131a4429d4bda438130f4cf601
  - Update menu path

Change-Id: I2f23458e8abc9697b0a2da089e6fd48c86503186
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/130816
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/helpcontent2 b/helpcontent2
index dd0acce90739..e15b650cf80a 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit dd0acce907394934a9323fc2d34290f1db74f166
+Subproject commit e15b650cf80aea131a4429d4bda438130f4cf601


[Libreoffice-commits] help.git: source/text

2022-03-01 Thread Adolfo Jayme Barrientos (via logerrit)
 source/text/swriter/guide/smarttags.xhp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e15b650cf80aea131a4429d4bda438130f4cf601
Author: Adolfo Jayme Barrientos 
AuthorDate: Wed Mar 2 00:46:26 2022 -0600
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 2 07:47:24 2022 +0100

Update menu path

Change-Id: I2f23458e8abc9697b0a2da089e6fd48c86503186
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/130816
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/source/text/swriter/guide/smarttags.xhp 
b/source/text/swriter/guide/smarttags.xhp
index ef9db24ae..26a5b0d50 100644
--- a/source/text/swriter/guide/smarttags.xhp
+++ b/source/text/swriter/guide/smarttags.xhp
@@ -52,7 +52,7 @@
   When you 
point to a Smart Tag, a tip help informs you to CommandCtrl-click
 to open the Smart Tags menu. If you don't use a mouse, position the cursor 
inside the marked text and open the context menu by 
Shift+F10.
   In the 
Smart Tags menu you see the available actions that are defined for this Smart 
Tag. Choose an option from the menu. The Smart Tags 
Options command opens the Smart 
Tags page of Tools - Autocorrect Options.
   To Enable and Disable Smart Tags
-  When you 
have installed at least one Smart Tags extension, you see the Smart Tags page in Tools - Autocorrect Options. Use this dialog to enable 
or disable Smart Tags and to manage the installed tags.
+  When you 
have installed at least one Smart Tags extension, you see the Smart Tags page in Tools - AutoCorrect - AutoCorrect Options. Use this 
dialog to enable or disable Smart Tags and to manage the installed 
tags.
   Text that is 
recognized as a Smart Tag is not checked by the automatic 
spellcheck.

 


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

2022-03-01 Thread Noel Grandin (via logerrit)
 sw/source/filter/ww8/writerhelper.hxx   |   28 
 sw/source/filter/ww8/writerwordglue.cxx |3 +--
 sw/source/filter/ww8/wrtw8esh.cxx   |2 +-
 sw/source/filter/ww8/wrtw8nds.cxx   |   13 ++---
 sw/source/filter/ww8/ww8atr.cxx |   12 +---
 sw/source/filter/ww8/ww8graf.cxx|2 +-
 sw/source/filter/ww8/ww8par.cxx |2 +-
 sw/source/filter/ww8/ww8par6.cxx|   10 +-
 8 files changed, 20 insertions(+), 52 deletions(-)

New commits:
commit aa01aa03b73ddeeae1f98730b21ec77338af5f9e
Author: Noel Grandin 
AuthorDate: Tue Mar 1 18:57:56 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 2 07:46:07 2022 +0100

remove writerhelper::ItemGet

the TypedWhichId template methods on SfxItemSet supercede this

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

diff --git a/sw/source/filter/ww8/writerhelper.hxx 
b/sw/source/filter/ww8/writerhelper.hxx
index 91b881eaf57c..29e9a8e6b495 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -302,34 +302,6 @@ namespace sw
 return item_cast(rFormat.GetFormatAttr(eType));
 }
 
-/** Extract a SfxPoolItem derived property from a SfxItemSet
-
-Writer's attributes are retrieved by passing a numeric identifier
-and receiving a SfxPoolItem reference which must then typically be
-cast back to its original type which is both tedious and verbose.
-
-ItemGet uses item_cast () on the retrieved reference to test that 
the
-retrieved property is of the type that the developer thinks it is.
-
-@param rSet
-The SfxItemSet to retrieve the property from
-
-@param eType
-The numeric identifier of the property to be retrieved
-
-@tplparam T
-A SfxPoolItem derived class of the retrieved property
-
-@exception std::bad_cast Thrown if the property was not a T
-
-@return The T requested
-*/
-template const T & ItemGet(const SfxItemSet &rSet,
-sal_uInt16 eType)
-{
-return item_cast(rSet.Get(eType));
-}
-
 /** Extract a default SfxPoolItem derived property from a SfxItemPool
 
 Writer's attributes are retrieved by passing a numeric identifier
diff --git a/sw/source/filter/ww8/writerwordglue.cxx 
b/sw/source/filter/ww8/writerwordglue.cxx
index 3d4a06e5cce3..fda1043db476 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -404,8 +404,7 @@ namespace sw
 {
 dyaHdrTop = dyaHdrBottom = 0;
 }
-const SvxULSpaceItem &rUL =
-ItemGet(rPage, RES_UL_SPACE);
+const SvxULSpaceItem &rUL = rPage.Get(RES_UL_SPACE);
 dyaHdrTop += rUL.GetUpper();
 dyaHdrBottom += rUL.GetLower();
 
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index 7927d230a553..6ce80301125c 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1032,7 +1032,7 @@ void MSWord_SdrAttrIter::NextPara( sal_Int32 nPar )
 
 SfxItemSet aSet( pEditObj->GetParaAttribs( nPara ));
 pEditPool = aSet.GetPool();
-eNdChrSet = ItemGet(aSet,EE_CHAR_FONTINFO).GetCharSet();
+eNdChrSet = aSet.Get(EE_CHAR_FONTINFO).GetCharSet();
 
 assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is());
 nScript = g_pBreakIt->GetBreakIter()->getScriptType( 
pEditObj->GetText(nPara), 0);
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 36d80ebb427d..bf0d049b1d6a 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -403,7 +403,7 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool 
bWriteCombChars)
  script, the idea is that the font that is actually in use to render this
  range of text ends up in pFont
 */
-sal_uInt16 nFontId = GetWhichOfScript( RES_CHRATR_FONT, GetScript() );
+TypedWhichId nFontId = GetWhichOfScript( RES_CHRATR_FONT, 
GetScript() );
 
 const SvxFontItem &rParentFont = ItemGet(
 static_cast(rNd.GetAnyFormatColl()), nFontId);
@@ -418,7 +418,7 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool 
bWriteCombChars)
 // only copy hard attributes - bDeep = false
 aExportSet.Set(rNd.GetSwAttrSet(), false/*bDeep*/);
 // get the current font item. Use rNd.GetSwAttrSet instead of 
aExportSet:
-const SvxFontItem &rNdFont = ItemGet(rNd.GetSwAttrSet(), 
nFontId);
+const SvxFontItem &rNdFont = rNd.GetSwAttrSet().Get(nFontId);
 pFont = &rNdFont;
 aExportSet.ClearItem(nFontId);
 }
@@ -2807,7 +2807,7 @@ void MSWordExportBase::OutputTextNode(

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 sw/source/core/layout/tabfrm.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 8dff1bd93a2f1db463002fc660f98388f69484a0
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 11:45:23 2022 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 2 06:30:39 2022 +0100

protect frame from triggering deleting itself

LIBREOFFICE-N4LA0OHZ

Change-Id: I0d24277665a317f047b286fe0f0878b3814ded65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130788
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index f0ad11a0653a..7786f3aec4fc 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2114,6 +2114,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* 
pRenderContext)
 }
 SwFootnoteBossFrame *pOldBoss = bFootnotesInDoc ? 
FindFootnoteBossFrame( true ) : nullptr;
 bool bReformat;
+SwFrameDeleteGuard g(this);
 if ( MoveBwd( bReformat ) )
 {
 aRectFnSet.Refresh(this);


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/source

2022-03-01 Thread Heiko Tietze (via logerrit)
 sw/source/ui/misc/outline.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit a0ad72cb1404544ae0a3c3062431ed22edb7fa21
Author: Heiko Tietze 
AuthorDate: Fri Feb 18 11:29:26 2022 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 2 06:29:50 2022 +0100

Resolves tdf#137381 - Use app colors on chapter numbering preview

Change-Id: I8e5edec1ad6f4b6f44855014ce91a642efbd75f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130133
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
(cherry picked from commit 87aeb7be943921942f791cd182122e8e073ce804)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130154
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index c7fa599c9bfa..3c1345f308ae 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -875,8 +876,8 @@ void NumberingPreview::Paint(vcl::RenderContext& 
rRenderContext, const tools::Re
 pVDev->SetOutputSize(aSize);
 
 // #101524# OJ
-
pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor());
-
pVDev->SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetButtonTextColor());
+pVDev->SetFillColor(SwViewOption::GetDocColor());
+pVDev->SetLineColor(SwViewOption::GetDocBoundariesColor());
 pVDev->DrawRect(tools::Rectangle(Point(0,0), aSize));
 
 if (pActNum)
@@ -897,8 +898,11 @@ void NumberingPreview::Paint(vcl::RenderContext& 
rRenderContext, const tools::Re
 tools::Long nYStart = 4;
 aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, 
GetAppLanguage(),
 GetDefaultFontFlags::OnlyOne, 
&rRenderContext);
-// #101524# OJ
-aStdFont.SetColor(SwViewOption::GetFontColor());
+
+if (svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR, 
false).nColor == COL_AUTO)
+aStdFont.SetColor( SwViewOption::GetDocColor().IsDark() ? 
COL_WHITE : COL_BLACK );
+else
+aStdFont.SetColor( SwViewOption::GetFontColor() );
 
 const tools::Long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10;
 aStdFont.SetFontSize(Size( 0, nFontHeight ));


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - icon-themes/sukapura icon-themes/sukapura_svg

2022-03-01 Thread Rizal Muttaqin (via logerrit)
 icon-themes/sukapura/cmd/32/grow.png  |binary
 icon-themes/sukapura/cmd/32/shrink.png|binary
 icon-themes/sukapura/cmd/32/smallcaps.png |binary
 icon-themes/sukapura/cmd/lc_defaultcharstyle.png  |binary
 icon-themes/sukapura/cmd/lc_grow.png  |binary
 icon-themes/sukapura/cmd/lc_shrink.png|binary
 icon-themes/sukapura/cmd/lc_smallcaps.png |binary
 icon-themes/sukapura/cmd/lc_textbodyparastyle.png |binary
 icon-themes/sukapura/cmd/sc_grow.png  |binary
 icon-themes/sukapura/cmd/sc_shrink.png|binary
 icon-themes/sukapura/cmd/sc_smallcaps.png |binary
 icon-themes/sukapura_svg/cmd/32/grow.svg  |2 +-
 icon-themes/sukapura_svg/cmd/32/ko/grow.svg   |1 -
 icon-themes/sukapura_svg/cmd/32/ko/shrink.svg |1 -
 icon-themes/sukapura_svg/cmd/32/shrink.svg|2 +-
 icon-themes/sukapura_svg/cmd/32/smallcaps.svg |6 +-
 icon-themes/sukapura_svg/cmd/ko/lc_grow.svg   |1 -
 icon-themes/sukapura_svg/cmd/ko/lc_shrink.svg |1 -
 icon-themes/sukapura_svg/cmd/ko/sc_grow.svg   |1 -
 icon-themes/sukapura_svg/cmd/ko/sc_shrink.svg |1 -
 icon-themes/sukapura_svg/cmd/lc_defaultcharstyle.svg  |2 +-
 icon-themes/sukapura_svg/cmd/lc_grow.svg  |2 +-
 icon-themes/sukapura_svg/cmd/lc_shrink.svg|2 +-
 icon-themes/sukapura_svg/cmd/lc_smallcaps.svg |2 +-
 icon-themes/sukapura_svg/cmd/lc_textbodyparastyle.svg |2 +-
 icon-themes/sukapura_svg/cmd/sc_grow.svg  |2 +-
 icon-themes/sukapura_svg/cmd/sc_shrink.svg|2 +-
 icon-themes/sukapura_svg/cmd/sc_smallcaps.svg |2 +-
 28 files changed, 15 insertions(+), 17 deletions(-)

New commits:
commit 1739fbb9a22d2e275329f1f1ce9fbfa3aea7b7fa
Author: Rizal Muttaqin 
AuthorDate: Tue Mar 1 06:25:32 2022 +0700
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 2 06:28:38 2022 +0100

Sukapura: tdf#147664 Revise Increase Font & Decrease Font, Default Style,

Small Caps icons

Change-Id: I1348cc7fbde63d335ba3676a4c424d76f8cf2349
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130681
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/icon-themes/sukapura/cmd/32/grow.png 
b/icon-themes/sukapura/cmd/32/grow.png
index a8f5d739eac1..f6d50b1d6b5c 100644
Binary files a/icon-themes/sukapura/cmd/32/grow.png and 
b/icon-themes/sukapura/cmd/32/grow.png differ
diff --git a/icon-themes/sukapura/cmd/32/shrink.png 
b/icon-themes/sukapura/cmd/32/shrink.png
index f14197a4b0c5..f6932cb02d26 100644
Binary files a/icon-themes/sukapura/cmd/32/shrink.png and 
b/icon-themes/sukapura/cmd/32/shrink.png differ
diff --git a/icon-themes/sukapura/cmd/32/smallcaps.png 
b/icon-themes/sukapura/cmd/32/smallcaps.png
index 0c19165ed03e..e69de29bb2d1 100644
Binary files a/icon-themes/sukapura/cmd/32/smallcaps.png and 
b/icon-themes/sukapura/cmd/32/smallcaps.png differ
diff --git a/icon-themes/sukapura/cmd/lc_defaultcharstyle.png 
b/icon-themes/sukapura/cmd/lc_defaultcharstyle.png
index af57cae79a92..8dcca8c2178e 100644
Binary files a/icon-themes/sukapura/cmd/lc_defaultcharstyle.png and 
b/icon-themes/sukapura/cmd/lc_defaultcharstyle.png differ
diff --git a/icon-themes/sukapura/cmd/lc_grow.png 
b/icon-themes/sukapura/cmd/lc_grow.png
index 96716988b8c7..f26850dcd2cd 100644
Binary files a/icon-themes/sukapura/cmd/lc_grow.png and 
b/icon-themes/sukapura/cmd/lc_grow.png differ
diff --git a/icon-themes/sukapura/cmd/lc_shrink.png 
b/icon-themes/sukapura/cmd/lc_shrink.png
index 6d5b8ea7ce3d..1457cda3f521 100644
Binary files a/icon-themes/sukapura/cmd/lc_shrink.png and 
b/icon-themes/sukapura/cmd/lc_shrink.png differ
diff --git a/icon-themes/sukapura/cmd/lc_smallcaps.png 
b/icon-themes/sukapura/cmd/lc_smallcaps.png
index 77828a7749fa..125eddd50a01 100644
Binary files a/icon-themes/sukapura/cmd/lc_smallcaps.png and 
b/icon-themes/sukapura/cmd/lc_smallcaps.png differ
diff --git a/icon-themes/sukapura/cmd/lc_textbodyparastyle.png 
b/icon-themes/sukapura/cmd/lc_textbodyparastyle.png
index fba6822e3682..90daf2c49191 100644
Binary files a/icon-themes/sukapura/cmd/lc_textbodyparastyle.png and 
b/icon-themes/sukapura/cmd/lc_textbodyparastyle.png differ
diff --git a/icon-themes/sukapura/cmd/sc_grow.png 
b/icon-themes/sukapura/cmd/sc_grow.png
index c7c106dc52a6..9917192dbc44 100644
Binary files a/icon-themes/sukapura/cmd/sc_grow.png and 
b/icon-themes/sukapura/cmd/sc_grow.png differ
diff --git a/icon-themes/sukapura/cmd/sc_shrink.png 
b/icon-themes/sukapura/cmd/sc_shrink.png
index f1445ca9238b..4273b8880432 100644
Binary files a/icon-themes/sukapura/cmd/sc_shrink.png and 
b/icon-themes/sukapura/cmd/sc_shrink.png differ
diff --git a/icon-themes/sukapura/cmd/sc_smallcaps.png 
b/icon-themes/sukapura/cmd/sc_smallcaps.png
index 5ee5fa917921..1ef127831763 100644
Binary f

[Libreoffice-commits] core.git: sal/rtl

2022-03-01 Thread Mike Kaganski (via logerrit)
 sal/rtl/strtmpl.hxx |  145 
 1 file changed, 56 insertions(+), 89 deletions(-)

New commits:
commit 5b03e07dd21b56e99d6b6b60edec1ed2f388bfc2
Author: Mike Kaganski 
AuthorDate: Wed Mar 2 00:36:10 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Mar 2 06:22:22 2022 +0100

Unify and deduplicate to[U]Int[_WithLength]

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

diff --git a/sal/rtl/strtmpl.hxx b/sal/rtl/strtmpl.hxx
index 78375ae07e26..a6b06ad0256e 100644
--- a/sal/rtl/strtmpl.hxx
+++ b/sal/rtl/strtmpl.hxx
@@ -761,58 +761,63 @@ template  sal_Bool toBoolean( 
const IMPL_RTL_STRCODE*
 }
 
 /* --- */
-template 
-T toInt_WithLength  ( const 
IMPL_RTL_STRCODE* pStr,
-  sal_Int16 
nRadix,
-  sal_Int32 
nStrLength )
+
+template  inline bool HandleSignChar(Iter& iter)
+{
+if constexpr (std::numeric_limits::is_signed)
+{
+if (*iter == '-')
+{
+++iter;
+return true;
+}
+}
+if (*iter == '+')
+++iter;
+return false;
+}
+
+template  std::pair DivMod(sal_Int16 nRadix, 
[[maybe_unused]] bool bNeg)
+{
+if constexpr (std::numeric_limits::is_signed)
+if (bNeg)
+return { -(std::numeric_limits::min() / nRadix),
+ -(std::numeric_limits::min() % nRadix) };
+return { std::numeric_limits::max() / nRadix, 
std::numeric_limits::max() % nRadix };
+}
+
+template  auto getIter(const SV& sv) { return sv.begin(); }
+template  auto getIter(const C* pStr) { return pStr; }
+
+template  auto good(typename SV::iterator iter, const SV& sv) { 
return iter != sv.end(); }
+template  auto good(const C* pStr, const C*) { return *pStr != 0; }
+
+template  T toInt(S str, sal_Int16 nRadix)
 {
-static_assert(std::numeric_limits::is_signed, "is signed");
 assert( nRadix >= RTL_STR_MIN_RADIX && nRadix <= RTL_STR_MAX_RADIX );
-assert( nStrLength >= 0 );
-boolbNeg;
-sal_Int16   nDigit;
-U   n = 0;
-const IMPL_RTL_STRCODE* pEnd = pStr + nStrLength;
 
 if ( (nRadix < RTL_STR_MIN_RADIX) || (nRadix > RTL_STR_MAX_RADIX) )
 nRadix = 10;
 
+auto pStr = getIter(str);
+
 /* Skip whitespaces */
-while ( pStr != pEnd && rtl_ImplIsWhitespace( IMPL_RTL_USTRCODE( *pStr ) ) 
)
+while (good(pStr, str) && rtl_ImplIsWhitespace(IMPL_RTL_USTRCODE(*pStr)))
 pStr++;
+if (!good(pStr, str))
+return 0;
 
-if ( *pStr == '-' )
-{
-bNeg = true;
-pStr++;
-}
-else
-{
-if ( *pStr == '+' )
-pStr++;
-bNeg = false;
-}
-
-T nDiv;
-sal_Int16 nMod;
-if ( bNeg )
-{
-nDiv = -(std::numeric_limits::min() / nRadix);
-nMod = -(std::numeric_limits::min() % nRadix);
-}
-else
-{
-nDiv = std::numeric_limits::max() / nRadix;
-nMod = std::numeric_limits::max() % nRadix;
-}
+const bool bNeg = HandleSignChar(pStr);
+const auto& [nDiv, nMod] = DivMod(nRadix, bNeg);
+assert(nDiv > 0);
 
-while ( pStr != pEnd )
+std::make_unsigned_t n = 0;
+while (good(pStr, str))
 {
-nDigit = rtl_ImplGetDigit( IMPL_RTL_USTRCODE( *pStr ), nRadix );
+sal_Int16 nDigit = rtl_ImplGetDigit(IMPL_RTL_USTRCODE(*pStr), nRadix);
 if ( nDigit < 0 )
 break;
-assert(nDiv > 0);
-if( static_cast( nMod < nDigit ? nDiv-1 : nDiv ) < n )
+if (static_cast>(nMod < nDigit ? nDiv - 1 : 
nDiv) < n)
 return 0;
 
 n *= nRadix;
@@ -821,11 +826,12 @@ T toInt_WithLength
  ( const IMPL_RTL
 pStr++;
 }
 
-if ( bNeg )
-return n == static_cast(std::numeric_limits::min())
-? std::numeric_limits::min() : -static_cast(n);
-else
-return static_cast(n);
+if constexpr (std::numeric_limits::is_signed)
+if (bNeg)
+return n == 
static_cast>(std::numeric_limits::min())
+   ? std::numeric_limits::min()
+   : -static_cast(n);
+return static_cast(n);
 }
 
 template 
@@ -833,7 +839,7 @@ sal_Int32 toInt32 ( const 
IMPL_RTL_STRCODE* pStr,
 sal_Int16 nRadix )
 {
 assert(pStr);
-return toInt_WithLength(pStr, nRadix, 
getLength(pStr));
+return toInt(pStr, nRadix);
 }
 
 template 
@@ -843,7 +849,7 @@ sal_Int32 toInt32_WithLength  ( const 
IMPL_RTL_STRCODE* pStr,
 
 {
 assert(pStr);
-return toInt_WithLength(pStr, nRadix, nStrLength);
+   

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

2022-03-01 Thread Justin Luth (via logerrit)
 sc/source/core/data/dpcache.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit b7f654a406b704f469d1df424d83a3d98ae46432
Author: Justin Luth 
AuthorDate: Tue Mar 1 08:54:25 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Mar 2 06:12:02 2022 +0100

tdf#118117 sc pivottable: STR_PIVOT_DATA is an existing name too

This fixes a LO 6.0 regression from
commit a078328e91ab9cbd78a92608c1abdc2c57ff9ac5

I looked for existing unit test examples using
assert (rLabel != ScResId(STR_PIVOT_DATA));
but found nothing.

I don't see the need for a unit test here.
The whole pivot table is messed up if you duplicate
a label, so why bother testing. It just is not
as bad now as it was before.

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

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 0f3778eb40a6..52109c673bd3 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -356,9 +356,11 @@ void normalizeAddLabel(const OUString& rLabel, 
std::vector& rLabels, L
 
 std::vector normalizeLabels(const std::vector& 
rColData)
 {
-std::vector aLabels(1u, ScResId(STR_PIVOT_DATA));
+std::vector aLabels;
+aLabels.reserve(rColData.size() + 1);
 
 LabelSet aExistingNames;
+normalizeAddLabel(ScResId(STR_PIVOT_DATA), aLabels, aExistingNames);
 
 for (const InitColumnData& rCol : rColData)
 normalizeAddLabel(rCol.maLabel, aLabels, aExistingNames);
@@ -368,10 +370,11 @@ std::vector normalizeLabels(const 
std::vector& rColDat
 
 std::vector normalizeLabels(const ScDPCache::DBConnector& rDB, const 
sal_Int32 nLabelCount)
 {
-std::vector aLabels(1u, ScResId(STR_PIVOT_DATA));
+std::vector aLabels;
 aLabels.reserve(nLabelCount + 1);
 
 LabelSet aExistingNames;
+normalizeAddLabel(ScResId(STR_PIVOT_DATA), aLabels, aExistingNames);
 
 for (sal_Int32 nCol = 0; nCol < nLabelCount; ++nCol)
 {


Gautham Krishan license statement

2022-03-01 Thread Gautham Krishnan
All of my past & future contributions to LibreOffice may be licensed
under the MPLv2/LGPLv3+ dual license.


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/unx

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   27 ++-
 1 file changed, 26 insertions(+), 1 deletion(-)

New commits:
commit e388a4d6d7ab355fc7aa5fca05e06070693847e9
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 16:50:37 2022 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 2 04:30:47 2022 +0100

Resolves: tdf#145580 need to use gtk_im_context_filter_keypress

for at least xim, ibus works fine. To reproduce under Fedora with gtk3
can use a keyboard layout of "US International with dead keys" with
export GDK_BACKEND=x11
export GTK_IM_MODULE=xim

and 'a in writer comment or calc header/footer dialog

Change-Id: I49425887dccc23c4fadf2bc007b6e83fc7993f7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130802
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index aa5b0685aa21..d106aaf92c78 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -3911,7 +3911,7 @@ public:
 }
 
 #if !GTK_CHECK_VERSION(4, 0, 0)
-bool signal_key(const GdkEventKey* pEvent)
+virtual bool do_signal_key(const GdkEventKey* pEvent)
 {
 if (pEvent->type == GDK_KEY_PRESS && m_aKeyPressHdl.IsSet())
 {
@@ -3925,6 +3925,11 @@ public:
 }
 return false;
 }
+
+bool signal_key(const GdkEventKey* pEvent)
+{
+return do_signal_key(pEvent);
+}
 #endif
 
 virtual void grab_add() override
@@ -16855,6 +16860,10 @@ public:
 return signal_im_context_delete_surrounding(rRange);
 }
 
+#if !GTK_CHECK_VERSION(4, 0, 0)
+virtual bool do_signal_key(const GdkEventKey* pEvent) override;
+#endif
+
 virtual void queue_draw() override
 {
 gtk_widget_queue_draw(GTK_WIDGET(m_pDrawingArea));
@@ -17206,8 +17215,24 @@ public:
 pThis->updateIMSpotLocation();
 pThis->EndExtTextInput();
 }
+
+#if !GTK_CHECK_VERSION(4, 0, 0)
+bool im_context_filter_keypress(const GdkEventKey* pEvent)
+{
+return gtk_im_context_filter_keypress(m_pIMContext, 
const_cast(pEvent));
+}
+#endif
 };
 
+#if !GTK_CHECK_VERSION(4, 0, 0)
+bool GtkInstanceDrawingArea::do_signal_key(const GdkEventKey* pEvent)
+{
+if (m_xIMHandler && m_xIMHandler->im_context_filter_keypress(pEvent))
+return true;
+return GtkInstanceWidget::do_signal_key(pEvent);
+}
+#endif
+
 void GtkInstanceDrawingArea::set_input_context(const InputContext& 
rInputContext)
 {
 bool bUseIm(rInputContext.GetOptions() & InputContextFlags::Text);


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - vcl/unx

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   43 +--
 1 file changed, 41 insertions(+), 2 deletions(-)

New commits:
commit 8badc2314961e87e0b2cc01164442d97e20f9419
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 16:50:37 2022 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 2 04:30:00 2022 +0100

Resolves: tdf#145580 need to use gtk_im_context_filter_keypress

for at least xim, ibus works fine. To reproduce under Fedora with gtk3
can use a keyboard layout of "US International with dead keys" with
export GDK_BACKEND=x11
export GTK_IM_MODULE=xim

and 'a in writer comment or calc header/footer dialog

Change-Id: I49425887dccc23c4fadf2bc007b6e83fc7993f7a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130775
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index fad6ad3846fa..31935aea6102 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -4017,7 +4017,8 @@ public:
 return false;
 }
 #else
-bool signal_key_press(const GdkEventKey* pEvent)
+
+virtual bool do_signal_key_press(const GdkEventKey* pEvent)
 {
 if (m_aKeyPressHdl.IsSet())
 {
@@ -4027,7 +4028,7 @@ public:
 return false;
 }
 
-bool signal_key_release(const GdkEventKey* pEvent)
+virtual bool do_signal_key_release(const GdkEventKey* pEvent)
 {
 if (m_aKeyReleaseHdl.IsSet())
 {
@@ -4036,6 +4037,16 @@ public:
 }
 return false;
 }
+
+bool signal_key_press(const GdkEventKey* pEvent)
+{
+return do_signal_key_press(pEvent);
+}
+
+bool signal_key_release(const GdkEventKey* pEvent)
+{
+return do_signal_key_release(pEvent);
+}
 #endif
 
 virtual void grab_add() override
@@ -17424,6 +17435,11 @@ public:
 return signal_im_context_delete_surrounding(rRange);
 }
 
+#if !GTK_CHECK_VERSION(4, 0, 0)
+virtual bool do_signal_key_press(const GdkEventKey* pEvent) override;
+virtual bool do_signal_key_release(const GdkEventKey* pEvent) override;
+#endif
+
 virtual void queue_draw() override
 {
 gtk_widget_queue_draw(GTK_WIDGET(m_pDrawingArea));
@@ -17805,8 +17821,31 @@ public:
 pThis->updateIMSpotLocation();
 pThis->EndExtTextInput();
 }
+
+#if !GTK_CHECK_VERSION(4, 0, 0)
+bool im_context_filter_keypress(const GdkEventKey* pEvent)
+{
+return gtk_im_context_filter_keypress(m_pIMContext, 
const_cast(pEvent));
+}
+#endif
 };
 
+#if !GTK_CHECK_VERSION(4, 0, 0)
+bool GtkInstanceDrawingArea::do_signal_key_press(const GdkEventKey* pEvent)
+{
+if (m_xIMHandler && m_xIMHandler->im_context_filter_keypress(pEvent))
+return true;
+return GtkInstanceWidget::do_signal_key_press(pEvent);
+}
+
+bool GtkInstanceDrawingArea::do_signal_key_release(const GdkEventKey* pEvent)
+{
+if (m_xIMHandler && m_xIMHandler->im_context_filter_keypress(pEvent))
+return true;
+return GtkInstanceWidget::do_signal_key_release(pEvent);
+}
+#endif
+
 void GtkInstanceDrawingArea::set_input_context(const InputContext& 
rInputContext)
 {
 bool bUseIm(rInputContext.GetOptions() & InputContextFlags::Text);


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

2022-03-01 Thread Hossein (via logerrit)
 sax/source/fastparser/fastparser.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d1cfe4228316322d0ae9f3b8020036e5140fc32b
Author: Hossein 
AuthorDate: Tue Mar 1 14:33:33 2022 +0100
Commit: Hossein 
CommitDate: Wed Mar 2 02:11:23 2022 +0100

Remove 'const' from for loop variable

In the commit f63a6f2e396fa41ed1338dcec874e06159cafa9f, a for loop is
converted into a range-based for loop. The pointer is used to change
the nodes using xmlUnlinkNode() and xmlFreeNode(), thus the 'const'
should have not been used.

The reinterpret_cast does not change the constness, thus I have
removed the const from the loop variable, and it will no longer be a
const reference.

Change-Id: If4c61017ea77f464230bb5802f6fc928acc7a7e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130792
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sax/source/fastparser/fastparser.cxx 
b/sax/source/fastparser/fastparser.cxx
index beb30443ba02..71b316378e01 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -674,7 +674,7 @@ FastSaxParserImpl::~FastSaxParserImpl()
 {
 if( mxDocumentLocator.is() )
 mxDocumentLocator->dispose();
-for (const auto& entity : m_TemporalEntities)
+for (auto& entity : m_TemporalEntities)
 {
 if (!entity)
 continue;


[Libreoffice-commits] core.git: Changes to 'refs/tags/cp-21.06.19-1'

2022-03-01 Thread Andras Timar (via logerrit)
Tag 'cp-21.06.19-1' created by Andras Timar  at 
2022-03-01 21:40 +

cp-21.06.19-1

Changes since cp-21.06.18-1-2:
---
 0 files changed
---


[Libreoffice-commits] translations.git: Changes to 'refs/tags/cp-21.06.19-1'

2022-03-01 Thread Andras Timar (via logerrit)
Tag 'cp-21.06.19-1' created by Andras Timar  at 
2022-03-01 21:40 +

cp-21.06.19-1

Changes since cp-21.06.13-1-1:
---
 0 files changed
---


[Libreoffice-commits] help.git: Changes to 'refs/tags/cp-21.06.19-1'

2022-03-01 Thread Adolfo Jayme Barrientos (via logerrit)
Tag 'cp-21.06.19-1' created by Andras Timar  at 
2022-03-01 21:40 +

cp-21.06.19-1

Changes since co-2021-branch-point-10:
---
 0 files changed
---


[Libreoffice-commits] dictionaries.git: Changes to 'refs/tags/cp-21.06.19-1'

2022-03-01 Thread Andras Timar (via logerrit)
Tag 'cp-21.06.19-1' created by Andras Timar  at 
2022-03-01 21:40 +

cp-21.06.19-1

Changes since libreoffice-7-1-branch-point-5:
---
 0 files changed
---


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - configure.ac

2022-03-01 Thread Andras Timar (via logerrit)
Rebased ref, commits from common ancestor:
commit a7dfb7c4476bec2095e404d1fc43e0d46e3b2361
Author: Andras Timar 
AuthorDate: Tue Mar 1 22:38:02 2022 +0100
Commit: Andras Timar 
CommitDate: Tue Mar 1 22:39:00 2022 +0100

Bump version to 21.06.19.1

Change-Id: I505d783ee087d113a53bafce257f16bdfd87ae7a

diff --git a/configure.ac b/configure.ac
index 2991ef0b09bf..18dce3937ed0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([Collabora Office],[21.06.18.1],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[21.06.19.1],[],[],[https://collaboraoffice.com/])
 
 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just 
fine if it is installed
 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails 
hard


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - configure.ac

2022-03-01 Thread Andras Timar (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 931511d7843f989da744432485bc84efe47cbc70
Author: Andras Timar 
AuthorDate: Tue Mar 1 22:38:02 2022 +0100
Commit: Andras Timar 
CommitDate: Tue Mar 1 22:38:02 2022 +0100

Bump version to 21.16.19.1

Change-Id: I505d783ee087d113a53bafce257f16bdfd87ae7a

diff --git a/configure.ac b/configure.ac
index 2991ef0b09bf..18dce3937ed0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([Collabora Office],[21.06.18.1],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[21.06.19.1],[],[],[https://collaboraoffice.com/])
 
 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just 
fine if it is installed
 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails 
hard


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

2022-03-01 Thread Caolán McNamara (via logerrit)
 sc/inc/documentimport.hxx|2 ++
 sc/source/core/data/documentimport.cxx   |   14 ++
 sc/source/filter/oox/sheetdatabuffer.cxx |   16 ++--
 3 files changed, 30 insertions(+), 2 deletions(-)

New commits:
commit 0f62288b989f78e3e757aa7f3811c9fad03c1c0d
Author: Caolán McNamara 
AuthorDate: Wed Feb 16 11:14:48 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 22:25:32 2022 +0100

clear ScDocumentImport position cache if iterators are invalid

SheetDataBuffer::finalizeArrayFormula calls

ScCellRangeObj::setArrayTokens
ScDocFunc::EnterMatrix
ScDocument::InsertMatrixFormula

and InsertMatrixFormula calls the variant of ScColumn::SetFormulaCell
which doesn't take a sc::ColumnBlockPosition& param when SetFormulaCell
adds a cell to the column so any iterators belonging to ScDocumentImport
are invalid.

Change-Id: Ic2814ecbeafdeb99632d2a255ed6c1dedf7376b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130151
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
(cherry picked from commit fea55f5ef8dba16706033c9efdd33c45477eb333)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130309
Reviewed-by: Michael Stahl 
Reviewed-by: Eike Rathke 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/inc/documentimport.hxx b/sc/inc/documentimport.hxx
index cefe2949dcc7..0e49e073fd62 100644
--- a/sc/inc/documentimport.hxx
+++ b/sc/inc/documentimport.hxx
@@ -125,6 +125,8 @@ public:
 
 void setMergedCells(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2);
 
+void invalidateBlockPositionSet(SCTAB nTab);
+
 void finalize();
 
 /** Broadcast all formula cells that are marked with
diff --git a/sc/source/core/data/documentimport.cxx 
b/sc/source/core/data/documentimport.cxx
index 2dbc61c03938..d2350c1cdb6b 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -96,6 +96,15 @@ struct ScDocumentImportImpl
 return rTab.getBlockPosition(nCol);
 }
 
+void invalidateBlockPositionSet(SCTAB nTab)
+{
+if (o3tl::make_unsigned(nTab) >= maBlockPosSet.size())
+return;
+
+sc::TableColumnBlockPositionSet& rTab = maBlockPosSet[nTab];
+rTab.invalidate();
+}
+
 void initForSheets()
 {
 size_t n = mrDoc.GetTableCount();
@@ -183,6 +192,11 @@ void ScDocumentImport::setOriginDate(sal_uInt16 nYear, 
sal_uInt16 nMonth, sal_uI
 mpImpl->mrDoc.pDocOptions->SetDate(nDay, nMonth, nYear);
 }
 
+void ScDocumentImport::invalidateBlockPositionSet(SCTAB nTab)
+{
+mpImpl->invalidateBlockPositionSet(nTab);
+}
+
 void ScDocumentImport::setAutoInput(const ScAddress& rPos, const OUString& 
rStr, const ScSetStringParam* pStringParam)
 {
 ScTable* pTab = mpImpl->mrDoc.FetchTable(rPos.Tab());
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx 
b/sc/source/filter/oox/sheetdatabuffer.cxx
index e497ee44f8d8..29de63bdb9f4 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -443,9 +443,22 @@ void SheetDataBuffer::addColXfStyleProcessRowRanges()
 
 void SheetDataBuffer::finalizeImport()
 {
+ScDocumentImport& rDocImport = getDocImport();
+
+SCTAB nStartTabInvalidatedIters(SCTAB_MAX);
+SCTAB nEndTabInvalidatedIters(0);
+
 // create all array formulas
 for( const auto& [rRange, rTokens] : maArrayFormulas )
-finalizeArrayFormula( rRange, rTokens );
+{
+finalizeArrayFormula(rRange, rTokens);
+
+nStartTabInvalidatedIters = std::min(rRange.aStart.Tab(), 
nStartTabInvalidatedIters);
+nEndTabInvalidatedIters = std::max(rRange.aEnd.Tab(), 
nEndTabInvalidatedIters);
+}
+
+for (SCTAB nTab = nStartTabInvalidatedIters; nTab <= 
nEndTabInvalidatedIters; ++nTab)
+rDocImport.invalidateBlockPositionSet(nTab);
 
 // create all table operations
 for( const auto& [rRange, rModel] : maTableOperations )
@@ -458,7 +471,6 @@ void SheetDataBuffer::finalizeImport()
 
 addColXfStyleProcessRowRanges();
 
-ScDocumentImport& rDocImport = getDocImport();
 ScDocument& rDoc = rDocImport.getDoc();
 StylesBuffer& rStyles = getStyles();
 for ( const auto& [rCol, rRowStyles] : maStylesPerColumn )


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

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   43 +--
 1 file changed, 41 insertions(+), 2 deletions(-)

New commits:
commit dc99d27f04b47c173de934a19b6d6a3cc572c20a
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 16:50:37 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 22:20:38 2022 +0100

Resolves: tdf#145580 need to use gtk_im_context_filter_keypress

for at least xim, ibus works fine. To reproduce under Fedora with gtk3
can use a keyboard layout of "US International with dead keys" with
export GDK_BACKEND=x11
export GTK_IM_MODULE=xim

and 'a in writer comment or calc header/footer dialog

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 125c58808bf3..b0566791d4f1 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -3996,7 +3996,8 @@ public:
 return false;
 }
 #else
-bool signal_key_press(const GdkEventKey* pEvent)
+
+virtual bool do_signal_key_press(const GdkEventKey* pEvent)
 {
 if (m_aKeyPressHdl.IsSet())
 {
@@ -4006,7 +4007,7 @@ public:
 return false;
 }
 
-bool signal_key_release(const GdkEventKey* pEvent)
+virtual bool do_signal_key_release(const GdkEventKey* pEvent)
 {
 if (m_aKeyReleaseHdl.IsSet())
 {
@@ -4015,6 +4016,16 @@ public:
 }
 return false;
 }
+
+bool signal_key_press(const GdkEventKey* pEvent)
+{
+return do_signal_key_press(pEvent);
+}
+
+bool signal_key_release(const GdkEventKey* pEvent)
+{
+return do_signal_key_release(pEvent);
+}
 #endif
 
 virtual void grab_add() override
@@ -17551,6 +17562,11 @@ public:
 return signal_im_context_delete_surrounding(rRange);
 }
 
+#if !GTK_CHECK_VERSION(4, 0, 0)
+virtual bool do_signal_key_press(const GdkEventKey* pEvent) override;
+virtual bool do_signal_key_release(const GdkEventKey* pEvent) override;
+#endif
+
 virtual void queue_draw() override
 {
 gtk_widget_queue_draw(GTK_WIDGET(m_pDrawingArea));
@@ -17932,8 +17948,31 @@ public:
 pThis->updateIMSpotLocation();
 pThis->EndExtTextInput();
 }
+
+#if !GTK_CHECK_VERSION(4, 0, 0)
+bool im_context_filter_keypress(const GdkEventKey* pEvent)
+{
+return gtk_im_context_filter_keypress(m_pIMContext, 
const_cast(pEvent));
+}
+#endif
 };
 
+#if !GTK_CHECK_VERSION(4, 0, 0)
+bool GtkInstanceDrawingArea::do_signal_key_press(const GdkEventKey* pEvent)
+{
+if (m_xIMHandler && m_xIMHandler->im_context_filter_keypress(pEvent))
+return true;
+return GtkInstanceWidget::do_signal_key_press(pEvent);
+}
+
+bool GtkInstanceDrawingArea::do_signal_key_release(const GdkEventKey* pEvent)
+{
+if (m_xIMHandler && m_xIMHandler->im_context_filter_keypress(pEvent))
+return true;
+return GtkInstanceWidget::do_signal_key_release(pEvent);
+}
+#endif
+
 void GtkInstanceDrawingArea::set_input_context(const InputContext& 
rInputContext)
 {
 bool bUseIm(rInputContext.GetOptions() & InputContextFlags::Text);


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

2022-03-01 Thread Caolán McNamara (via logerrit)
 include/avmedia/mediawindow.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 684e0b742aa611e684cfdf1f7ddff711bf6ab513
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 15:47:19 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 21:57:32 2022 +0100

xPreferredPixelSizeListener is never null

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

diff --git a/include/avmedia/mediawindow.hxx b/include/avmedia/mediawindow.hxx
index 4954e04558bb..e81630002fd0 100644
--- a/include/avmedia/mediawindow.hxx
+++ b/include/avmedia/mediawindow.hxx
@@ -137,7 +137,7 @@ namespace avmedia
 static css::uno::Reference grabFrame(const 
css::uno::Reference& rPlayer);
 
 static css::uno::Reference< css::graphic::XGraphic > grabFrame(const 
OUString& rURL, const OUString& rReferer,
-const OUString& sMimeType, rtl::Reference 
xPreferredPixelSizeListener = nullptr);
+const OUString& sMimeType, rtl::Reference 
xPreferredPixelSizeListener);
 
 static void dispatchInsertAVMedia(const 
css::uno::Reference&,
   const css::awt::Size& rSize, const 
OUString& rURL, bool bLink);


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

2022-03-01 Thread Luboš Luňák (via logerrit)
 svtools/source/svrtf/parrtf.cxx |   38 ++
 1 file changed, 14 insertions(+), 24 deletions(-)

New commits:
commit 09558e2f45e27d572fd261562c884c2d2cc896a7
Author: Luboš Luňák 
AuthorDate: Tue Mar 1 13:57:26 2022 +0100
Commit: Luboš Luňák 
CommitDate: Tue Mar 1 21:32:34 2022 +0100

avoid a temporary buffer, append to the resulting one (tdf#145862)

It doesn't seem to make a visible performance difference though.

Change-Id: Iec56f4f484dbebcc216308d17422151424d0697c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130790
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 719401d342fe..c6dcef7a0b69 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -32,7 +32,6 @@
 #include 
 
 const int MAX_STRING_LEN = 1024;
-const int MAX_TOKEN_LEN = 128;
 
 #define RTF_ISDIGIT( c ) rtl::isAsciiDigit(c)
 #define RTF_ISALPHA( c ) rtl::isAsciiAlpha(c)
@@ -101,12 +100,10 @@ int SvRTFParser::GetNextToken_()
 {
 aToken = "\\";
 {
-OUStringBuffer aStrBuffer( MAX_TOKEN_LEN );
 do {
-aStrBuffer.appendUtf32(nNextCh);
+aToken.appendUtf32(nNextCh);
 nNextCh = GetNextChar();
 } while( RTF_ISALPHA( nNextCh ) );
-aToken.append( aStrBuffer );
 }
 
 // minus before numeric parameters
@@ -305,9 +302,9 @@ sal_Unicode SvRTFParser::GetHexValue()
 void SvRTFParser::ScanText()
 {
 const sal_Unicode cBreak = 0;
-OUStringBuffer aStrBuffer;
+const sal_uInt32 nStartLength = aToken.getLength();
 bool bContinue = true;
-while( bContinue && IsParserWorking() && aStrBuffer.getLength() < 
MAX_STRING_LEN)
+while( bContinue && IsParserWorking() && aToken.getLength() - nStartLength 
< MAX_STRING_LEN)
 {
 bool bNextCh = true;
 switch( nNextCh )
@@ -345,8 +342,8 @@ void SvRTFParser::ScanText()
 if (next>0xFF) // fix for #i43933# and #i35653#
 {
 if (!aByteString.isEmpty())
-aStrBuffer.append( 
OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()) );
-
aStrBuffer.append(static_cast(next));
+aToken.append( 
OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()) );
+
aToken.append(static_cast(next));
 
 continue;
 }
@@ -386,23 +383,23 @@ void SvRTFParser::ScanText()
 bNextCh = false;
 
 if (!aByteString.isEmpty())
-aStrBuffer.append( 
OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()) );
+aToken.append( 
OStringToOUString(aByteString.makeStringAndClear(), GetSrcEncoding()) );
 }
 break;
 case '\\':
 case '}':
 case '{':
 case '+':   // I found in a RTF file
-aStrBuffer.append(sal_Unicode(nNextCh));
+aToken.append(sal_Unicode(nNextCh));
 break;
 case '~':   // nonbreaking space
-aStrBuffer.append(u'\x00A0');
+aToken.append(u'\x00A0');
 break;
 case '-':   // optional hyphen
-aStrBuffer.append(u'\x00AD');
+aToken.append(u'\x00AD');
 break;
 case '_':   // nonbreaking hyphen
-aStrBuffer.append(u'\x2011');
+aToken.append(u'\x2011');
 break;
 
 case 'u':
@@ -420,7 +417,7 @@ void SvRTFParser::ScanText()
 int nToken = GetNextToken_();
 DBG_ASSERT( RTF_U == nToken, "still not a UNI-Code 
character" );
 // don't convert symbol chars
-aStrBuffer.append(static_cast< sal_Unicode 
>(nTokenValue));
+aToken.append(static_cast< sal_Unicode 
>(nTokenValue));
 
 // overread the next n "RTF" characters. This
 // can be also \{, \}, \'88
@@ -491,24 +488,20 @@ void SvRTFParser::ScanText()
 break;
 
 default:
-if( nNextCh == cBreak || aStrBuffer.getLength() >= MAX_STRING_LEN)
+if( nNextCh == cBreak || aToken.getLen

[Libreoffice-commits] core.git: editeng/source include/editeng include/o3tl include/svtools o3tl/qa svtools/source sw/source

2022-03-01 Thread Luboš Luňák (via logerrit)
 editeng/source/editeng/eehtml.cxx  |2 -
 editeng/source/rtf/svxrtf.cxx  |   15 +++--
 include/editeng/svxrtf.hxx |2 -
 include/o3tl/string_view.hxx   |6 +++
 include/svtools/htmltokn.h |7 ++--
 include/svtools/rtftoken.h |2 -
 include/svtools/svparser.hxx   |3 +
 o3tl/qa/test-string_view.cxx   |4 ++
 svtools/source/svhtml/htmlkywd.cxx |   13 
 svtools/source/svhtml/parhtml.cxx  |   57 ++---
 svtools/source/svrtf/parrtf.cxx|   10 +++---
 svtools/source/svrtf/rtfkeywd.cxx  |9 +++--
 svtools/source/svrtf/svparser.cxx  |2 -
 sw/source/filter/html/htmlbas.cxx  |4 +-
 sw/source/filter/html/htmlform.cxx |2 -
 sw/source/filter/html/swhtml.cxx   |   10 +++---
 16 files changed, 80 insertions(+), 68 deletions(-)

New commits:
commit b871d057c45fdd231aa5e1d2b94e7d0a039f4292
Author: Luboš Luňák 
AuthorDate: Tue Mar 1 12:07:47 2022 +0100
Commit: Luboš Luňák 
CommitDate: Tue Mar 1 21:32:11 2022 +0100

use OUStringBuffer for a string that's modified often (tdf#145862)

SvParser::aToken was OUString despite being a buffer where the parsed
result is collected.

Change-Id: Id24c842738ea0f6f1836f77d855069963ac5ae55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130763
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/editeng/source/editeng/eehtml.cxx 
b/editeng/source/editeng/eehtml.cxx
index a3de37005ffc..93740129e9df 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -179,7 +179,7 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken )
 if ( !bInPara )
 StartPara( false );
 
-OUString aText = aToken;
+OUString aText = aToken.toString();
 if ( aText.startsWith(" ") && ThrowAwayBlank() && !IsReadPRE() )
 aText = aText.copy( 1 );
 
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index f60c14cdbafa..cae8e4361ad0 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -166,7 +166,7 @@ void SvxRTFParser::NextToken( int nToken )
 case RTF_LDBLQUOTE: cCh = 0x201C;   goto INSINGLECHAR;
 case RTF_RDBLQUOTE: cCh = 0x201D;   goto INSINGLECHAR;
 INSINGLECHAR:
-aToken = OUString(cCh);
+aToken = OUStringChar(cCh);
 [[fallthrough]]; // aToken is set as Text
 case RTF_TEXTTOKEN:
 {
@@ -324,7 +324,8 @@ void SvxRTFParser::ReadStyleTable()
 case RTF_TEXTTOKEN:
 if (bHasStyleNo)
 {
-xStyle->sName = DelCharAtEnd( aToken, ';' );
+DelCharAtEnd( aToken, ';' );
+xStyle->sName = aToken.toString();
 
 if (!m_StyleTable.empty())
 {
@@ -581,15 +582,11 @@ void SvxRTFParser::ClearAttrStack()
 aAttrStack.clear();
 }
 
-OUString& SvxRTFParser::DelCharAtEnd( OUString& rStr, const sal_Unicode cDel )
+void SvxRTFParser::DelCharAtEnd( OUStringBuffer& rStr, const sal_Unicode cDel )
 {
-if( !rStr.isEmpty() && ' ' == rStr[ 0 ])
-rStr = comphelper::string::stripStart(rStr, ' ');
-if( !rStr.isEmpty() && ' ' == rStr[ rStr.getLength()-1 ])
-rStr = comphelper::string::stripEnd(rStr, ' ');
+rStr.strip(' ');
 if( !rStr.isEmpty() && cDel == rStr[ rStr.getLength()-1 ])
-rStr = rStr.copy( 0, rStr.getLength()-1 );
-return rStr;
+rStr.setLength( rStr.getLength()-1 );
 }
 
 
diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx
index ec42c5045d07..e5ed1949bbb4 100644
--- a/include/editeng/svxrtf.hxx
+++ b/include/editeng/svxrtf.hxx
@@ -148,7 +148,7 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser
 protected:
 virtual void InsertPara() = 0;
 
-static OUString& DelCharAtEnd( OUString& rStr, const sal_Unicode cDel );
+static void DelCharAtEnd( OUStringBuffer& rStr, const sal_Unicode cDel );
 
 // is called for each token that is recognized in CallParser
 virtual void NextToken( int nToken ) override;
diff --git a/include/o3tl/string_view.hxx b/include/o3tl/string_view.hxx
index 74f15bf33b54..848143f189ed 100644
--- a/include/o3tl/string_view.hxx
+++ b/include/o3tl/string_view.hxx
@@ -31,6 +31,12 @@ inline bool equalsIgnoreAsciiCase(std::u16string_view s1, 
std::u16string_view s2
== 0;
 };
 
+// Like OUString::compareToIgnoreAsciiCase, but for two std::u16string_view:
+inline int compareToIgnoreAsciiCase(std::u16string_view s1, 
std::u16string_view s2)
+{
+return rtl_ustr_compareIgnoreAsciiCase_WithLength(s1.data(), s1.size(), 
s2.data(), s2.size());
+};
+
 // Similar to OString::getToken, returning the first token of a 
std::string_view, starting at a
 // given position (and if needed, it can be turned into a template to also 
cover std::u16string_view
 // etc., or extended to return the n'th token instead of just the first, or 
support an init

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/ttcr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b228045cf3fb50128fd40a8f26376443ad22f874
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 09:35:34 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 21:25:41 2022 +0100

ofz: glyph data must be at least 10 bytes long to be useful

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

diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index d4ff5f413ede..86dc02206e92 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -1270,7 +1270,7 @@ static void ProcessTables(TrueTypeCreator *tt)
 
 /* printf("IDs: %d %d.\n", gd->glyphID, gd->newID); */
 
-if (gd->nbytes != 0) {
+if (gd->nbytes >= 10) {
 sal_Int16 z = GetInt16(gd->ptr, 2);
 if (z < xMin) xMin = z;
 


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

2022-03-01 Thread Mike Kaganski (via logerrit)
 sw/source/filter/ww8/WW8Sttbf.cxx |   13 +
 sw/source/filter/ww8/WW8Sttbf.hxx |2 +-
 2 files changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 2960d4128710afd3e0c090960d281e69b44e69eb
Author: Mike Kaganski 
AuthorDate: Tue Mar 1 12:58:08 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Mar 1 20:53:40 2022 +0100

Use known length to pre-initialize buffer

... and drop now-obsolete conditional include, which is included
unconditionally since commit 4c68c4b93c41c4e9c2d5faf6c02ece2d40e95eb4
  Author Stephan Bergmann 
  Date   Tue Mar 01 08:23:31 2022 +0100

misaligned-pointer-use

Change nCount argument to sal_Int32, since that's what is used for
string lengths. The call sites use sal_uInt16 and sal_uInt8 as the
argument value.

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

diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx 
b/sw/source/filter/ww8/WW8Sttbf.cxx
index 2739f208d902..3143faece7dd 100644
--- a/sw/source/filter/ww8/WW8Sttbf.cxx
+++ b/sw/source/filter/ww8/WW8Sttbf.cxx
@@ -24,15 +24,12 @@
 #include "WW8Sttbf.hxx"
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
-#ifdef OSL_BIGENDIAN
-#include 
-#endif
-
 namespace ww8
 {
 WW8Struct::WW8Struct(SvStream& rSt, sal_uInt32 nPos, sal_uInt32 nSize)
@@ -71,7 +68,7 @@ namespace ww8
 }
 
 OUString WW8Struct::getUString(sal_uInt32 nOffset,
-  sal_uInt32 nCount)
+  sal_Int32 nCount)
 {
 OUString aResult;
 
@@ -82,10 +79,10 @@ namespace ww8
 if (nStartOff >= mn_size)
 return aResult;
 sal_uInt32 nAvailable = (mn_size - nStartOff)/sizeof(sal_Unicode);
-if (nCount > nAvailable)
+if (o3tl::make_unsigned(nCount) > nAvailable)
 nCount = nAvailable;
-OUStringBuffer aBuf;
-for (sal_uInt32 i = 0; i < nCount; ++i)
+OUStringBuffer aBuf(nCount);
+for (sal_Int32 i = 0; i < nCount; ++i)
 aBuf.append(static_cast(getU16(nStartOff+i*2)));
 aResult = aBuf.makeStringAndClear();
 }
diff --git a/sw/source/filter/ww8/WW8Sttbf.hxx 
b/sw/source/filter/ww8/WW8Sttbf.hxx
index 89ec4113b308..3bc04e3d870b 100644
--- a/sw/source/filter/ww8/WW8Sttbf.hxx
+++ b/sw/source/filter/ww8/WW8Sttbf.hxx
@@ -47,7 +47,7 @@ namespace ww8
 sal_uInt16 getU16(sal_uInt32 nOffset)
 { return getU8(nOffset) + (getU8(nOffset + 1) << 8); }
 
-OUString getUString(sal_uInt32 nOffset, sal_uInt32 nCount);
+OUString getUString(sal_uInt32 nOffset, sal_Int32 nCount);
 };
 
 template 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - include/vcl vcl/inc vcl/jsdialog vcl/source

2022-03-01 Thread Szymon Kłos (via logerrit)
 include/vcl/toolkit/fixed.hxx|1 
 vcl/inc/jsdialog/jsdialogbuilder.hxx |8 ---
 vcl/jsdialog/enabled.cxx |4 ++-
 vcl/jsdialog/jsdialogbuilder.cxx |   39 +--
 vcl/source/control/fixed.cxx |7 ++
 5 files changed, 49 insertions(+), 10 deletions(-)

New commits:
commit c80a42e7103d5e282a9e7afd7a50f6996c12eaf1
Author: Szymon Kłos 
AuthorDate: Tue Mar 1 16:19:07 2022 +0100
Commit: Henry Castro 
CommitDate: Tue Mar 1 20:37:49 2022 +0100

jsdialog: enable Accessibility Check dialog

- fix crash due to wrong type for label
- deduplicate widgets with the same id in one dialog/builder
- refresh on box reordering

Change-Id: I6993552342a3f139de40c3f87243bdf4e0617fc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130797
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/include/vcl/toolkit/fixed.hxx b/include/vcl/toolkit/fixed.hxx
index 90d19afe43bc..57905797a45c 100644
--- a/include/vcl/toolkit/fixed.hxx
+++ b/include/vcl/toolkit/fixed.hxx
@@ -33,6 +33,7 @@ public:
 
 virtual voidLoseFocus() override;
 virtual voidApplySettings(vcl::RenderContext&) override;
+virtual voidDumpAsPropertyTree(tools::JsonWriter& rJsonWriter) 
override;
 };
 
 class VCL_DLLPUBLIC FixedLine final : public Control
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index ed655ede8435..968d5e97504d 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -223,7 +223,7 @@ class JSInstanceBuilder : public SalInstanceBuilder, public 
JSDialogSender
 
 static std::map& GetLOKWeldWidgetsMap();
 static void InsertWindowToMap(const std::string& nWindowId);
-void RememberWidget(const OString& id, weld::Widget* pWidget);
+void RememberWidget(OString id, weld::Widget* pWidget);
 static void RememberWidget(const std::string& nWindowId, const OString& id,
weld::Widget* pWidget);
 static weld::Widget* FindWeldWidgetsMap(const std::string& nWindowId, 
const OString& rWidget);
@@ -457,10 +457,10 @@ public:
 bool bTakeOwnership);
 };
 
-class JSLabel : public JSWidget
+class JSLabel : public JSWidget
 {
 public:
-JSLabel(JSDialogSender* pSender, FixedText* pLabel, SalInstanceBuilder* 
pBuilder,
+JSLabel(JSDialogSender* pSender, Control* pLabel, SalInstanceBuilder* 
pBuilder,
 bool bTakeOwnership);
 virtual void set_label(const OUString& rText) override;
 };
@@ -702,6 +702,8 @@ class JSBox : public JSWidget
 {
 public:
 JSBox(JSDialogSender* pSender, VclBox* pBox, SalInstanceBuilder* pBuilder, 
bool bTakeOwnership);
+
+void reorder_child(weld::Widget* pWidget, int nNewPosition) override;
 };
 
 class JSWidgetInstance : public JSWidget
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 8c02b074992e..6d456d469f21 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -55,7 +55,9 @@ bool isBuilderEnabled(const OUString& rUIFile, bool bMobile)
 || rUIFile == "modules/scalc/ui/textimportcsv.ui"
 || rUIFile == "xmlsec/ui/digitalsignaturesdialog.ui"
 || rUIFile == "xmlsec/ui/viewcertdialog.ui" || rUIFile == 
"xmlsec/ui/certgeneral.ui"
-|| rUIFile == "xmlsec/ui/viewcertdialog.ui" || rUIFile == 
"xmlsec/ui/certpage.ui")
+|| rUIFile == "xmlsec/ui/viewcertdialog.ui" || rUIFile == 
"xmlsec/ui/certpage.ui"
+|| rUIFile == "svx/ui/accessibilitycheckdialog.ui"
+|| rUIFile == "svx/ui/accessibilitycheckentry.ui")
 {
 return true;
 }
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index a5bdd87033f6..c449ad5b74ab 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -711,10 +711,31 @@ void JSInstanceBuilder::InsertWindowToMap(const 
std::string& nWindowId)
 GetLOKWeldWidgetsMap().insert(std::map::value_type(nWindowId, map));
 }
 
-void JSInstanceBuilder::RememberWidget(const OString& id, weld::Widget* 
pWidget)
+void JSInstanceBuilder::RememberWidget(OString sId, weld::Widget* pWidget)
 {
-RememberWidget(getMapIdFromWindowId(), id, pWidget);
-m_aRememberedWidgets.push_back(id.getStr());
+// do not use the same id for two widgets inside one builder
+// exception is sidebar where we base our full invalidation on that 
"Panel" id sharing
+if (m_sTypeOfJSON != "sidebar")
+{
+static std::atomic nNotRepeatIndex = 0;
+auto aWindowIt = GetLOKWeldWidgetsMap().find(getMapIdFromWindowId());
+if (aWindowIt != GetLOKWeldWidgetsMap().end())
+{
+auto aWidgetIt = aWindowIt->second.find(sId);
+if (aWidgetIt != aWindowIt->second.end())
+{
+unsigned long long int nIndex = nNotRepeatIndex++;
+// found duplicated it -> add some nu

[Libreoffice-commits] core.git: sw/inc sw/Library_sw.mk sw/qa sw/source

2022-03-01 Thread Miklos Vajna (via logerrit)
 sw/Library_sw.mk |1 
 sw/inc/unocoll.hxx   |1 
 sw/qa/core/unocore/unocore.cxx   |   32 
 sw/source/core/bastyp/init.cxx   |2 
 sw/source/core/inc/unolinebreak.hxx  |   91 +++
 sw/source/core/txtnode/attrlinebreak.cxx |1 
 sw/source/core/txtnode/thints.cxx|5 
 sw/source/core/unocore/unocoll.cxx   |7 
 sw/source/core/unocore/unolinebreak.cxx  |  236 +++
 9 files changed, 374 insertions(+), 2 deletions(-)

New commits:
commit 5028e5670da25ec1e862789b744c32e6108b
Author: Miklos Vajna 
AuthorDate: Tue Mar 1 16:44:03 2022 +0100
Commit: Miklos Vajna 
CommitDate: Tue Mar 1 19:52:31 2022 +0100

sw clearing breaks: add UNO API to insert this

This only allows the clear=all break type, the others are not yet
handled.

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

diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 401ac0d307fd..30c53b6131b1 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -489,6 +489,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
 sw/source/core/unocore/unoframe \
 sw/source/core/unocore/unoftn \
 sw/source/core/unocore/unoidx \
+sw/source/core/unocore/unolinebreak \
 sw/source/core/unocore/unomap \
 sw/source/core/unocore/unomap1 \
 sw/source/core/unocore/unoobj \
diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index ae16ab4ab7bc..821d50ab4a2c 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -176,6 +176,7 @@ enum class SwServiceType {
 VbaGlobals  = 113,
 StyleTable  = 114,
 StyleCell   = 115,
+LineBreak   = 116,
 
 Invalid = USHRT_MAX
 };
diff --git a/sw/qa/core/unocore/unocore.cxx b/sw/qa/core/unocore/unocore.cxx
index 55bfa1425528..b7d92d8485ac 100644
--- a/sw/qa/core/unocore/unocore.cxx
+++ b/sw/qa/core/unocore/unocore.cxx
@@ -22,6 +22,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -214,6 +216,36 @@ CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, 
testBrokenEmbeddedObject)
 
xEmbeddedObject->supportsService("com.sun.star.comp.embed.OCommonEmbeddedObject"));
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreUnocoreTest, testLineBreakInsert)
+{
+// Given an empty document:
+SwDoc* pDoc = createSwDoc();
+
+// When inserting a line-break with properties:
+uno::Reference xMSF(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xLineBreak(
+xMSF->createInstance("com.sun.star.text.LineBreak"), uno::UNO_QUERY);
+uno::Reference xText = xTextDocument->getText();
+uno::Reference xCursor = xText->createTextCursor();
+xText->insertTextContent(xCursor, xLineBreak, /*bAbsorb=*/false);
+
+// Then make sure that both the line break and its matching text attribute 
is inserted:
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+SwNodeOffset nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+SwTextNode* pTextNode = pDoc->GetNodes()[nIndex]->GetTextNode();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: "\n" (newline)
+// - Actual  : "" (empty string)
+// i.e. SwXLineBreak::attach() did not insert the newline + its text 
attribute.
+CPPUNIT_ASSERT_EQUAL(OUString("\n"), pTextNode->GetText());
+SwTextAttr* pAttr = pTextNode->GetTextAttrForCharAt(0, 
RES_TXTATR_LINEBREAK);
+CPPUNIT_ASSERT(pAttr);
+auto pTextLineBreak = static_cast(pAttr);
+auto& rFormatLineBreak = 
static_cast(pTextLineBreak->GetAttr());
+CPPUNIT_ASSERT_EQUAL(SwLineBreakClear::ALL, rFormatLineBreak.GetValue());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 9bbe888ba3b9..f7ad215602bf 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -320,7 +320,7 @@ SfxItemInfo aSlotTab[] =
 { 0, false },   // RES_TXTATR_FLYCNT
 { 0, false },   // RES_TXTATR_FTN
 { 0, false },   // RES_TXTATR_ANNOTATION
-{ 0, true },   // RES_TXTATR_LINEBREAK
+{ 0, false },   // RES_TXTATR_LINEBREAK
 { 0, true },   // RES_TXTATR_DUMMY1
 { 0, true },   // RES_TXTATR_DUMMY2
 
diff --git a/sw/source/core/inc/unolinebreak.hxx 
b/sw/source/core/inc/unolinebreak.hxx
new file mode 100644
index ..1eb939e24b68
--- /dev/null
+++ b/sw/source/core/inc/unolinebreak.hxx
@@ -0,0 +1,91 @@
+/*

[Libreoffice-commits] core.git: framework/source include/i18nutil oox/source sc/source sd/qa svx/source sw/qa

2022-03-01 Thread Andrea Gelmini (via logerrit)
 framework/source/services/autorecovery.cxx |2 +-
 include/i18nutil/calendar.hxx  |2 +-
 oox/source/drawingml/diagram/diagramhelper.cxx |2 +-
 oox/source/drawingml/shape.cxx |2 +-
 sc/source/ui/view/gridwin.cxx  |2 +-
 sd/qa/unit/export-tests-ooxml2.cxx |2 +-
 svx/source/dialog/srchdlg.cxx  |2 +-
 sw/qa/extras/odfimport/odfimport.cxx   |2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 2c5d4436f05ee99cf6937940f2010edf90e7f9e9
Author: Andrea Gelmini 
AuthorDate: Tue Mar 1 17:45:59 2022 +0100
Commit: Julien Nabet 
CommitDate: Tue Mar 1 19:22:40 2022 +0100

Fix typos

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

diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index e63c13073a90..bede4be05682 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -107,7 +107,7 @@ namespace {
 /** @short  hold all needed information for an asynchronous dispatch alive.
 
 @descr  Because some operations are forced to be executed asynchronously
-(e.g. requested by our CreashSave/Recovery dialog) ... we must 
make sure
+(e.g. requested by our CrashSave/Recovery dialog) ... we must make 
sure
 that this information won't be set as "normal" members of our 
AutoRecovery
 instance. Otherwise they can disturb our normal AutoSave-timer 
handling.
 e.g. it can be unclear then, which progress has to be used for 
storing documents...
diff --git a/include/i18nutil/calendar.hxx b/include/i18nutil/calendar.hxx
index 26c7d72d1822..86a5beacd96d 100644
--- a/include/i18nutil/calendar.hxx
+++ b/include/i18nutil/calendar.hxx
@@ -12,7 +12,7 @@
 namespace i18nutil
 {
 /** This number shows month days without Jan and Feb.
- *  According to the article, it is calcuated as (365-31-28)/10 = 30.6, but 
because
+ *  According to the article, it is calculated as (365-31-28)/10 = 30.6, but 
because
  *  of a floating point bug, it was used as 30.6001 as a workaround.
  *
  *  "30.6001, 25 year old hack?"
diff --git a/oox/source/drawingml/diagram/diagramhelper.cxx 
b/oox/source/drawingml/diagram/diagramhelper.cxx
index 268c7bb43f71..6e24a955767d 100644
--- a/oox/source/drawingml/diagram/diagramhelper.cxx
+++ b/oox/source/drawingml/diagram/diagramhelper.cxx
@@ -184,7 +184,7 @@ void AdvancedDiagramHelper::doAnchor(SdrObjGroup& rTarget)
 
 if(pParentShape)
 {
-// The oox::Shapes childs are not needed for holding the original data,
+// The oox::Shapes children are not needed for holding the original 
data,
 // free that memory
 pParentShape->getChildren().clear();
 }
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index bd69137003ec..243a172e6e75 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -254,7 +254,7 @@ void Shape::migrateDiagramHelperToNewShape(ShapePtr& 
pTarget)
 
 if(pTarget->mpDiagramHelper)
 {
-// this should no happen, bu if there is already a helper, clean it up
+// this should no happen, but if there is already a helper, clean it up
 delete pTarget->mpDiagramHelper;
 pTarget->mpDiagramHelper = nullptr;
 }
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d92d2109cdd1..467649c9f2cf 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3253,7 +3253,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
 if (aPos.Col() >= 0 && (aSpellCheckCell.meType == CELLTYPE_STRING 
|| aSpellCheckCell.meType == CELLTYPE_EDIT))
 nColSpellError = aPos.Col();
 
-// Is there a missspelled word somewhere in the cell?
+// Is there a misspelled word somewhere in the cell?
 // A "yes" does not mean that the word under the mouse pointer is 
wrong though.
 bSpellError = (mpSpellCheckCxt->isMisspelled(nColSpellError, 
nCellY));
 }
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index df29ef09c2d8..1cff1e9f4617 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -1498,7 +1498,7 @@ void SdOOXMLExportTest2::testSmartartRotation2()
 
 // clear SmartArt data to check how group shapes with double-rotated 
children are exported, not smartart
 // NOTE: Resetting the GrabBag data is a *very* indirect way to reset the 
SmartArt functionality.
-//   Since this worked before and there is not (yet?) a better way do 
do it using UNO API, I added
+//   Since this worked before and there is not (yet?) a better way to 
do it using 

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

2022-03-01 Thread Noel Grandin (via logerrit)
 sc/source/ui/app/inputhdl.cxx|9 +-
 sc/source/ui/app/scmod.cxx   |   99 +++
 sc/source/ui/dbgui/tpsort.cxx|   22 ++
 sc/source/ui/dbgui/tpsubt.cxx|   26 ++--
 sc/source/ui/dbgui/validate.cxx  |   60 --
 sc/source/ui/docshell/docfunc.cxx|7 --
 sc/source/ui/docshell/docsh.cxx  |   72 ++
 sc/source/ui/docshell/docsh4.cxx |   34 --
 sc/source/ui/docshell/docsh6.cxx |9 +-
 sc/source/ui/docshell/externalrefmgr.cxx |6 -
 sc/source/ui/docshell/tablink.cxx|6 -
 sc/source/ui/drawfunc/drawsh.cxx |   27 +++-
 sc/source/ui/drawfunc/drtxtob.cxx|8 --
 sc/source/ui/drawfunc/fuins1.cxx |   11 +--
 sc/source/ui/inc/scuitphfedit.hxx|4 -
 sc/source/ui/inc/tpsort.hxx  |5 -
 sc/source/ui/inc/tpsubt.hxx  |5 -
 sc/source/ui/optdlg/tpcompatibility.cxx  |4 -
 sc/source/ui/optdlg/tpdefaults.cxx   |5 -
 sc/source/ui/optdlg/tpformula.cxx|6 -
 sc/source/ui/optdlg/tpprint.cxx  |9 +-
 sc/source/ui/optdlg/tpview.cxx   |   68 ++---
 sc/source/ui/pagedlg/scuitphfedit.cxx|   14 +---
 sc/source/ui/vba/vbaapplication.cxx  |5 -
 24 files changed, 233 insertions(+), 288 deletions(-)

New commits:
commit e50f13c9947332639f455739c87213a954067299
Author: Noel Grandin 
AuthorDate: Tue Mar 1 11:08:05 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 19:17:09 2022 +0100

use SfxItemSet::GetItemIfSet in sc/source/ui/

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

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 9bcc6bbe71be..4d5d1a1d8ac2 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2472,11 +2472,10 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, 
bool bFromCommand, bool bIn
 {
 // Percent format?
 const SfxItemSet& rAttrSet = pPattern->GetItemSet();
-const SfxPoolItem* pItem;
 
-if ( SfxItemState::SET == rAttrSet.GetItemState( 
ATTR_VALUE_FORMAT, true, &pItem ) )
+if ( const SfxUInt32Item* pItem = rAttrSet.GetItemIfSet( 
ATTR_VALUE_FORMAT ) )
 {
-sal_uInt32 nFormat = static_cast(pItem)->GetValue();
+sal_uInt32 nFormat = pItem->GetValue();
 if (SvNumFormatType::PERCENT == 
rDoc.GetFormatTable()->GetType( nFormat ))
 nCellPercentFormatDecSep = 
rDoc.GetFormatTable()->GetFormatDecimalSep( nFormat).toChar();
 else
@@ -2486,8 +2485,8 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool 
bFromCommand, bool bIn
 nCellPercentFormatDecSep = 0; // Default: no percent
 
 // Validity specified?
-if ( SfxItemState::SET == rAttrSet.GetItemState( 
ATTR_VALIDDATA, true, &pItem ) )
-nValidation = static_cast(pItem)->GetValue();
+if ( const SfxUInt32Item* pItem = rAttrSet.GetItemIfSet( 
ATTR_VALIDDATA ) )
+nValidation = pItem->GetValue();
 else
 nValidation = 0;
 
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index b48f81192ac7..c4c0584eb6a9 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -336,7 +336,7 @@ void ScModule::Execute( SfxRequest& rReq )
 {
 bool bSet;
 const SfxPoolItem* pItem;
-if (pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem))
+if (pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( 
FN_PARAM_1, true, &pItem ))
 bSet = static_cast(pItem)->GetValue();
 else if ( pReqArgs && SfxItemState::SET == 
pReqArgs->GetItemState( nSlot, true, &pItem ) )
 bSet = static_cast(pItem)->GetValue();
@@ -934,7 +934,6 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
 ScTabViewShell* pViewSh = dynamic_cast( 
SfxViewShell::Current() );
 ScDocShell* pDocSh  = dynamic_cast( 
SfxObjectShell::Current() );
 ScDocument* pDoc= pDocSh ? &pDocSh->GetDocument() : 
nullptr;
-const SfxPoolItem*  pItem   = nullptr;
 bool bRepaint = false;
 bool bUpdateMarks = false;
 bool bUpdateRefDev = false;
@@ -948,28 +947,28 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
 ScAppOptions aAppOptions = m_pAppCfg->GetOptions();
 
 // No more linguistics
-if (rOptSet.HasItem(SID_ATTR_METRIC, &pItem))
+if (const SfxUInt16Item* pItem = rOptSet.GetItemIfSet(SID_ATTR_METRIC))
 {
 PutIte

[Libreoffice-commits] core.git: Branch 'feature/cib_contract57d' - sw/qa sw/source

2022-03-01 Thread Michael Stahl (via logerrit)
 sw/qa/extras/layout/data/tdf143239-1-min.odt |binary
 sw/qa/extras/layout/layout.cxx   |   66 +++
 sw/source/core/layout/layact.cxx |3 +
 3 files changed, 69 insertions(+)

New commits:
commit 913673a06043dba29d19b9c942cc46a439b53291
Author: Michael Stahl 
AuthorDate: Fri Feb 25 13:43:56 2022 +0100
Commit: Michael Stahl 
CommitDate: Tue Mar 1 19:10:14 2022 +0100

tdf#143239 sw: layout: invalidate fly position when moving off page

It's possible that flags on the fly are all valid when it is moved off page
when SwLayAction::FormatContent() returns and then it may not be positioned
again, keeping its (wrong) position on the old page and will appear to be
invisible unless you click on it.

(regression from commits c799de145f7e289f31e3669646e5bd12814e6c5e
 and eb85de8e6b61fb3fcb6c03ae0145f7fe5478bccf)

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130535
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit b14bb255199e7d6db6ec9155b5d9237cb35fdba7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130548
Reviewed-by: Xisco Fauli 
(cherry picked from commit 2bed04d49fda2e2005699b3ef884c5295e56d8ca)

Change-Id: If07d5af7b47eb288bef71d1b9e3459197b50fdc9

diff --git a/sw/qa/extras/layout/data/tdf143239-1-min.odt 
b/sw/qa/extras/layout/data/tdf143239-1-min.odt
new file mode 100644
index ..4271bfba775b
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf143239-1-min.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 8f6ca8a92580..d7b936aa89e8 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -1197,6 +1197,72 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf138039)
 assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored", 0);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239)
+{
+SwDoc* pDoc = createDoc("tdf143239-1-min.odt");
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+{
+xmlDocPtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1);
+assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
+"18540");
+#ifndef MACOSX
+assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
+"3559");
+#endif
+assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1);
+assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top",
+"23894");
+#ifndef MACOSX
+assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left",
+"1964");
+#endif
+assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1);
+assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
+"35662");
+#ifndef MACOSX
+assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
+"3129");
+#endif
+assertXPath(pXmlDoc, "/root/page", 3);
+discardDumpedLayout();
+}
+
+pWrtShell->SelAll();
+pWrtShell->Delete();
+pWrtShell->Undo();
+Scheduler::ProcessEventsToIdle();
+
+{
+xmlDocPtr pXmlDoc = parseLayoutDump();
+// now the 1st fly was on page 1, and the fly on page 2 was the 2nd one
+assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1);
+assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
+"18540");
+#ifndef MACOSX
+assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
+"3559");
+#endif
+assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1);
+assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top",
+"23894");
+#ifndef MACOSX
+assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left",
+"1964");
+#endif
+assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1);
+assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
+"35662");
+#ifndef MACOSX
+assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
+"3129");
+#endif
+assertXPath(pXmlDoc, "/root/page", 3);
+discardDumpedLayout();
+}
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTableOverlapFooterFly)
 {
 // Load a document that has a fly anchored in the footer.
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index d5efa7680fd6..6a2fd2046ffb 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - hwpfilter/qa hwpfilter/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 hwpfilter/qa/cppunit/data/pass/ofz44997-1.hwp |1 +
 hwpfilter/source/hinfo.cxx|   12 
 hwpfilter/source/hinfo.h  |2 ++
 hwpfilter/source/hpara.cxx|2 --
 hwpfilter/source/hstyle.cxx   |2 +-
 5 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit ccd6b0e444866d6e6956dbf068631cfd1e04b6fd
Author: Caolán McNamara 
AuthorDate: Thu Feb 24 10:16:00 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:42:34 2022 +0100

ofz#44997 Use-of-uninitialized-value

Change-Id: I3803232ddc7346967e22770ae2bdbc3378779f8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130488
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130523
Reviewed-by: Michael Stahl 

diff --git a/hwpfilter/qa/cppunit/data/pass/ofz44997-1.hwp 
b/hwpfilter/qa/cppunit/data/pass/ofz44997-1.hwp
new file mode 100644
index ..76a8e05ee452
--- /dev/null
+++ b/hwpfilter/qa/cppunit/data/pass/ofz44997-1.hwp
@@ -0,0 +1 @@
+HWP Document File V3.00  
    �� 
���   �   ����  

   ���  ��  
 �� � � 
�  
�   
   
�   
  ���   
   ��   �� � �  
 
 �  

  bf```082�� �
\ No newline at end of file
diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx
index bc1d61021d99..f842f0d683ff 100644
--- a/hwpfilter/source/hinfo.cxx
+++ b/hwpfilter/source/hinfo.cxx
@@ -258,6 +258,18 @@ void ParaShape::Read(HWPFile & hwpf)
 hwpf.ReadBlock(reserved, 2);
 }
 
+CharShape::CharShape()
+: index(0)
+, size(0)
+, font{0}
+, ratio{0}
+, space{0}
+, color{0}
+, shade(0)
+, attr(0)
+, reserved{0}
+{
+}
 
 void CharShape::Read(HWPFile & hwpf)
 {
diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h
index c415783e26a2..c0381787f7d9 100644
--- a/hwpfilter/source/hinfo.h
+++ b/hwpfilter/source/hinfo.h
@@ -228,6 +228,8 @@ struct CharShape
 unsigned char reserved[4];
 
 void Read(HWPFile &);
+
+CharShape();
 };
 
 /* ?? ??  ?? */
diff --git a/hwpfilter/source/hpara.cxx b/hwpfilter/source/hpara.cxx
index 736188f1ad9e..9ac169ab4382 100644
--- a/hwpfilter/source/hpara.cxx
+++ b/hwpfilter/source/hpara.cxx
@@ -78,7 +78,6 @@ HWPPara::HWPPara()
 , cshape(std::make_shared())
 , pshape(std::make_shared())
 {
-memset(cshape.get(), 0, sizeof(CharShape));
 }
 
 HWPPara::~HWPPara()
@@ -145,7 +144,6 @@ bool HWPPara::Read(HWPFile & hwpf, unsigned char flag)
 for (ii = 0; ii < nch; ii++)
 {
 cshapep[ii] = std::make_shared();
-memset(cshapep[ii].get(), 0, sizeof(CharShape));
 
 unsigned char same_cshape(0);
 hwpf.Read1b(same_cshape);
diff --git a/hwpfilter/source/hstyle.cxx b/hwpfilter/source/hstyle.cxx
index fbbe30025d0a..186da27199d3 100644
--- a/hwpfilter/source/hstyle.cxx
+++ b/hwpfilter/source/hstyle.cxx
@@ -99,7 +99,7 @@ void HWPStyle::SetCharShape(int n, CharShape const* cshapep)
 if (cshapep)
 DATA[n].cshape = *cshapep;
 else
-memset(&DATA[n].cshape, 0, sizeof(CharShape));
+DATA[n].cshape = CharShape();
 }
 }
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - vcl/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/sft.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 50600039f858f86a821bb59b4270d96010b4f779
Author: Caolán McNamara 
AuthorDate: Fri Feb 25 12:33:13 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:40:34 2022 +0100

lastPoint might be 0x

LIBREOFFICE-KYYAZMB9

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

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index bdc7e8208793..de691ad715c1 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -379,7 +379,7 @@ static int GetSimpleTTOutline(AbstractTrueTypeFont const 
*ttf, sal_uInt32 glyphI
 const sal_uInt8* p = ptr + nOffset;
 
 const sal_uInt32 nBytesRemaining = nTableSize - nOffset;
-const sal_uInt16 palen = lastPoint+1;
+const sal_uInt32 palen = lastPoint+1;
 
 //at a minimum its one byte per entry
 if (palen > nBytesRemaining || lastPoint > nBytesRemaining-1)


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - hwpfilter/qa hwpfilter/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 hwpfilter/qa/cppunit/data/pass/ofz44997-1.hwp |1 +
 hwpfilter/source/hinfo.cxx|   12 
 hwpfilter/source/hinfo.h  |2 ++
 hwpfilter/source/hpara.cxx|2 --
 hwpfilter/source/hstyle.cxx   |2 +-
 5 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit f242f7249ee689ab61f00498dc17d13c9849ee5a
Author: Caolán McNamara 
AuthorDate: Thu Feb 24 10:16:00 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:39:58 2022 +0100

ofz#44997 Use-of-uninitialized-value

Change-Id: I3803232ddc7346967e22770ae2bdbc3378779f8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130488
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130458
Reviewed-by: Michael Stahl 

diff --git a/hwpfilter/qa/cppunit/data/pass/ofz44997-1.hwp 
b/hwpfilter/qa/cppunit/data/pass/ofz44997-1.hwp
new file mode 100644
index ..76a8e05ee452
--- /dev/null
+++ b/hwpfilter/qa/cppunit/data/pass/ofz44997-1.hwp
@@ -0,0 +1 @@
+HWP Document File V3.00  
    �� 
���   �   ����  

   ���  ��  
 �� � � 
�  
�   
   
�   
  ���   
   ��   �� � �  
 
 �  

  bf```082�� �
\ No newline at end of file
diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx
index bc1d61021d99..f842f0d683ff 100644
--- a/hwpfilter/source/hinfo.cxx
+++ b/hwpfilter/source/hinfo.cxx
@@ -258,6 +258,18 @@ void ParaShape::Read(HWPFile & hwpf)
 hwpf.ReadBlock(reserved, 2);
 }
 
+CharShape::CharShape()
+: index(0)
+, size(0)
+, font{0}
+, ratio{0}
+, space{0}
+, color{0}
+, shade(0)
+, attr(0)
+, reserved{0}
+{
+}
 
 void CharShape::Read(HWPFile & hwpf)
 {
diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h
index c415783e26a2..c0381787f7d9 100644
--- a/hwpfilter/source/hinfo.h
+++ b/hwpfilter/source/hinfo.h
@@ -228,6 +228,8 @@ struct CharShape
 unsigned char reserved[4];
 
 void Read(HWPFile &);
+
+CharShape();
 };
 
 /* ?? ??  ?? */
diff --git a/hwpfilter/source/hpara.cxx b/hwpfilter/source/hpara.cxx
index 415c8e984eb3..510a1676ebc3 100644
--- a/hwpfilter/source/hpara.cxx
+++ b/hwpfilter/source/hpara.cxx
@@ -78,7 +78,6 @@ HWPPara::HWPPara()
 , cshape(std::make_shared())
 , pshape(std::make_shared())
 {
-memset(cshape.get(), 0, sizeof(CharShape));
 }
 
 HWPPara::~HWPPara()
@@ -145,7 +144,6 @@ bool HWPPara::Read(HWPFile & hwpf, unsigned char flag)
 for (ii = 0; ii < nch; ii++)
 {
 cshapep[ii] = std::make_shared();
-memset(cshapep[ii].get(), 0, sizeof(CharShape));
 
 unsigned char same_cshape(0);
 hwpf.Read1b(same_cshape);
diff --git a/hwpfilter/source/hstyle.cxx b/hwpfilter/source/hstyle.cxx
index 33f143440c32..c3fb787ecd38 100644
--- a/hwpfilter/source/hstyle.cxx
+++ b/hwpfilter/source/hstyle.cxx
@@ -99,7 +99,7 @@ void HWPStyle::SetCharShape(int n, CharShape const* cshapep)
 if (cshapep)
 DATA[n].cshape = *cshapep;
 else
-memset(&DATA[n].cshape, 0, sizeof(CharShape));
+DATA[n].cshape = CharShape();
 }
 }
 


[Libreoffice-commits] core.git: avmedia/source include/avmedia sc/source sd/source sfx2/sdi svx/source sw/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 avmedia/source/gtk/gtkplayer.cxx  |  130 --
 avmedia/source/gtk/gtkplayer.hxx  |   20 -
 avmedia/source/viewer/mediawindow.cxx |  127 +
 include/avmedia/mediawindow.hxx   |   47 ++--
 sc/source/ui/drawfunc/fuins1.cxx  |   57 ++
 sd/source/ui/func/fuinsert.cxx|   99 +
 sd/source/ui/inc/View.hxx |3 
 sd/source/ui/inc/fuinsert.hxx |5 +
 sd/source/ui/view/sdview.cxx  |7 +
 sd/source/ui/view/sdview4.cxx |   57 +-
 sfx2/sdi/sfx.sdi  |6 +
 svx/source/svdraw/svdomedia.cxx   |   15 +++
 sw/source/uibase/shells/grfshex.cxx   |  118 ++
 13 files changed, 512 insertions(+), 179 deletions(-)

New commits:
commit 05db887bc226b85befe2c2b9e84b796020a6ca05
Author: Caolán McNamara 
AuthorDate: Mon Feb 21 10:01:42 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 18:38:27 2022 +0100

gtk4: media dimensions are only reliably available async

this is also the case for the direct gstreamer use in gtk3 but
more egregious when abstracted away from it in gtk4

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

diff --git a/avmedia/source/gtk/gtkplayer.cxx b/avmedia/source/gtk/gtkplayer.cxx
index 7ce488f231ec..b988e7f19684 100644
--- a/avmedia/source/gtk/gtkplayer.cxx
+++ b/avmedia/source/gtk/gtkplayer.cxx
@@ -37,8 +37,12 @@ namespace avmedia::gtk
 {
 GtkPlayer::GtkPlayer()
 : GtkPlayer_BASE(m_aMutex)
+, m_lListener(m_aMutex)
 , m_pStream(nullptr)
 , m_pVideo(nullptr)
+, m_nNotifySignalId(0)
+, m_nInvalidateSizeSignalId(0)
+, m_nTimeoutId(0)
 , m_nUnmutedVolume(0)
 {
 }
@@ -61,6 +65,8 @@ void GtkPlayer::cleanup()
 
 if (m_pStream)
 {
+uninstallNotify();
+
 // shouldn't have to attempt this unref on idle, but with gtk4-4.4.1 I 
get
 // intermittent "instance of invalid non-instantiatable type '(null)'"
 // on some mysterious gst dbus callback
@@ -81,6 +87,51 @@ void SAL_CALL GtkPlayer::disposing()
 cleanup();
 }
 
+static void do_notify(GtkPlayer* pThis)
+{
+rtl::Reference xThis(pThis);
+xThis->notifyListeners();
+xThis->uninstallNotify();
+}
+
+static void invalidate_size_cb(GdkPaintable* /*pPaintable*/, GtkPlayer* pThis) 
{ do_notify(pThis); }
+
+static void notify_cb(GtkMediaStream* /*pStream*/, GParamSpec* pspec, 
GtkPlayer* pThis)
+{
+if (g_str_equal(pspec->name, "prepared") || g_str_equal(pspec->name, 
"error"))
+do_notify(pThis);
+}
+
+static bool timeout_cb(GtkPlayer* pThis)
+{
+do_notify(pThis);
+return false;
+}
+
+void GtkPlayer::installNotify()
+{
+if (m_nNotifySignalId)
+return;
+m_nNotifySignalId = g_signal_connect(m_pStream, "notify", 
G_CALLBACK(notify_cb), this);
+// notify should be enough, but there is an upstream bug so also try 
"invalidate-size" and add a timeout for
+// audio-only case where that won't happen, see: 
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4513
+m_nInvalidateSizeSignalId
+= g_signal_connect(m_pStream, "invalidate-size", 
G_CALLBACK(invalidate_size_cb), this);
+m_nTimeoutId = g_timeout_add_seconds(10, G_SOURCE_FUNC(timeout_cb), this);
+}
+
+void GtkPlayer::uninstallNotify()
+{
+if (!m_nNotifySignalId)
+return;
+g_signal_handler_disconnect(m_pStream, m_nNotifySignalId);
+m_nNotifySignalId = 0;
+g_signal_handler_disconnect(m_pStream, m_nInvalidateSizeSignalId);
+m_nInvalidateSizeSignalId = 0;
+g_source_remove(m_nTimeoutId);
+m_nTimeoutId = 0;
+}
+
 bool GtkPlayer::create(const OUString& rURL)
 {
 bool bRet = false;
@@ -104,6 +155,25 @@ bool GtkPlayer::create(const OUString& rURL)
 return bRet;
 }
 
+void GtkPlayer::notifyListeners()
+{
+comphelper::OInterfaceContainerHelper2* pContainer
+= 
m_lListener.getContainer(cppu::UnoType::get());
+if (!pContainer)
+return;
+
+css::lang::EventObject aEvent;
+aEvent.Source = static_cast(this);
+
+comphelper::OInterfaceIteratorHelper2 pIterator(*pContainer);
+while (pIterator.hasMoreElements())
+{
+css::uno::Reference xListener(
+static_cast(pIterator.next()));
+xListener->preferredPlayerWindowSizeAvailable(aEvent);
+}
+}
+
 void SAL_CALL GtkPlayer::start()
 {
 osl::MutexGuard aGuard(m_aMutex);
@@ -231,41 +301,6 @@ sal_Int16 SAL_CALL GtkPlayer::getVolumeDB()
 return m_nUnmutedVolume;
 }
 
-namespace
-{
-void invalidate_size(GdkPaintable* /*paintable*/, Timer* pTimer) { 
pTimer->Stop(); }
-
-Size GetPreferredPlayerWindowSize(GdkPaintable* pStream)
-{
-Size aSize(gdk_paintable_get_intrinsic_width(pStream),
-   gdk_paintable_get_intrinsic_height(pStream))

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

2022-03-01 Thread Caolán McNamara (via logerrit)
 offapi/UnoApi_offapi.mk   |2 +
 offapi/com/sun/star/media/XPlayerListener.idl |   38 +
 offapi/com/sun/star/media/XPlayerNotifier.idl |   46 ++
 3 files changed, 86 insertions(+)

New commits:
commit ae071f7d680545e284e5947d26cbea30e59bdfb5
Author: Caolán McNamara 
AuthorDate: Mon Feb 21 15:05:14 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 18:37:58 2022 +0100

add a way to get informed when the XPlayer can return useful information

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

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 28b3a41f280b..cdf62376c30f 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -2913,6 +2913,8 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/media,\
XFrameGrabber \
XManager \
XPlayer \
+   XPlayerListener \
+   XPlayerNotifier \
XPlayerWindow \
ZoomLevel \
 ))
diff --git a/offapi/com/sun/star/media/XPlayerListener.idl 
b/offapi/com/sun/star/media/XPlayerListener.idl
new file mode 100644
index ..62e6a9633278
--- /dev/null
+++ b/offapi/com/sun/star/media/XPlayerListener.idl
@@ -0,0 +1,38 @@
+/* -*- 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 __com_sun_star_ui_dialogs_XPlayerListener_idl__
+#define __com_sun_star_ui_dialogs_XPlayerListener_idl__
+
+#include 
+
+module com { module sun { module star { module media {
+
+/** Interface to be implemented by a FilePicker listener.
+
+ The XPlayerListener interface must be implemented by
+the clients of the FilePicker service which need to be informed about
+events while the FilePicker service is displayed.
+
+@since LibreOffice 7.4
+*/
+
+interface XPlayerListener : com::sun::star::lang::XEventListener
+{
+/** A client receives this event when the preferred player size of an 
XPlayer
+is available to be queried.
+*/
+void preferredPlayerWindowSizeAvailable([in] 
com::sun::star::lang::EventObject e);
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/offapi/com/sun/star/media/XPlayerNotifier.idl 
b/offapi/com/sun/star/media/XPlayerNotifier.idl
new file mode 100644
index ..b34f64f64823
--- /dev/null
+++ b/offapi/com/sun/star/media/XPlayerNotifier.idl
@@ -0,0 +1,46 @@
+/* -*- 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 __com_sun_star_ui_dialogs_XPlayerNotifier_idl__
+#define __com_sun_star_ui_dialogs_XPlayerNotifier_idl__
+
+#include 
+#include 
+
+module com {  module sun {  module star {  module media {
+
+/** Interface to be implemented in order to support listener management.
+@since LibreOffice 7.4
+*/
+interface XPlayerNotifier : com::sun::star::uno::XInterface
+{
+/** Interface for clients to register as XPlayerListener
+
+@param xListener
+The XPlayerListener interface of the listener that
+wants to receive events.
+Invalid interfaces or NULL values will be ignored.
+*/
+void addPlayerListener( [in] XPlayerListener xListener );
+
+/** Interface for clients to unregister as XPlayerListener.
+
+@param xListener
+The XPlayerListener interface of the listener that
+wants to receive events.
+Invalid interfaces or NULL values will be ignored.
+*/
+void removePlayerListener( [in] XPlayerListener xListener );
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - hwpfilter/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 hwpfilter/source/hwpreader.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 69ac100f537c33de80ed451288120028b0914e94
Author: Caolán McNamara 
AuthorDate: Mon Feb 28 11:35:50 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:37:41 2022 +0100

cid#1501377 Dereference after null check

Change-Id: I9dceb5c33f62df16b43429ba502b0d12180fa403
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130694
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit f5f3eaa63f24093453af08ad01967ae17f108af2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130674
Reviewed-by: Michael Stahl 

diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index b27307b6ca18..88c9ada95e2c 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -2628,7 +2628,7 @@ void HwpReader::makeFStyle(FBoxStyle * fstyle)
 padd( "style:border-line-width-bottom", sXML_CDATA, "0.02mm 0.35mm 
0.02mm");
 padd("fo:border-bottom", sXML_CDATA,"0.039cm double #808080");
 }
-else if( fstyle->boxtype == 'G' )
+else if( fstyle->boxtype == 'G' && fstyle->cell )
 {
 if( fstyle->margin[1][0] || fstyle->margin[1][1] || 
fstyle->margin[1][2] || fstyle->margin[1][3] ){
  OUString clip = "rect(" +


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - hwpfilter/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 hwpfilter/source/hwpreader.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a728f0e8dc19a090f19af7b9e1d416f065ae6095
Author: Caolán McNamara 
AuthorDate: Mon Feb 28 11:35:50 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:37:53 2022 +0100

cid#1501377 Dereference after null check

Change-Id: I9dceb5c33f62df16b43429ba502b0d12180fa403
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130694
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit f5f3eaa63f24093453af08ad01967ae17f108af2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130673
Reviewed-by: Michael Stahl 

diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 83b764d102bd..1bd12242b436 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -2627,7 +2627,7 @@ void HwpReader::makeFStyle(FBoxStyle * fstyle)
 padd( "style:border-line-width-bottom", sXML_CDATA, "0.02mm 0.35mm 
0.02mm");
 padd("fo:border-bottom", sXML_CDATA,"0.039cm double #808080");
 }
-else if( fstyle->boxtype == 'G' )
+else if( fstyle->boxtype == 'G' && fstyle->cell )
 {
 if( fstyle->margin[1][0] || fstyle->margin[1][1] || 
fstyle->margin[1][2] || fstyle->margin[1][3] ){
  OUString clip = "rect(" +


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/sft.cxx |   17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 42e50d6691f72cbe0d5c52cc5222b7f9da4d83c2
Author: Caolán McNamara 
AuthorDate: Mon Feb 28 20:49:20 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:35:25 2022 +0100

ofz: verify table offsets

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

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index baa54d3378b7..867e00b47e0b 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1654,11 +1654,20 @@ SFErrCodes CreateTTFromTTGlyphs(AbstractTrueTypeFont  
*ttf,
 
 /**   post  **/
 if ((p = ttf->table(O_post, nTableSize)) != nullptr)
+{
+sal_Int32 nItalic = (POST_italicAngle_offset + 4 < nTableSize) ?
+GetInt32(p, POST_italicAngle_offset) : 0;
+sal_Int16 nPosition = (POST_underlinePosition_offset + 2 < nTableSize) 
?
+GetInt16(p, POST_underlinePosition_offset) : 0;
+sal_Int16 nThickness = (POST_underlineThickness_offset + 2 < 
nTableSize) ?
+GetInt16(p, POST_underlineThickness_offset) : 0;
+sal_uInt32 nFixedPitch = (POST_isFixedPitch_offset + 4 < nTableSize) ?
+GetUInt32(p, POST_isFixedPitch_offset) : 0;
+
 post = TrueTypeTableNew_post(0x0003,
- GetInt32(p, POST_italicAngle_offset),
- GetInt16(p, 
POST_underlinePosition_offset),
- GetInt16(p, 
POST_underlineThickness_offset),
- GetUInt32(p, POST_isFixedPitch_offset));
+ nItalic, nPosition,
+ nThickness, nFixedPitch);
+}
 else
 post = TrueTypeTableNew_post(0x0003, 0, 0, 0, 0);
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - vcl/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/sft.cxx |   17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 9b5a94d2270ec8edff0b0a15fdf3cfe01b55ef24
Author: Caolán McNamara 
AuthorDate: Mon Feb 28 20:49:20 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:35:13 2022 +0100

ofz: verify table offsets

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

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 4d2eba36c7f3..bdc7e8208793 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1647,11 +1647,20 @@ SFErrCodes CreateTTFromTTGlyphs(AbstractTrueTypeFont  
*ttf,
 
 /**   post  **/
 if ((p = ttf->table(O_post, nTableSize)) != nullptr)
+{
+sal_Int32 nItalic = (POST_italicAngle_offset + 4 < nTableSize) ?
+GetInt32(p, POST_italicAngle_offset) : 0;
+sal_Int16 nPosition = (POST_underlinePosition_offset + 2 < nTableSize) 
?
+GetInt16(p, POST_underlinePosition_offset) : 0;
+sal_Int16 nThickness = (POST_underlineThickness_offset + 2 < 
nTableSize) ?
+GetInt16(p, POST_underlineThickness_offset) : 0;
+sal_uInt32 nFixedPitch = (POST_isFixedPitch_offset + 4 < nTableSize) ?
+GetUInt32(p, POST_isFixedPitch_offset) : 0;
+
 post = TrueTypeTableNew_post(0x0003,
- GetInt32(p, POST_italicAngle_offset),
- GetInt16(p, 
POST_underlinePosition_offset),
- GetInt16(p, 
POST_underlineThickness_offset),
- GetUInt32(p, POST_isFixedPitch_offset));
+ nItalic, nPosition,
+ nThickness, nFixedPitch);
+}
 else
 post = TrueTypeTableNew_post(0x0003, 0, 0, 0, 0);
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - vcl/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/ttcr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e2969df08f165fd39654a2f0fb3dcee9885703a3
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 09:35:34 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:29:25 2022 +0100

ofz: glyph data must be at least 10 bytes long to be useful

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

diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index d4ff5f413ede..86dc02206e92 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -1270,7 +1270,7 @@ static void ProcessTables(TrueTypeCreator *tt)
 
 /* printf("IDs: %d %d.\n", gd->glyphID, gd->newID); */
 
-if (gd->nbytes != 0) {
+if (gd->nbytes >= 10) {
 sal_Int16 z = GetInt16(gd->ptr, 2);
 if (z < xMin) xMin = z;
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - writerfilter/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 02837024ea8d3d52c92420858327b309f2e96487
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 10:39:34 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:25:14 2022 +0100

fail more gracefully if m_aTmpPosition is empty

LIBREOFFICE-N4LA0OHZ

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

diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 6689a36091ad..583d668abad3 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -555,6 +555,8 @@ void DomainMapperTableManager::endOfRowAction()
 // Compare the table position and style with the previous ones. We may 
need to split
 // into two tables if those are different. We surely don't want to do 
anything
 // if we don't have any row yet.
+if (m_aTmpPosition.empty())
+throw std::out_of_range("row without a position");
 TablePositionHandlerPtr pTmpPosition = m_aTmpPosition.back();
 TablePropertyMapPtr pTablePropMap = m_aTmpTableProperties.back( );
 TablePositionHandlerPtr pCurrentPosition = m_aTablePositions.back();


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - writerfilter/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit dd5778d1d88e72cab330d17321bdfbc2c720ad86
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 10:39:34 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:25:00 2022 +0100

fail more gracefully if m_aTmpPosition is empty

LIBREOFFICE-N4LA0OHZ

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

diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index f0b692783a44..3b927642348d 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -551,6 +551,8 @@ void DomainMapperTableManager::endOfRowAction()
 // Compare the table position and style with the previous ones. We may 
need to split
 // into two tables if those are different. We surely don't want to do 
anything
 // if we don't have any row yet.
+if (m_aTmpPosition.empty())
+throw std::out_of_range("row without a position");
 TablePositionHandlerPtr pTmpPosition = m_aTmpPosition.back();
 TablePropertyMapPtr pTablePropMap = m_aTmpTableProperties.back( );
 TablePositionHandlerPtr pCurrentPosition = m_aTablePositions.back();


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/sft.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 26abdb564dad2011a298fc1253279232cb8b59cf
Author: Caolán McNamara 
AuthorDate: Mon Feb 28 21:12:07 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 18:23:32 2022 +0100

ofz: measure maximum possible contours

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

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 995c6b36373a..baa54d3378b7 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -347,7 +347,13 @@ static int GetSimpleTTOutline(AbstractTrueTypeFont const 
*ttf, sal_uInt32 glyphI
 if (glyphID >= ttf->glyphCount())
 return 0;
 
-const sal_uInt8* ptr = table + ttf->glyphOffset(glyphID);
+sal_uInt32 nGlyphOffset = ttf->glyphOffset(glyphID);
+if (nGlyphOffset > nTableSize)
+return 0;
+
+const sal_uInt8* ptr = table + nGlyphOffset;
+const sal_uInt32 nMaxGlyphSize = nTableSize - nGlyphOffset;
+
 const sal_Int16 numberOfContours = GetInt16(ptr, 
GLYF_numberOfContours_offset);
 if( numberOfContours <= 0 ) /*- glyph is not simple */
 return 0;
@@ -362,7 +368,7 @@ static int GetSimpleTTOutline(AbstractTrueTypeFont const 
*ttf, sal_uInt32 glyphI
 
 /* determine the last point and be extra safe about it. But probably this 
code is not needed */
 sal_uInt16 lastPoint=0;
-const sal_Int32 nMaxContours = (nTableSize - 10)/2;
+const sal_Int32 nMaxContours = (nMaxGlyphSize - 10)/2;
 if (numberOfContours > nMaxContours)
 return 0;
 for (i=0; i

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - hwpfilter/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 hwpfilter/source/hwpread.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 8ac1dd33493c4093663af5c477b245fd0f89aa15
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 10:18:51 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:15:57 2022 +0100

ofz: don't register style if hbox load failed

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

diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index d0df1cf97ba2..e04e4aa72f6c 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -237,7 +237,6 @@ bool TxtBox::Read(HWPFile & hwpf)
 hwpf.Read2b(&option, 1);
 hwpf.Read2b(&ctrl_ch, 1);
 hwpf.Read2b(style.margin, 12);
-hwpf.AddFBoxStyle(&style);
 hwpf.Read2b(&box_xs, 1);
 hwpf.Read2b(&box_ys, 1);
 hwpf.Read2b(&cap_xs, 1);
@@ -366,7 +365,10 @@ bool TxtBox::Read(HWPFile & hwpf)
 else
 m_pTable = nullptr;
 
-return !hwpf.State();
+bSuccess = !hwpf.State();
+if (bSuccess)
+hwpf.AddFBoxStyle(&style);
+return bSuccess;
 }
 
 namespace
@@ -511,12 +513,14 @@ bool Picture::Read(HWPFile & hwpf)
 style.boxtype = 'G';
 else
 style.boxtype = 'D';
-hwpf.AddFBoxStyle(&style);
 
 // caption
 hwpf.ReadParaList(caption);
 
-return !hwpf.State();
+bool bSuccess = !hwpf.State();
+if (bSuccess)
+hwpf.AddFBoxStyle(&style);
+return bSuccess;
 }
 
 // line(15)
@@ -554,7 +558,6 @@ bool Line::Read(HWPFile & hwpf)
 hwpf.Read2b(&option, 1);
 hwpf.Read2b(&ctrl_ch, 1);
 hwpf.Read2b(style.margin, 12);
-hwpf.AddFBoxStyle(&style);
 hwpf.Read2b(&box_xs, 1);
 hwpf.Read2b(&box_ys, 1);
 hwpf.Read2b(&cap_xs, 1);
@@ -583,7 +586,10 @@ bool Line::Read(HWPFile & hwpf)
 hwpf.Read2b(&color, 1);
 style.xpos = width;
 
-return !hwpf.State();
+bool bSuccess = !hwpf.State();
+if (bSuccess)
+hwpf.AddFBoxStyle(&style);
+return bSuccess;
 }
 
 // hidden(15)


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - hwpfilter/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 hwpfilter/source/drawing.h   |   13 +
 hwpfilter/source/hwpfile.cxx |9 +++--
 hwpfilter/source/hwpfile.h   |2 ++
 hwpfilter/source/hwpread.cxx |2 +-
 4 files changed, 19 insertions(+), 7 deletions(-)

New commits:
commit 4836ac408b04225b66246671e29a54cd0d6703cf
Author: Caolán McNamara 
AuthorDate: Sun Feb 27 21:17:52 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:12:30 2022 +0100

ofz#44991 keep paragraph's that failed to load until import is complete

to avoid dangling references to them

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

diff --git a/hwpfilter/source/drawing.h b/hwpfilter/source/drawing.h
index 935b33171c15..ff389876c4d2 100644
--- a/hwpfilter/source/drawing.h
+++ b/hwpfilter/source/drawing.h
@@ -315,7 +315,7 @@ static bool LoadCommonHeader(HWPDrawingObject * hdo, 
unsigned short * link_info)
 return hmem->skipBlock(size - common_size ) != 0;
 }
 
-static std::unique_ptr LoadDrawingObject(void)
+static std::unique_ptr LoadDrawingObject(HWPFile& hwpf)
 {
 HWPDrawingObject *prev = nullptr;
 std::unique_ptr hdo, head;
@@ -354,7 +354,7 @@ static std::unique_ptr 
LoadDrawingObject(void)
 }
 if (link_info & HDOFILE_HAS_CHILD)
 {
-hdo->child = LoadDrawingObject();
+hdo->child = LoadDrawingObject(hwpf);
 if (hdo->child == nullptr)
 {
 goto error;
@@ -383,6 +383,11 @@ error:
 {
 hdo->type = HWPDO_RECT;
 }
+if (hdo->property.pPara)
+{
+hwpf.move_to_failed(std::unique_ptr(hdo->property.pPara));
+hdo->property.pPara = nullptr;
+}
 HWPDOFunc(hdo.get(), OBJFUNC_FREE, nullptr, 0);
 hdo.reset();
 
@@ -396,7 +401,7 @@ error:
 }
 
 
-static bool LoadDrawingObjectBlock(Picture * pic)
+static bool LoadDrawingObjectBlock(Picture * pic, HWPFile& hwpf)
 {
 int size;
 if (!hmem->read4b(size))
@@ -422,7 +427,7 @@ static bool LoadDrawingObjectBlock(Picture * pic)
 !hmem->skipBlock(size - HDOFILE_HEADER_SIZE))
 return false;
 
-pic->picinfo.picdraw.hdo = LoadDrawingObject().release();
+pic->picinfo.picdraw.hdo = LoadDrawingObject(hwpf).release();
 if (pic->picinfo.picdraw.hdo == nullptr)
 return false;
 return true;
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 13ce581b2266..96fb79e4f621 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -244,7 +244,7 @@ void HWPFile::ReadParaList(std::vector < HWPPara* > &aplist)
 aplist.push_back(spNode.release());
 spNode.reset( new HWPPara );
 }
-pfailedlist.push_back(std::move(spNode));
+move_to_failed(std::move(spNode));
 }
 
 void HWPFile::ReadParaList(std::vector< std::unique_ptr > &aplist, 
unsigned char flag)
@@ -278,7 +278,12 @@ void HWPFile::ReadParaList(std::vector< 
std::unique_ptr > &aplist, unsi
 aplist.push_back(std::move(spNode));
 spNode.reset( new HWPPara );
 }
-pfailedlist.push_back(std::move(spNode));
+move_to_failed(std::move(spNode));
+}
+
+void HWPFile::move_to_failed(std::unique_ptr xPara)
+{
+pfailedlist.push_back(std::move(xPara));
 }
 
 void HWPFile::TagsRead()
diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h
index f5f30d925416..f7121b6b1757 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -256,6 +256,8 @@ class DLLEXPORT HWPFile
 }
 void pop_hpara_type() { element_import_stack.pop_back(); }
 
+void move_to_failed(std::unique_ptr rPara);
+
 private:
 int compareCharShape(CharShape const *shape);
 int compareParaShape(ParaShape const *shape);
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index 28506b369dac..4c15350aaa61 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -491,7 +491,7 @@ bool Picture::Read(HWPFile & hwpf)
 if (pictype == PICTYPE_DRAW)
 {
 auto xGuard(std::make_unique(follow.data(), 
follow_block_size));
-LoadDrawingObjectBlock(this);
+LoadDrawingObjectBlock(this, hwpf);
 style.cell = picinfo.picdraw.hdo;
 xGuard.reset();
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - hwpfilter/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 hwpfilter/source/drawing.h   |   13 +
 hwpfilter/source/hwpfile.cxx |9 +++--
 hwpfilter/source/hwpfile.h   |2 ++
 hwpfilter/source/hwpread.cxx |2 +-
 4 files changed, 19 insertions(+), 7 deletions(-)

New commits:
commit e650d99c199fc2f453eb239e1c35e4a82a92900b
Author: Caolán McNamara 
AuthorDate: Sun Feb 27 21:17:52 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:11:53 2022 +0100

ofz#44991 keep paragraph's that failed to load until import is complete

to avoid dangling references to them

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

diff --git a/hwpfilter/source/drawing.h b/hwpfilter/source/drawing.h
index c7526a4c591e..54d98bbf5262 100644
--- a/hwpfilter/source/drawing.h
+++ b/hwpfilter/source/drawing.h
@@ -315,7 +315,7 @@ static bool LoadCommonHeader(HWPDrawingObject * hdo, 
unsigned short * link_info)
 return hmem->skipBlock(size - common_size ) != 0;
 }
 
-static std::unique_ptr LoadDrawingObject(void)
+static std::unique_ptr LoadDrawingObject(HWPFile& hwpf)
 {
 HWPDrawingObject *prev = nullptr;
 std::unique_ptr hdo, head;
@@ -354,7 +354,7 @@ static std::unique_ptr 
LoadDrawingObject(void)
 }
 if (link_info & HDOFILE_HAS_CHILD)
 {
-hdo->child = LoadDrawingObject();
+hdo->child = LoadDrawingObject(hwpf);
 if (hdo->child == nullptr)
 {
 goto error;
@@ -383,6 +383,11 @@ error:
 {
 hdo->type = HWPDO_RECT;
 }
+if (hdo->property.pPara)
+{
+hwpf.move_to_failed(std::unique_ptr(hdo->property.pPara));
+hdo->property.pPara = nullptr;
+}
 HWPDOFunc(hdo.get(), OBJFUNC_FREE, nullptr, 0);
 hdo.reset();
 
@@ -396,7 +401,7 @@ error:
 }
 
 
-static bool LoadDrawingObjectBlock(Picture * pic)
+static bool LoadDrawingObjectBlock(Picture * pic, HWPFile& hwpf)
 {
 int size;
 if (!hmem->read4b(size))
@@ -422,7 +427,7 @@ static bool LoadDrawingObjectBlock(Picture * pic)
 !hmem->skipBlock(size - HDOFILE_HEADER_SIZE))
 return false;
 
-pic->picinfo.picdraw.hdo = LoadDrawingObject().release();
+pic->picinfo.picdraw.hdo = LoadDrawingObject(hwpf).release();
 if (pic->picinfo.picdraw.hdo == nullptr)
 return false;
 return true;
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 4ff62fa9db30..15f73fbec6ec 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -238,7 +238,7 @@ void HWPFile::ReadParaList(std::vector < HWPPara* > &aplist)
 aplist.push_back(spNode.release());
 spNode.reset( new HWPPara );
 }
-pfailedlist.push_back(std::move(spNode));
+move_to_failed(std::move(spNode));
 }
 
 void HWPFile::ReadParaList(std::vector< std::unique_ptr > &aplist, 
unsigned char flag)
@@ -272,7 +272,12 @@ void HWPFile::ReadParaList(std::vector< 
std::unique_ptr > &aplist, unsi
 aplist.push_back(std::move(spNode));
 spNode.reset( new HWPPara );
 }
-pfailedlist.push_back(std::move(spNode));
+move_to_failed(std::move(spNode));
+}
+
+void HWPFile::move_to_failed(std::unique_ptr xPara)
+{
+pfailedlist.push_back(std::move(xPara));
 }
 
 void HWPFile::TagsRead()
diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h
index 4e92185a11eb..7e98c1e20271 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -253,6 +253,8 @@ class DLLEXPORT HWPFile
 }
 void pop_hpara_type() { element_import_stack.pop_back(); }
 
+void move_to_failed(std::unique_ptr rPara);
+
 private:
 int compareCharShape(CharShape const *shape);
 int compareParaShape(ParaShape const *shape);
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index 8e4a96c726d0..d0df1cf97ba2 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -494,7 +494,7 @@ bool Picture::Read(HWPFile & hwpf)
 if (pictype == PICTYPE_DRAW)
 {
 auto xGuard(std::make_unique(follow.data(), 
follow_block_size));
-LoadDrawingObjectBlock(this);
+LoadDrawingObjectBlock(this, hwpf);
 style.cell = picinfo.picdraw.hdo;
 xGuard.reset();
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - vcl/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/ttcr.cxx |   33 ++---
 1 file changed, 26 insertions(+), 7 deletions(-)

New commits:
commit e656da36999555bff55fc657743eb84d2b869bf4
Author: Caolán McNamara 
AuthorDate: Sun Feb 27 12:05:38 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:10:16 2022 +0100

ofz#45081 check font length

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

diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index b9839b727f40..d4ff5f413ede 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -1308,14 +1308,21 @@ static void ProcessTables(TrueTypeCreator *tt)
 do {
 GlyphData *gd = static_cast(listCurrent(glyphlist));
 
-if (gd->compflag) {   /* re-number all components 
*/
+if (gd->compflag && gd->nbytes > 10) {/* re-number all components 
*/
 sal_uInt16 flags, index;
 sal_uInt8 *ptr = gd->ptr + 10;
+size_t nRemaining = gd->nbytes - 10;
 do {
-sal_uInt32 j;
+if (nRemaining < 4)
+{
+SAL_WARN("vcl.fonts", "truncated font");
+break;
+}
 flags = GetUInt16(ptr, 0);
 index = GetUInt16(ptr, 2);
+
 /* XXX use the sorted array of old to new glyphID mapping and 
do a binary search */
+sal_uInt32 j;
 for (j = 0; j < nGlyphs; j++) {
 if (gid[j] == index) {
 break;
@@ -1326,20 +1333,32 @@ static void ProcessTables(TrueTypeCreator *tt)
 PutUInt16(static_cast(j), ptr, 2);
 
 ptr += 4;
+nRemaining -= 4;
 
+sal_uInt32 nAdvance = 0;
 if (flags & ARG_1_AND_2_ARE_WORDS) {
-ptr += 4;
+nAdvance += 4;
 } else {
-ptr += 2;
+nAdvance += 2;
 }
 
 if (flags & WE_HAVE_A_SCALE) {
-ptr += 2;
+nAdvance += 2;
 } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
-ptr += 4;
+nAdvance += 4;
 } else if (flags & WE_HAVE_A_TWO_BY_TWO) {
-ptr += 8;
+nAdvance += 8;
 }
+
+if (nRemaining < nAdvance)
+{
+SAL_WARN("vcl.fonts", "truncated font");
+break;
+}
+
+ptr += nAdvance;
+nRemaining -= nAdvance;
+
 } while (flags & MORE_COMPONENTS);
 }
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/ttcr.cxx |   33 ++---
 1 file changed, 26 insertions(+), 7 deletions(-)

New commits:
commit 568753f4d867c4681b762b63f9b1254f56865da4
Author: Caolán McNamara 
AuthorDate: Sun Feb 27 12:05:38 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:09:21 2022 +0100

ofz#45081 check font length

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

diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index b9839b727f40..d4ff5f413ede 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -1308,14 +1308,21 @@ static void ProcessTables(TrueTypeCreator *tt)
 do {
 GlyphData *gd = static_cast(listCurrent(glyphlist));
 
-if (gd->compflag) {   /* re-number all components 
*/
+if (gd->compflag && gd->nbytes > 10) {/* re-number all components 
*/
 sal_uInt16 flags, index;
 sal_uInt8 *ptr = gd->ptr + 10;
+size_t nRemaining = gd->nbytes - 10;
 do {
-sal_uInt32 j;
+if (nRemaining < 4)
+{
+SAL_WARN("vcl.fonts", "truncated font");
+break;
+}
 flags = GetUInt16(ptr, 0);
 index = GetUInt16(ptr, 2);
+
 /* XXX use the sorted array of old to new glyphID mapping and 
do a binary search */
+sal_uInt32 j;
 for (j = 0; j < nGlyphs; j++) {
 if (gid[j] == index) {
 break;
@@ -1326,20 +1333,32 @@ static void ProcessTables(TrueTypeCreator *tt)
 PutUInt16(static_cast(j), ptr, 2);
 
 ptr += 4;
+nRemaining -= 4;
 
+sal_uInt32 nAdvance = 0;
 if (flags & ARG_1_AND_2_ARE_WORDS) {
-ptr += 4;
+nAdvance += 4;
 } else {
-ptr += 2;
+nAdvance += 2;
 }
 
 if (flags & WE_HAVE_A_SCALE) {
-ptr += 2;
+nAdvance += 2;
 } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
-ptr += 4;
+nAdvance += 4;
 } else if (flags & WE_HAVE_A_TWO_BY_TWO) {
-ptr += 8;
+nAdvance += 8;
 }
+
+if (nRemaining < nAdvance)
+{
+SAL_WARN("vcl.fonts", "truncated font");
+break;
+}
+
+ptr += nAdvance;
+nRemaining -= nAdvance;
+
 } while (flags & MORE_COMPONENTS);
 }
 


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

2022-03-01 Thread Luboš Luňák (via logerrit)
 sc/source/ui/docshell/impex.cxx |   15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit a85b647f7bb6cb869abf22ab9ecce419ad5083e0
Author: Luboš Luňák 
AuthorDate: Tue Mar 1 12:55:29 2022 +0100
Commit: Luboš Luňák 
CommitDate: Tue Mar 1 18:02:11 2022 +0100

compress calls to AdjustRowHeight() to just one call (tdf#94677)

This function imports only text, so I think doing one big call
at the end should be fine.

Change-Id: I267f5857ac11cfb95245434333f2ca5fa7e662cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130789
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 5ff892fe19ca..c6760535ef30 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1530,7 +1530,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
 SCCOL nStartCol = aRange.aStart.Col();
 SCCOL nEndCol = aRange.aEnd.Col();
 SCROW nStartRow = aRange.aStart.Row();
-SCTAB nTab = aRange.aStart.Tab();
+const SCTAB nTab = aRange.aStart.Tab();
 
 boolbFixed  = pExtOptions->IsFixedLen();
 OUString aSeps  = pExtOptions->GetFieldSeps();  // Need 
non-const for ReadCsvLine(),
@@ -1593,6 +1593,9 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
 
 sal_uInt64 nOriginalStreamPos = rStrm.Tell();
 
+SCROW nFirstUpdateRowHeight = SCROW_MAX;
+SCROW nLastUpdateRowHeight = -1;
+
 ScDocumentImport aDocImport(rDoc);
 do
 {
@@ -1706,7 +1709,10 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
 if (!bDetermineRange)
 {
 if (bMultiLine && !bRangeIsDetermined && pDocSh)
-pDocSh->AdjustRowHeight( nRow, nRow, nTab);
+{   // Adjust just once at the end for a whole range.
+nFirstUpdateRowHeight = std::min( nFirstUpdateRowHeight, 
nRow );
+nLastUpdateRowHeight = std::max( nLastUpdateRowHeight, 
nRow );
+}
 xProgress->SetStateOnPercent( rStrm.Tell() - nOldPos );
 }
 ++nRow;
@@ -1743,10 +1749,15 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
 
 bDetermineRange = !bDetermineRange; // toggle
 } while (!bDetermineRange);
+
 if ( !mbOverwriting )
 aDocImport.finalize();
 
 xProgress.reset();// make room for AdjustRowHeight progress
+
+if( nFirstUpdateRowHeight < nLastUpdateRowHeight && pDocSh )
+pDocSh->AdjustRowHeight( nFirstUpdateRowHeight, nLastUpdateRowHeight, 
nTab);
+
 if (bRangeIsDetermined)
 EndPaste(false);
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - vcl/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/sft.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 29c77bd5c0984deba5a747cfa55f249188b578c8
Author: Caolán McNamara 
AuthorDate: Sun Feb 27 12:21:47 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:02:09 2022 +0100

ofz#45082 Out-of-memory

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

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 71e84fae3402..4d2eba36c7f3 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2098,10 +2098,15 @@ GlyphData *GetTTRawGlyphData(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID)
 return nullptr;
 
 /* #127161# check the glyph offsets */
+sal_uInt32 nNextOffset = ttf->glyphOffset(glyphID + 1);
+sal_uInt32 nOffset = ttf->glyphOffset(glyphID);
+if (nNextOffset < nOffset)
+return nullptr;
+
 if (length < ttf->glyphOffset(glyphID + 1))
 return nullptr;
 
-length = ttf->glyphOffset(glyphID + 1) - ttf->glyphOffset(glyphID);
+length = nNextOffset - nOffset;
 
 GlyphData* d = static_cast(malloc(sizeof(GlyphData))); 
assert(d != nullptr);
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/source

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/sft.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 987f34dd9a464cc6219b17f22c61c99956a2a9ed
Author: Caolán McNamara 
AuthorDate: Sun Feb 27 12:21:47 2022 +
Commit: Michael Stahl 
CommitDate: Tue Mar 1 18:02:00 2022 +0100

ofz#45082 Out-of-memory

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

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 4b54bda1767a..995c6b36373a 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2099,10 +2099,15 @@ GlyphData *GetTTRawGlyphData(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID)
 return nullptr;
 
 /* #127161# check the glyph offsets */
+sal_uInt32 nNextOffset = ttf->glyphOffset(glyphID + 1);
+sal_uInt32 nOffset = ttf->glyphOffset(glyphID);
+if (nNextOffset < nOffset)
+return nullptr;
+
 if (length < ttf->glyphOffset(glyphID + 1))
 return nullptr;
 
-length = ttf->glyphOffset(glyphID + 1) - ttf->glyphOffset(glyphID);
+length = nNextOffset - nOffset;
 
 GlyphData* d = static_cast(malloc(sizeof(GlyphData))); 
assert(d != nullptr);
 


[Libreoffice-commits] core.git: include/o3tl include/rtl o3tl/qa

2022-03-01 Thread Luboš Luňák (via logerrit)
 include/o3tl/string_view.hxx |7 ++-
 include/rtl/ustring.hxx  |4 
 o3tl/qa/test-string_view.cxx |8 
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit ffe7850a1449c43dd077c5cb073d8eee178f7099
Author: Luboš Luňák 
AuthorDate: Tue Mar 1 10:44:12 2022 +0100
Commit: Luboš Luňák 
CommitDate: Tue Mar 1 18:00:17 2022 +0100

fix o3tl::equalsIgnoreAsciiCase()

As the OUString equivalent shows, it needs to check == 0. Commit
33ecd0d5c4fff9511a8436513936a3f7044a775a for some reason also
dropped the cheap checks (even from OUString) that OString has,
so add them.

Change-Id: I88e68b5ae10fd76c3c08b9b36d5abed0fad17bbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130753
Reviewed-by: Stephan Bergmann 
Reviewed-by: Luboš Luňák 
Tested-by: Jenkins

diff --git a/include/o3tl/string_view.hxx b/include/o3tl/string_view.hxx
index 0ca26a829932..74f15bf33b54 100644
--- a/include/o3tl/string_view.hxx
+++ b/include/o3tl/string_view.hxx
@@ -23,7 +23,12 @@ namespace o3tl
 // Like OUString::equalsIgnoreAsciiCase, but for two std::u16string_view:
 inline bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view 
s2)
 {
-return rtl_ustr_compareIgnoreAsciiCase_WithLength(s1.data(), s1.size(), 
s2.data(), s2.size());
+if (s1.size() != s2.size())
+return false;
+if (s1.data() == s2.data())
+return true;
+return rtl_ustr_compareIgnoreAsciiCase_WithLength(s1.data(), s1.size(), 
s2.data(), s2.size())
+   == 0;
 };
 
 // Similar to OString::getToken, returning the first token of a 
std::string_view, starting at a
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index cad257caeb58..4d983a089f72 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -977,6 +977,10 @@ public:
 */
 #if defined LIBO_INTERNAL_ONLY
 bool equalsIgnoreAsciiCase(std::u16string_view sv) const {
+if ( sal_uInt32(pData->length) != sv.size() )
+return false;
+if ( pData->buffer == sv.data() )
+return true;
 return
 rtl_ustr_compareIgnoreAsciiCase_WithLength(
 pData->buffer, pData->length, sv.data(), sv.size())
diff --git a/o3tl/qa/test-string_view.cxx b/o3tl/qa/test-string_view.cxx
index b400c9605962..c068638f800e 100644
--- a/o3tl/qa/test-string_view.cxx
+++ b/o3tl/qa/test-string_view.cxx
@@ -60,6 +60,7 @@ private:
 CPPUNIT_TEST(testStartsWithRest);
 CPPUNIT_TEST(testEndsWith);
 CPPUNIT_TEST(testEndsWithRest);
+CPPUNIT_TEST(testEqualsIgnoreAsciiCase);
 CPPUNIT_TEST_SUITE_END();
 
 void testStartsWith()
@@ -585,6 +586,13 @@ private:
 CPPUNIT_ASSERT_EQUAL(u""sv, rest);
 }
 }
+
+void testEqualsIgnoreAsciiCase()
+{
+using namespace std::string_view_literals;
+CPPUNIT_ASSERT(o3tl::equalsIgnoreAsciiCase(u"test"sv, u"test"sv));
+CPPUNIT_ASSERT(!o3tl::equalsIgnoreAsciiCase(u"test"sv, u"test2"sv));
+}
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);


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

2022-03-01 Thread Caolán McNamara (via logerrit)
 sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf |  347 ++
 sw/qa/extras/layout/layout.cxx|7 
 sw/source/core/layout/tabfrm.cxx  |1 
 3 files changed, 355 insertions(+)

New commits:
commit ee2a192923bf709d05c174848e7054cd411b205a
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 11:45:23 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 17:56:56 2022 +0100

protect frame from triggering deleting itself

LIBREOFFICE-N4LA0OHZ

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

diff --git a/sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf 
b/sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf
new file mode 100755
index ..47d284aa5753
--- /dev/null
+++ b/sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf
@@ -0,0 +1,347 @@
+{\rtf1\ansi\ansicpg1252\deff0
+{\fontttbl
+\f0\froman\fcharset0 Times;
+\f1\fswiss\fcharset0 Helvetica;
+\f2\fmodern\fcharset0 Courier;
+\f3\ftech\fcharset2 S�mbol;
+}
+{]colortbl
+;
+\red127\green255\blue212;
+\red0\green0\blue0;
+\red0\green0\blue255;
+\red25\green0\blue255;
+\red190\green190\blue190;
+\red0\green255\blue0;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red176\green48\blue96;
+\red0\green0\blue128;
+\red85\green107\blue47;
+\red160\green32\blue240;
+\red255\green0\blue0;
+\red192\green-1733928082104\blue192;
+\red0\green128\blue128;
+\red255\green255\blue255;
+\red255\green255\blue0;
+}
+{\info
+{\*\userprops
+{\propname creator}\proptype30
+{\staticval XMLmind FO Converter}
+}
+}
+\facingp\masgmirror\fet0\ftnbj
+\sectd
+\pghsxn15840\pgwsxn12240
+\margtsxn1440\margbsxn1440\marglsxn1440\margrsxn1440J\margmirsxn
+\headery720
+\footery720
+\titlepg
+\pgnrestart\pgnstarts1|pgndec
+{\headerr
+\trowd\trleft0
+clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf18446744073709551614\cellx279
+\pard\intbl
+\cell
+\tard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\headerl
+\trowd\trleft0
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\�ellx186
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\headerf
+}
+{\footerr
+\trowd\trleft0
+\clvertalb
+\clbrdrT\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10Lbrdrcf2\cellx186
+\clvertalb
+\clbrdrt\brdvs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{footerl
+\trowd\trleft0
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brd2cf2\cellx186
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\row
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\footerf
+}
+{\*\bkmkstart id2754642}
+{\*\bkmkend i`2754642}
+\pard\qect
+\sectd
+\pghsxn1\pgwsxn12240
+\margtsxn1440\margbsxn1440\marglsxn1440\margrsxn1440
+\margmirsxn
+\headery720\footery720
+\titlepg
+\pgncont\pgnlcrm
+{\headerr
+\trowd\trleft0
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalt
+^clbrdrb\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\headerl
+\trowd\trleft0
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\headerf
+\trkwd\trleft0
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalt
+\clbrdrb\brdrs\brdrw10\b�drcf8\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\footerr
+\trowd\trleft0
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx186
+\cdrertal�VQbdqomA
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl\qc
+{\plain\f0\fs20\cf2
+\chpgn
+}
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\footerl
+\trowd\trleft0
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf3\cellx186
+\clvertalb
+\clbrdrt\brdr

[Libreoffice-commits] core.git: i18npool/inc i18npool/source

2022-03-01 Thread Noel Grandin (via logerrit)
 i18npool/inc/cclass_unicode.hxx   |5 +--
 i18npool/source/characterclassification/cclass_unicode.cxx|1 
 i18npool/source/characterclassification/cclass_unicode_parser.cxx |   16 
+-
 i18npool/source/transliteration/transliteration_body.cxx  |3 +
 4 files changed, 12 insertions(+), 13 deletions(-)

New commits:
commit 35f1e9c7f97ed08dcb87e90cb663ae2d333739e5
Author: Noel Grandin 
AuthorDate: Tue Mar 1 13:46:32 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 17:55:52 2022 +0100

fix data races in cclass_Unicode

WARNING: ThreadSanitizer: data race (pid=1220516)
  Write of size 4 at 0x7b1c00035510 by thread T19 (mutexes: write M0):
i18npool::Transliteration_casemapping::setMappingType(MappingType,
com::sun::star::lang::Locale const&) :? (libi18npoollo.so+0xe5685)
i18npool::cclass_Unicode::toUpper(rtl::OUString const&, int, int,
com::sun::star::lang::Locale const&) :? (libi18npoollo.so+0x792fa)
i18npool::CharacterClassificationImpl::toUpper(rtl::OUString const&,
int, int, com::sun::star::lang::Locale const&) :?
(libi18npoollo.so+0x83855)
(libutllo.so+0xc6f42)
(libsvllo.so+0xc5823)
const&) ??:? (libsclo.so+0x4978f3)
const&, std::shared_ptr const&) :?
(libscfiltlo.so+0x46b354)
const&, int) :? (libscfiltlo.so+0x46b44a)
(libscfiltlo.so+0x4764a0)
:? (libscfiltlo.so+0x4764e9)
oox::core::ContextHandler2::endFastElement(int) ??:?
(libooxlo.so+0x1a10eb)
(libexpwraplo.so+0x2fbdf)
(libexpwraplo.so+0x2fb21)
char const*, unsigned char const*, unsigned char const*)
fastparser.cxx:? (libexpwraplo.so+0x2c255)
/build/libxml2-vTtzwD/libxml2-2.9.12+dfsg/builddir/main/../../parser.c:9736
(libxml2.so.2+0x5751a) (BuildId:
baaa02c136f3351b1c499e94450b9b9c0d4e)
/build/libxml2-vTtzwD/libxml2-2.9.12+dfsg/builddir/main/../../parser.c:9691
(libxml2.so.2+0x5751a)

sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource
const&) :? (libexpwraplo.so+0x2972d)

sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource
const&) ??:? (libexpwraplo.so+0x30e88)
oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource
const&, bool) ??:? (libooxlo.so+0x1a3220)

oox::core::FastParser::parseStream(com::sun::star::uno::Reference
const&, rtl::OUString const&) ??:? (libooxlo.so+0x1a3467)

oox::core::XmlFilterBase::importFragment(rtl::Reference
const&, oox::core::FastParser&) ??:? (libooxlo.so+0x1c46c1)

oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference
const&, oox::core::FastParser&) :? (libscfiltlo.so+0x4be642)
workbookfragment.cxx:? (libscfiltlo.so+0x4b618d)
(libcomphelper.so+0x15e63b)
(libuno_salhelpergcc3.so.3+0x5257)
#25 threadFunc :? (libuno_salhelpergcc3.so.3+0x550e)
(libuno_sal.so.3+0x67e25)

Previous write of size 4 at 0x7b1c00035510 by thread T18 (mutexes:
write M1):
i18npool::Transliteration_casemapping::setMappingType(MappingType,
com::sun::star::lang::Locale const&) :? (libi18npoollo.so+0xe5685)
i18npool::cclass_Unicode::toUpper(rtl::OUString const&, int, int,
com::sun::star::lang::Locale const&) :? (libi18npoollo.so+0x792fa)
i18npool::CharacterClassificationImpl::toUpper(rtl::OUString const&,
int, int, com::sun::star::lang::Locale const&) :?
(libi18npoollo.so+0x83855)
(libutllo.so+0xc6f42)
(libsvllo.so+0xc5823)
const&) ??:? (libsclo.so+0x4978f3)
const&, std::shared_ptr const&) :?
(libscfiltlo.so+0x46b354)
const&, int) :? (libscfiltlo.so+0x46b44a)
(libscfiltlo.so+0x4764a0)
:? (libscfiltlo.so+0x4764e9)
oox::core::ContextHandler2::endFastElement(int) ??:?
(libooxlo.so+0x1a10eb)
(libexpwraplo.so+0x2fbdf)
(libexpwraplo.so+0x2fb21)
char const*, unsigned char const*, unsigned char const*)
fastparser.cxx:? (libexpwraplo.so+0x2c255)
/build/libxml2-vTtzwD/libxml2-2.9.12+dfsg/builddir/main/../../parser.c:9736
(libxml2.so.2+0x5751a) (BuildId:
baaa02c136f3351b1c499e94450b9b9c0d4e)
/build/libxml2-vTtzwD/libxml2-2.9.12+dfsg/builddir/main/../../parser.c:9691
(libxml2.so.2+0x5751a)

sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource
const&) :? (libexpwraplo.so+0x2972d)

sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource
const&) ??:? (libexpwraplo.so+0x30e88)
oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource
const&, bool) ??:? (libooxlo.so+0x1a3220)

oox::core::FastParser::parseStream(com::sun::star::uno::Reference
const&, rtl::OUString const&) ??:? (libooxlo.so+0x1a3467)

oox::core::XmlFilterBase::importFragment(rtl::Reference
const&, oox::core::FastParser&) ??:? (libooxlo.so+0x1c46c1)

oox::xls::WorkbookHelper::importOoxFragment(rtl::Reference
const&, oox::

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

2022-03-01 Thread Noel Grandin (via logerrit)
 sc/source/ui/dataprovider/htmldataprovider.cxx |2 --
 sc/source/ui/dataprovider/xmldataprovider.cxx  |7 +--
 2 files changed, 1 insertion(+), 8 deletions(-)

New commits:
commit 44a403d5a63b16e04b1c66ded6ef4e3bda605ab3
Author: Noel Grandin 
AuthorDate: Tue Mar 1 11:10:58 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 17:55:25 2022 +0100

fix data race in ImportFinished

touching these fields here leads to a race with the access in ::Import.
Rather just leave them to be cleared when the object is destructed.

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

diff --git a/sc/source/ui/dataprovider/htmldataprovider.cxx 
b/sc/source/ui/dataprovider/htmldataprovider.cxx
index 75f222e5fb6d..8b241ddfe049 100644
--- a/sc/source/ui/dataprovider/htmldataprovider.cxx
+++ b/sc/source/ui/dataprovider/htmldataprovider.cxx
@@ -268,8 +268,6 @@ void HTMLDataProvider::Import()
 void HTMLDataProvider::ImportFinished()
 {
 mrDataSource.getDBManager()->WriteToDoc(*mpDoc);
-mxHTMLFetchThread.clear();
-mpDoc.reset();
 }
 
 const OUString& HTMLDataProvider::GetURL() const
diff --git a/sc/source/ui/dataprovider/xmldataprovider.cxx 
b/sc/source/ui/dataprovider/xmldataprovider.cxx
index ba5bba61ac1c..4ffa45bd16e7 100644
--- a/sc/source/ui/dataprovider/xmldataprovider.cxx
+++ b/sc/source/ui/dataprovider/xmldataprovider.cxx
@@ -118,12 +118,7 @@ void XMLDataProvider::Import()
 }
 }
 
-void XMLDataProvider::ImportFinished()
-{
-mrDataSource.getDBManager()->WriteToDoc(*mpDoc);
-mxXMLFetchThread.clear();
-mpDoc.reset();
-}
+void XMLDataProvider::ImportFinished() { 
mrDataSource.getDBManager()->WriteToDoc(*mpDoc); }
 
 const OUString& XMLDataProvider::GetURL() const { return 
mrDataSource.getURL(); }
 }


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

2022-03-01 Thread Noel Grandin (via logerrit)
 sd/source/ui/view/drviews2.cxx |   22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 6df85675378a5a90b0d89d712015e010f6893c9f
Author: Noel Grandin 
AuthorDate: Tue Mar 1 13:45:09 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 17:53:43 2022 +0100

fix assert when changing fill on impress shape

reverts part of
commit 31e7845339b30a69f06a04619660398fe4267268
Author: Noel Grandin 
Date:   Thu Feb 17 12:19:49 2022 +0200
use more SfxItemSet::CloneAsValue

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

diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 1cd427e8b6f8..bef73c1726d3 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -543,12 +543,12 @@ public:
 }
 };
 
-void lcl_convertStringArguments(sal_uInt16 nSlot, SfxItemSet& rArgs)
+void lcl_convertStringArguments(sal_uInt16 nSlot, const 
std::unique_ptr& pArgs)
 {
 Color aColor;
 const SfxPoolItem* pItem = nullptr;
 
-if (SfxItemState::SET == rArgs.GetItemState(SID_ATTR_LINE_WIDTH_ARG, 
false, &pItem))
+if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_LINE_WIDTH_ARG, 
false, &pItem))
 {
 double fValue = static_cast(pItem)->GetValue();
 // FIXME: different units...
@@ -556,9 +556,9 @@ public:
 int nValue = fValue * nPow;
 
 XLineWidthItem aItem(nValue);
-rArgs.Put(aItem);
+pArgs->Put(aItem);
 }
-if (SfxItemState::SET == rArgs.GetItemState(SID_ATTR_COLOR_STR, false, 
&pItem))
+if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, 
false, &pItem))
 {
 OUString sColor = static_cast(pItem)->GetValue();
 
@@ -572,26 +572,26 @@ public:
 case SID_ATTR_LINE_COLOR:
 {
 XLineColorItem aLineColorItem(OUString(), aColor);
-rArgs.Put(aLineColorItem);
+pArgs->Put(aLineColorItem);
 break;
 }
 
 case SID_ATTR_FILL_COLOR:
 {
 XFillColorItem aFillColorItem(OUString(), aColor);
-rArgs.Put(aFillColorItem);
+pArgs->Put(aFillColorItem);
 break;
 }
 }
 }
-if (SfxItemState::SET == rArgs.GetItemState(SID_FILL_GRADIENT_JSON, 
false, &pItem))
+if (SfxItemState::SET == pArgs->GetItemState(SID_FILL_GRADIENT_JSON, 
false, &pItem))
 {
 const SfxStringItem* pJSON = static_cast(pItem);
 if (pJSON)
 {
 XGradient aGradient = XGradient::fromJSON(pJSON->GetValue());
 XFillGradientItem aItem(aGradient);
-rArgs.Put(aItem);
+pArgs->Put(aItem);
 }
 }
 }
@@ -683,9 +683,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 {
 if( rReq.GetArgs() )
 {
-SfxItemSet aNewArgs = rReq.GetArgs()->CloneAsValue();
-lcl_convertStringArguments(rReq.GetSlot(), aNewArgs);
-mpDrawView->SetAttributes(aNewArgs);
+std::unique_ptr pNewArgs = rReq.GetArgs()->Clone();
+lcl_convertStringArguments(rReq.GetSlot(), pNewArgs);
+mpDrawView->SetAttributes(*pNewArgs);
 rReq.Done();
 }
 else


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

2022-03-01 Thread Attila Bakos (NISZ) (via logerrit)
 sw/inc/textboxhelper.hxx  |   15 -
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |   19 -
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx |4 
 sw/qa/extras/uiwriter/data/tdf147126.docx |binary
 sw/qa/extras/uiwriter/uiwriter3.cxx   |  132 
 sw/source/core/doc/textboxhelper.cxx  |  281 +++---
 sw/source/core/frmedt/feshview.cxx|8 
 sw/source/core/text/porfly.cxx|   56 -
 xmloff/qa/unit/draw.cxx   |2 
 9 files changed, 282 insertions(+), 235 deletions(-)

New commits:
commit 0d29394598db2e336a9982cbb7041ea407b2bf6d
Author: Attila Bakos (NISZ) 
AuthorDate: Mon Feb 7 17:09:42 2022 +0100
Commit: László Németh 
CommitDate: Tue Mar 1 17:53:01 2022 +0100

tdf#147126 sw: fix missing as_char anchoring of group textboxes

which resulted lost (invisible) text content before
implementing its support now.

Cleanup to SwTextBoxHelper by removing its unneeded functions.

testFDO78590 was commented out temporarily because it has a
pure VML groupshape inside and it's converted to WPG during
the test run resulting crash on reopening, because lack of
its support in DocumentContentOperationsManager, trying to
convert the content to a text frame inside a text frame.

Regression from commit 2951cbdf3a6e2b62461665546b47e1d253fcb834
"tdf#143574 OOXML export/import of textboxes in group shapes".

Change-Id: Ic6ce3549d390ae763044f54e991f390677704396
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129627
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx
index a41c6c9eaf87..fd194a639bcc 100644
--- a/sw/inc/textboxhelper.hxx
+++ b/sw/inc/textboxhelper.hxx
@@ -92,10 +92,6 @@ public:
 /// Copy shape attributes to the text frame
 static void updateTextBoxMargin(SdrObject* pObj);
 
-/// Sets the surround to through for the textframe of the given shape,
-/// not to interfere with the layout. Returns true on success.
-static bool setWrapThrough(SwFrameFormat* pShape);
-
 /// Sets the anchor of the associated textframe of the given shape, and
 /// returns true on success.
 static bool changeAnchor(SwFrameFormat* pShape, SdrObject* pObj);
@@ -104,19 +100,9 @@ public:
 /// returns true on success.
 static bool doTextBoxPositioning(SwFrameFormat* pShape, SdrObject* pObj);
 
-/// Returns true if the anchor different for the  given shape, and the
-/// associated textframe of the given shape.
-/// Note: In case of AS_CHAR anchor the anchor type must be different,
-/// because if not, layout breaks, but this situation also handled by
-/// this function, and returns true in that case too.
-static std::optional isAnchorTypeDifferent(const SwFrameFormat* 
pShape);
-
 /// Sets the correct size of textframe depending on the given SdrObject.
 static bool syncTextBoxSize(SwFrameFormat* pShape, SdrObject* pObj);
 
-/// Returns true if the given shape has a valid textframe.
-static bool isTextBoxShapeHasValidTextFrame(const SwFrameFormat* pShape);
-
 // Returns true on success. Synchronize z-order of the text frame of the 
given textbox
 // by setting it one level higher than the z-order of the shape of the 
textbox.
 static bool DoTextBoxZOrderCorrection(SwFrameFormat* pShape, const 
SdrObject* pObj);
@@ -188,6 +174,7 @@ public:
 /// Calls the method given by pFunc with every textboxes of the group 
given by pFormat.
 static void synchronizeGroupTextBoxProperty(bool pFunc(SwFrameFormat*, 
SdrObject*),
 SwFrameFormat* pFormat, 
SdrObject* pObj);
+
 /// Collect all textboxes of the group given by the pGroupObj Parameter. 
Returns with a
 /// vector filled with the textboxes.
 static std::vector CollectTextBoxes(SdrObject* 
pGroupObject,
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index bcfa93e84e72..42b743aabccc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -432,15 +432,16 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo78910)
 assertXPath ( pXmlDoc, "//w:hyperlink[2]/w:r[5]/w:fldChar", "fldCharType", 
"end" );
 }
 
-CPPUNIT_TEST_FIXTURE(Test, testFDO78590)
-{
-loadAndReload("FDO78590.docx");
-xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
-
-// This is to ensure that the fld starts and ends inside a hyperlink...
-assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "w", 
"9851" );
-assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "h", 
"1669" );
-}
+// FIXME: During this test a pure VML shape get converted to DML and crash at 
verifying.
+// CPPUNIT_TEST_FIXTURE(Test, testFDO78590)
+// {
+// loadAndReload("FDO78590

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

2022-03-01 Thread Andrea Gelmini (via logerrit)
 svx/qa/unit/customshapes.cxx  |2 +-
 svx/qa/unit/svdraw.cxx|6 +++---
 svx/source/customshapes/EnhancedCustomShape3d.cxx |6 +++---
 svx/source/toolbars/extrusionbar.cxx  |2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 16665c48fef0ac178f224cccb1ddced69311835c
Author: Andrea Gelmini 
AuthorDate: Tue Mar 1 17:43:30 2022 +0100
Commit: Julien Nabet 
CommitDate: Tue Mar 1 17:48:39 2022 +0100

Fix typos

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

diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index bcce0ad7b458..bfec1f0141cf 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -223,7 +223,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, 
testTdf145700_3D_FrontLightDim)
 
 // Read bitmap and test color
 // The expected values are taken from an image generated by Word
-// Without the changed methods the nColorDistance was 476 and 173 
respecitively.
+// Without the changed methods the nColorDistance was 476 and 173 
respectively.
 SvFileStream aFileStream(aTempFile.GetURL(), StreamMode::READ);
 vcl::PngImageReader aPNGReader(aFileStream);
 BitmapEx aBMPEx = aPNGReader.read();
diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx
index 275f75507d64..a063ef7d479f 100644
--- a/svx/qa/unit/svdraw.cxx
+++ b/svx/qa/unit/svdraw.cxx
@@ -398,7 +398,7 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testFontWorks)
 assertXPath(pXmlDoc, "//scene", "projectionMode", "Perspective");
 assertXPath(pXmlDoc, "//scene/extrude3D[1]/fill", "color", "#ff");
 assertXPath(pXmlDoc, "//scene/extrude3D[1]/object3Dattributes/material", 
"color", "#ff");
-// ODF default 50% is repesented by Specular Intensity = 2^5. The 
relationship is not linear.
+// ODF default 50% is represented by Specular Intensity = 2^5. The 
relationship is not linear.
 assertXPath(pXmlDoc, "//scene/extrude3D[1]/object3Dattributes/material", 
"specularIntensity",
 "32");
 }
@@ -471,11 +471,11 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testMaterialSpecular)
 CPPUNIT_ASSERT(pXmlDoc);
 
 // 3D specular color is derived from properties 'extrusion-specularity' 
and 'extrusion-first-light
-// -level'. 3D specularIntensity is dervied from property 
'draw:extrusion-shininess'. Both are
+// -level'. 3D specularIntensity is derived from property 
'draw:extrusion-shininess'. Both are
 // object properties, not scene properties. Those were wrong in various 
forms before the patch.
 // Specularity = 77% * first-light-level 67% = 0.5159, which corresponds 
to gray color #848484.
 assertXPath(pXmlDoc, "(//material)[1]", "specular", "#848484");
-// extrusion-shinines 50% corresponds to 3D specularIntensity 32, use 
2^(50/10).
+// extrusion-shininess 50% corresponds to 3D specularIntensity 32, use 
2^(50/10).
 assertXPath(pXmlDoc, "(//material)[1]", "specularIntensity", "32");
 // extrusion-first-light-level 67% corresponds to gray color #ababab, use 
255 * 0.67.
 assertXPath(pXmlDoc, "(//light)[1]", "color", "#ababab");
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx 
b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 0d8078fe6bd3..92ce3437228f 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -783,8 +783,8 @@ SdrObject* EnhancedCustomShape3d::Create3DObject(
 
 // Light Intensity
 
-// For "FirstLight" the 3D-Scene light "1" is regulary used. In 
case of surface "Matte"
-// the light 4 is used instead. For "SecondLight" the 3D-Scene 
light "2" is regulary used.
+// For "FirstLight" the 3D-Scene light "1" is regularly used. In 
case of surface "Matte"
+// the light 4 is used instead. For "SecondLight" the 3D-Scene 
light "2" is regularly used.
 // In case first or second light is not harsh, the lights 5 to 8 
are used in addition
 // to get a soft light appearance.
 // The 3D-Scene light "3" is currently not used.
@@ -892,7 +892,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject(
 
 // ToDo: How to handle fAmbientIntensity larger 1.0 ? Perhaps 
lighten object color?
 
-// Now set the regulary 3D-scene light attributes.
+// Now set the regularly 3D-scene light attributes.
 Color aAmbientColor(basegfx::BColor(fAmbientIntensity).clamp());
 
pScene->GetProperties().SetObjectItem(makeSvx3DAmbientcolorItem(aAmbientColor));
 
diff --git a/svx/source/toolbars/extrusionbar.cxx 
b/svx/source/toolbars/extrusionbar.cxx
index a3247cc02666..3e0273c2862c 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionb

[Libreoffice-commits] core.git: framework/qa qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sc/qa

2022-03-01 Thread Jens Carl (via logerrit)
 framework/qa/complex/api_internal/api.lst  |1 
 qadevOOo/Jar_OOoRunner.mk  |1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldObj.csv |3 
 qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java|  158 
--
 sc/qa/extras/sceditfieldobj-cell.cxx   |8 
 sc/qa/extras/sceditfieldobj-header.cxx |8 
 sc/qa/unoapi/sc_2.sce  |1 
 7 files changed, 16 insertions(+), 164 deletions(-)

New commits:
commit 26cbb045a06c4027bd7b446d692c3b38297d0283
Author: Jens Carl 
AuthorDate: Mon Feb 28 23:54:54 2022 -0800
Commit: Jens Carl 
CommitDate: Tue Mar 1 17:40:52 2022 +0100

tdf#45904 Move XComponent Java test to C++

Move XComponent Jave tests to C++ for ScCellFieldObj_Cell and
ScCellFieldObj_Header (formerly ScCellFieldObj).

Change-Id: Ibf293a72801720fee49acdda5a3a463e9202bb58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130742
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/framework/qa/complex/api_internal/api.lst 
b/framework/qa/complex/api_internal/api.lst
index b588cfd18b4b..6854643155be 100644
--- a/framework/qa/complex/api_internal/api.lst
+++ b/framework/qa/complex/api_internal/api.lst
@@ -72,7 +72,6 @@ job72=sc.ScAccessiblePageHeader
 job73=sc.ScAccessiblePreviewTable
 job74=sc.ScAccessibleSpreadsheet
 job78=sc.ScAutoFormatFieldObj
-job81=sc.ScCellFieldObj
 job88=sc.ScDatabaseRangeObj
 job98=sc.ScHeaderFieldObj
 job126=sc.ScSheetLinkObj
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 4b91eee49fd4..38a0b628ed4d 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -944,7 +944,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
 qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor \
 qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj \
 qadevOOo/tests/java/mod/_sc/ScCellCursorObj \
-qadevOOo/tests/java/mod/_sc/ScCellFieldObj \
 qadevOOo/tests/java/mod/_sc/ScCellObj \
 qadevOOo/tests/java/mod/_sc/ScCellRangeObj \
 qadevOOo/tests/java/mod/_sc/ScCellRangesObj \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldObj.csv
deleted file mode 100644
index 35be57d9423c..
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldObj.csv
+++ /dev/null
@@ -1,3 +0,0 @@
-"ScCellFieldObj";"com::sun::star::lang::XComponent";"dispose()"
-"ScCellFieldObj";"com::sun::star::lang::XComponent";"addEventListener()"
-"ScCellFieldObj";"com::sun::star::lang::XComponent";"removeEventListener()"
diff --git a/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java 
b/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java
deleted file mode 100644
index 0194491218ff..
--- a/qadevOOo/tests/java/mod/_sc/ScCellFieldObj.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * 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 .
- */
-package mod._sc;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.SOfficeFactory;
-
-import com.sun.star.container.XIndexAccess;
-import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.sheet.XSpreadsheet;
-import com.sun.star.sheet.XSpreadsheetDocument;
-import com.sun.star.sheet.XSpreadsheets;
-import com.sun.star.table.XCell;
-import com.sun.star.text.XText;
-import com.sun.star.text.XTextContent;
-import com.sun.star.uno.AnyConverter;
-import com.sun.star.uno.Type;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XInterface;
-
-/**
-* Test for object that represents a text field (implements
-* com.sun.star.text.TextField) which inserted in a cell of
-* the spreadsheet. 
-* Object implements the following interfaces :
-* 
-*   com::sun::star::lang::XComponent
-*   com::sun::star::beans::XPropertySet
-*   com::sun::star::text::XTextField
-*   com::sun::star::text::XTextContent
-*   com::sun::star::text::TextContent
-* 
-* @see com.sun.star.text.TextField
-* @see com.sun.star.lang.XComponent
-* @see com.sun.star.beans.XPropertySet
-

[Libreoffice-commits] core.git: sal/rtl

2022-03-01 Thread Mike Kaganski (via logerrit)
 sal/rtl/strtmpl.hxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 66614d9d1c63ecd957440184e696cd1d71fba96a
Author: Mike Kaganski 
AuthorDate: Tue Mar 1 13:50:20 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Mar 1 17:39:16 2022 +0100

No need to memset the allocated buffer in new_WithLength

Other places that allocate, specifically newFromStr_WithLength and
ensureCapacity, don't initialize the memory.

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

diff --git a/sal/rtl/strtmpl.hxx b/sal/rtl/strtmpl.hxx
index db2df9a8ad75..78375ae07e26 100644
--- a/sal/rtl/strtmpl.hxx
+++ b/sal/rtl/strtmpl.hxx
@@ -1026,9 +1026,7 @@ void new_WithLength( IMPL_RTL_STRINGDATA** ppThis, 
sal_Int32 nLen )
 *ppThis = Alloc( nLen );
 assert(*ppThis != nullptr);
 (*ppThis)->length   = 0;
-
-auto* pTempStr = (*ppThis)->buffer;
-memset(pTempStr, 0, nLen*sizeof(*pTempStr));
+(*ppThis)->buffer[0] = 0;
 }
 }
 


[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: sw/source

2022-03-01 Thread Samuel Mehrbrodt (via logerrit)
 sw/source/uibase/utlui/gloslst.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f9268924f10bbcb6515b2008af37b4920730f3cb
Author: Samuel Mehrbrodt 
AuthorDate: Tue Feb 15 17:17:54 2022 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Tue Mar 1 15:55:47 2022 +0100

Try to fix .bau files being ignored

In some circumstances it might happen that one .bau file gets replaced with
another one, but the "new" one has an older timestamp than the "old" one.

In this case, the .bau file will not be recognized as changed.
So instead of checking for a newer timestamp, check for a different 
timestamp.

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

diff --git a/sw/source/uibase/utlui/gloslst.cxx 
b/sw/source/uibase/utlui/gloslst.cxx
index 35d0f80e50c2..a1a68a9771d9 100644
--- a/sw/source/uibase/utlui/gloslst.cxx
+++ b/sw/source/uibase/utlui/gloslst.cxx
@@ -298,7 +298,7 @@ void SwGlossaryList::Update()
 
 
m_aGroupArr.push_back(std::unique_ptr(pFound));
 }
-else if( pFound->aDateModified < rDT )
+else if( pFound->aDateModified != rDT )
 {
 FillGroup(pFound, pGlossaries);
 pFound->aDateModified = rDT;


[Libreoffice-commits] core.git: 2 commits - winaccessibility/source

2022-03-01 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/MAccessible.cxx |   28 ++--
 winaccessibility/source/service/AccObjectWinManager.cxx |6 +--
 2 files changed, 13 insertions(+), 21 deletions(-)

New commits:
commit a427a46db0fa453acabe10389e106441031b317e
Author: Michael Weghorn 
AuthorDate: Tue Mar 1 10:32:34 2022 +
Commit: Michael Weghorn 
CommitDate: Tue Mar 1 15:52:18 2022 +0100

wina11y: Use range-based for

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

diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx 
b/winaccessibility/source/service/AccObjectWinManager.cxx
index c405e6799d2b..bcde1ccf46a4 100644
--- a/winaccessibility/source/service/AccObjectWinManager.cxx
+++ b/winaccessibility/source/service/AccObjectWinManager.cxx
@@ -1057,11 +1057,9 @@ bool 
AccObjectWinManager::IsStateManageDescendant(XAccessible* pAccessible)
 if( !pRState.is() )
 return false;
 
-Sequence pStates = pRState->getStates();
-int count = pStates.getLength();
-for( int iIndex = 0;iIndex < count;iIndex++ )
+for (sal_Int16 nState : pRState->getStates())
 {
-if (pStates[iIndex] == 
AccessibleStateType::MANAGES_DESCENDANTS)
+if (nState == AccessibleStateType::MANAGES_DESCENDANTS)
 return true;
 }
 }
commit 45ae2fb7a7de4da4c3d6c7c359aaf92ccf0688a2
Author: Michael Weghorn 
AuthorDate: Tue Mar 1 10:27:11 2022 +
Commit: Michael Weghorn 
CommitDate: Tue Mar 1 15:52:04 2022 +0100

wina11y: Use more range-based for

And use const reference to css::style::TabStop instead of
creating a copy.

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

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx 
b/winaccessibility/source/UAccCOM/MAccessible.cxx
index a24536c8f36f..56542b10028f 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -2712,43 +2712,37 @@ OUString CMAccessible::get_StringFromAny(Any const & 
pAny)
 
 OUStringBuffer pString;
 
-int count = val.getLength();
+for (const OUString& rElem : val)
+pString.append(rElem);
 
-for( int iIndex = 0;iIndex < count;iIndex++ )
-{
-pString.append(val[iIndex]);
-}
 return pString.makeStringAndClear();
 }
 else if (pAny.getValueType() == cppu::UnoType>::get())
 {
 Sequence < css::style::TabStop > val;
 pAny >>= val;
-int count = val.getLength();
 
 OUStringBuffer buf;
-for( int iIndex = 0;iIndex < count;iIndex++ )
+for (const css::style::TabStop& rSingleVal : val)
 {
-css::style::TabStop sigleVal = val[iIndex];
-
 buf.append("Position=");
-buf.append(sigleVal.Position);
+buf.append(rSingleVal.Position);
 buf.append(",TabAlign=");
-buf.append(sal_Int32(sigleVal.Alignment));
+buf.append(sal_Int32(rSingleVal.Alignment));
 buf.append(",");
 
 buf.append("DecimalChar=");
-if(sigleVal.DecimalChar==';' || sigleVal.DecimalChar == 
':' || sigleVal.DecimalChar == ',' ||
-sigleVal.DecimalChar == '=' || sigleVal.DecimalChar == 
'\\')
+if (rSingleVal.DecimalChar==';' || rSingleVal.DecimalChar 
== ':' || rSingleVal.DecimalChar == ',' ||
+rSingleVal.DecimalChar == '=' || 
rSingleVal.DecimalChar == '\\')
 buf.append('\\');
-buf.append(sigleVal.DecimalChar);
+buf.append(rSingleVal.DecimalChar);
 buf.append(",");
 
 buf.append("FillChar=");
-if(sigleVal.FillChar==';' || sigleVal.FillChar == ':' || 
sigleVal.FillChar == ',' ||
-sigleVal.FillChar == '=' || sigleVal.FillChar == '\\')
+if (rSingleVal.FillChar==';' || rSingleVal.FillChar == ':' 
|| rSingleVal.FillChar == ',' ||
+rSingleVal.FillChar == '=' || rSingleVal.FillChar == 
'\\')
 buf.append('\\');
-buf.append(sigleVal.FillChar);
+buf.append(rSingleVal.FillChar);
 buf.append(",");
 }
 return buf.makeStringAndClear();


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

2022-03-01 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/UAccCOM/AccEditableText.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 774364243b5541328aa633d7ae535fa4ae716105
Author: Michael Weghorn 
AuthorDate: Tue Mar 1 10:16:20 2022 +
Commit: Michael Weghorn 
CommitDate: Tue Mar 1 15:51:43 2022 +0100

wina11y: Use 'std::vector::empty()' instead of 'std::vector::size() == 0'

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

diff --git a/winaccessibility/source/UAccCOM/AccEditableText.cxx 
b/winaccessibility/source/UAccCOM/AccEditableText.cxx
index a953eacf1334..1e0343b9fcb5 100644
--- a/winaccessibility/source/UAccCOM/AccEditableText.cxx
+++ b/winaccessibility/source/UAccCOM/AccEditableText.cxx
@@ -397,11 +397,11 @@ void 
CAccEditableText::get_AnyFromOLECHAR(std::u16string_view ouName, const OUSt
 
 
 // Dump into Sequence.
-int iSeqLen = (vecTabStop.size() == 0) ? 1 : vecTabStop.size();
+int iSeqLen = vecTabStop.empty() ? 1 : vecTabStop.size();
 Sequence< css::style::TabStop > seqTabStop(iSeqLen);
 auto pseqTabStop = seqTabStop.getArray();
 
-if(vecTabStop.size() != 0)
+if (!vecTabStop.empty())
 {
 // Dump every element.
 for(int i = 0; i < iSeqLen; i ++)


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

2022-03-01 Thread Michael Weghorn (via logerrit)
 winaccessibility/source/service/AccObject.cxx |   23 +--
 1 file changed, 5 insertions(+), 18 deletions(-)

New commits:
commit df80ed941621da16459c16eae04f73300a606c9b
Author: Michael Weghorn 
AuthorDate: Tue Mar 1 10:05:41 2022 +
Commit: Michael Weghorn 
CommitDate: Tue Mar 1 15:51:27 2022 +0100

wina11y: Use range-based for

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

diff --git a/winaccessibility/source/service/AccObject.cxx 
b/winaccessibility/source/service/AccObject.cxx
index 87556090941f..d2862577ffb2 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -432,14 +432,8 @@ OUString AccObject::GetMAccessibleValueFromAny(Any pAny)
 Sequence< OUString > val;
 if (pAny >>= val)
 {
-
-int count = val.getLength();
-
-for( int iIndex = 0;iIndex < count;iIndex++ )
-{
-strValue += val[iIndex];
-}
-
+for (const OUString& rElem : val)
+strValue += rElem;
 }
 }
 else if(pAny.getValueType() == cppu::UnoType::get())
@@ -1052,19 +1046,12 @@ void AccObject::GetExpandedState( sal_Bool* 
isExpandable, sal_Bool* isExpanded)
 return;
 }
 
-Sequence pStates = pRState->getStates();
-int count = pStates.getLength();
-
-for( int iIndex = 0;iIndex < count;iIndex++ )
+for (sal_Int16 nState : pRState->getStates())
 {
-if( EXPANDED == pStates[iIndex]  )
-{
+if (nState == EXPANDED)
 *isExpanded = true;
-}
-else if( EXPANDABLE == pStates[iIndex]  )
-{
+else if (nState == EXPANDABLE)
 *isExpandable = true;
-}
 }
 }
 


[Libreoffice-commits] core.git: include/unotest unotest/source xmlsecurity/qa

2022-03-01 Thread Mike Kaganski (via logerrit)
 include/unotest/macros_test.hxx |1 +
 unotest/source/cpp/macros_test.cxx  |   12 +++-
 xmlsecurity/qa/unit/signing/signing.cxx |2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 9888bb3dbb7ca558e0b440314bdb24bc60843bb0
Author: Mike Kaganski 
AuthorDate: Tue Mar 1 11:50:29 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Mar 1 15:17:55 2022 +0100

Fix the test failing when invalid certificate is in cert store

testSigningMultipleTimes_ODT was failing for me locally because of
an expired certificate present in my store.

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

diff --git a/include/unotest/macros_test.hxx b/include/unotest/macros_test.hxx
index c6c810ad108b..6a476cf0ec40 100644
--- a/include/unotest/macros_test.hxx
+++ b/include/unotest/macros_test.hxx
@@ -93,6 +93,7 @@ public:
 void setUpNssGpg(const test::Directories& rDirectories, const OUString& 
rTestName);
 void tearDownNssGpg();
 
+static bool IsValid(const 
css::uno::Reference& cert);
 static css::uno::Reference 
GetValidCertificate(
 const 
css::uno::Sequence>& certs);
 
diff --git a/unotest/source/cpp/macros_test.cxx 
b/unotest/source/cpp/macros_test.cxx
index 81738dc6dafe..f30cbcdac3ea 100644
--- a/unotest/source/cpp/macros_test.cxx
+++ b/unotest/source/cpp/macros_test.cxx
@@ -172,14 +172,16 @@ void MacrosTest::tearDownNssGpg()
 #endif
 }
 
+bool MacrosTest::IsValid(const 
css::uno::Reference& cert)
+{
+return DateTime(DateTime::SYSTEM)
+.IsBetween(cert->getNotValidBefore(), cert->getNotValidAfter());
+}
+
 css::uno::Reference 
MacrosTest::GetValidCertificate(
 const 
css::uno::Sequence>& certs)
 {
-auto it
-= std::find_if(certs.begin(), certs.end(), [now = 
DateTime(DateTime::SYSTEM)](auto& xCert) {
-  return now.IsBetween(xCert->getNotValidBefore(), 
xCert->getNotValidAfter());
-  });
-if (it != certs.end())
+if (auto it = std::find_if(certs.begin(), certs.end(), IsValid); it != 
certs.end())
 return *it;
 return {};
 }
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx 
b/xmlsecurity/qa/unit/signing/signing.cxx
index 38643a0b3098..90d0edf8973e 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -159,7 +159,7 @@ SigningTest::getCertificate(DocumentSignatureManager& 
rSignatureManager,
 {
 auto pCertificate = 
dynamic_cast(xCertificate.get());
 CPPUNIT_ASSERT(pCertificate);
-if (pCertificate->getSignatureMethodAlgorithm() == eAlgo)
+if (pCertificate->getSignatureMethodAlgorithm() == eAlgo && 
IsValid(xCertificate))
 return xCertificate;
 }
 return uno::Reference();


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

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/ttcr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c8ce8980b35edf394d72848fa777de49c37513e1
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 09:35:34 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 15:09:13 2022 +0100

ofz: glyph data must be at least 10 bytes long to be useful

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

diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index f923e344cda3..40729ffd101d 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -1274,7 +1274,7 @@ static void ProcessTables(TrueTypeCreator *tt)
 
 /* printf("IDs: %d %d.\n", gd->glyphID, gd->newID); */
 
-if (gd->nbytes != 0) {
+if (gd->nbytes >= 10) {
 sal_Int16 z = GetInt16(gd->ptr, 2);
 if (z < xMin) xMin = z;
 


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

2022-03-01 Thread Caolán McNamara (via logerrit)
 hwpfilter/source/hwpread.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 8b95df7d8d4c4b651e169c73508fcd86833229ea
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 10:18:51 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 15:08:47 2022 +0100

ofz: don't register style if hbox load failed

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

diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index 3c06515e563b..85dd89a32f88 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -236,7 +236,6 @@ bool TxtBox::Read(HWPFile & hwpf)
 hwpf.Read2b(&option, 1);
 hwpf.Read2b(&ctrl_ch, 1);
 hwpf.Read2b(style.margin, 12);
-hwpf.AddFBoxStyle(&style);
 hwpf.Read2b(&box_xs, 1);
 hwpf.Read2b(&box_ys, 1);
 hwpf.Read2b(&cap_xs, 1);
@@ -365,7 +364,10 @@ bool TxtBox::Read(HWPFile & hwpf)
 else
 m_pTable = nullptr;
 
-return !hwpf.State();
+bSuccess = !hwpf.State();
+if (bSuccess)
+hwpf.AddFBoxStyle(&style);
+return bSuccess;
 }
 
 namespace
@@ -509,12 +511,14 @@ bool Picture::Read(HWPFile & hwpf)
 style.boxtype = 'G';
 else
 style.boxtype = 'D';
-hwpf.AddFBoxStyle(&style);
 
 // caption
 hwpf.ReadParaList(caption);
 
-return !hwpf.State();
+bool bSuccess = !hwpf.State();
+if (bSuccess)
+hwpf.AddFBoxStyle(&style);
+return bSuccess;
 }
 
 // line(15)
@@ -551,7 +555,6 @@ bool Line::Read(HWPFile & hwpf)
 hwpf.Read2b(&option, 1);
 hwpf.Read2b(&ctrl_ch, 1);
 hwpf.Read2b(style.margin, 12);
-hwpf.AddFBoxStyle(&style);
 hwpf.Read2b(&box_xs, 1);
 hwpf.Read2b(&box_ys, 1);
 hwpf.Read2b(&cap_xs, 1);
@@ -580,7 +583,10 @@ bool Line::Read(HWPFile & hwpf)
 hwpf.Read2b(&color, 1);
 style.xpos = width;
 
-return !hwpf.State();
+bool bSuccess = !hwpf.State();
+if (bSuccess)
+hwpf.AddFBoxStyle(&style);
+return bSuccess;
 }
 
 // hidden(15)


[Libreoffice-commits] core.git: tsan-suppress.txt

2022-03-01 Thread Noel Grandin (via logerrit)
 tsan-suppress.txt |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit eb968c4f6bda49eb97014aec5e395232545935ab
Author: Noel Grandin 
AuthorDate: Tue Mar 1 11:09:49 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 14:46:30 2022 +0100

more tsan suppressions

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

diff --git a/tsan-suppress.txt b/tsan-suppress.txt
index ccae30ac767c..ca6d17dc3104 100644
--- a/tsan-suppress.txt
+++ b/tsan-suppress.txt
@@ -25,9 +25,14 @@ race:__vsnprintf_chk
 # right now, I'm not interested in deadlocks at all, too many false+
 deadlock:
 
-# This is checking  SAL_STRING_IS_STATIC, which is safe because that is 
written at compile time
+# This is checking SAL_STRING_IS_STATIC, which is safe because that is written 
at compile time.
+# Depending on the optimisation/debug level, the call stack may have different 
leaves, hence
+# specifying this in more than one way.
 race:rtl::str::acquire<_rtl_uString>
 race:rtl::str::release<_rtl_uString>
+race:rtl_uString_acquire
+race:rtl_uString_release
+race:rtl_uString_assign
 
 # I've convinced myself this is a false+, caused by ping-ponging the buffer 
between two
 # threads, but I might be wrong


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa

2022-03-01 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/layout/layout.cxx |   34 +-
 1 file changed, 13 insertions(+), 21 deletions(-)

New commits:
commit b98994620994fedcc31602e60be07a72fb9e83e1
Author: Mike Kaganski 
AuthorDate: Tue Mar 1 10:12:15 2022 +0300
Commit: Xisco Fauli 
CommitDate: Tue Mar 1 14:30:55 2022 +0100

Fix flaky test on Win64

Obviously the left values are unstable; they were excluded on macOS,
and they fail exactly on the same lines for me locally on Win64 build.
So just test that the values are restored after delete and undo.

Change-Id: I63dc50d223edb052a0ada200189cef94c2e0f8e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130738
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
(cherry picked from commit da77aec27e3121c895a6c6c287225216489cc8bc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130769
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 79e06e3e3c17..0c7a4dc13ff0 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -1278,29 +1278,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239)
 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf143239-1-min.odt");
 SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
 
+// These are unstable on macOS and Win64 builds,
+// so only test that they restore original values for now
+OUString p2txt1Left, p2txt2Left, p3txt1Left;
+
 {
 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "18540");
-#ifndef MACOSX
-assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3559");
-#endif
+p2txt1Left
+= getXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left");
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top",
 "23894");
-#ifndef MACOSX
-assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left",
-"1964");
-#endif
+p2txt2Left
+= getXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left");
 assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "35662");
-#ifndef MACOSX
-assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3129");
-#endif
+p3txt1Left
+= getXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left");
 assertXPath(pXmlDoc, "/root/page", 3);
 discardDumpedLayout();
 }
@@ -1316,24 +1314,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239)
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "18540");
-#ifndef MACOSX
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3559");
-#endif
+p2txt1Left);
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top",
 "23894");
-#ifndef MACOSX
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left",
-"1964");
-#endif
+p2txt2Left);
 assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "35662");
-#ifndef MACOSX
 assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3129");
-#endif
+p3txt1Left);
 assertXPath(pXmlDoc, "/root/page", 3);
 discardDumpedLayout();
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/qa sw/source

2022-03-01 Thread László Németh (via logerrit)
 sw/qa/extras/uiwriter/uiwriter3.cxx |   46 ++
 sw/source/core/doc/docnum.cxx   |4 +
 sw/source/core/frmedt/fetab.cxx |   92 ++--
 3 files changed, 126 insertions(+), 16 deletions(-)

New commits:
commit dc3f29bca53ef365ec12694feefe76f0e81eccfa
Author: László Németh 
AuthorDate: Mon Feb 28 12:35:27 2022 +0100
Commit: László Németh 
CommitDate: Tue Mar 1 14:09:57 2022 +0100

tdf#146962 sw: hide deleted row at deletion in Hide Changes

In Hide Changes mode, deleting table rows with change tracking
wasn't applied on the table layout immediately, only using Show
Changes and Hide Changes again. Now the deleted row removed from
the table instead leaving an empty table row (except the last
row of a wholly deleted table).

See also commit 95213407dfcbf34056037d60243ff915340d1a2e
"tdf#146622 sw crash fix: don't delete already deleted rows".

Change-Id: I864957cafa38e631a65db0670c7b566cb689f4cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130701
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit a74c51025fa4519caaf461492e4ed8e68bd34885)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130685
Tested-by: László Németh 

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index d2123c33b20c..a7db089432e0 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace
 {
@@ -1943,6 +1944,51 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146622)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146962)
+{
+// load a 2-row table, set Hide Changes mode and delete the first row with 
change tracking
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf116789.fodt");
+CPPUNIT_ASSERT(pDoc);
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+CPPUNIT_ASSERT(pWrtShell);
+
+// enable redlining
+dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+   pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+// hide changes
+dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines());
+
+dispatchCommand(mxComponent, ".uno:DeleteRows", {});
+
+// Without the fix in place, the deleted row would be visible
+
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// This was 2
+assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1);
+
+// check it in Show Changes mode
+
+dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+CPPUNIT_ASSERT(!pWrtShell->GetLayout()->IsHideRedlines());
+
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+// 2 rows are visible now
+assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2);
+
+// check it in Hide Changes mode again
+
+dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+CPPUNIT_ASSERT(pWrtShell->GetLayout()->IsHideRedlines());
+
+discardDumpedLayout();
+pXmlDoc = parseLayoutDump();
+// only a single row is visible again
+assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1);
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135014)
 {
 createSwDoc();
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 12b23c2fbb42..2cbfb7a6a4df 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -1446,7 +1446,9 @@ GotoPrevLayoutTextFrame(SwNodeIndex & rIndex, SwRootFrame 
const*const pLayout)
 {
 if (rIndex.GetNode().IsTextNode())
 {
-if (rIndex.GetNode().GetRedlineMergeFlag() != SwNode::Merge::None)
+if (rIndex.GetNode().GetRedlineMergeFlag() != SwNode::Merge::None 
&&
+// not a tracked row deletion in Hide Changes mode
+rIndex.GetNode().GetTextNode()->getLayoutFrame(pLayout) )
 {
 rIndex = 
*static_cast(rIndex.GetNode().GetTextNode()->getLayoutFrame(pLayout))->GetMergedPara()->pFirstNode;
 }
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index ec9968271d3d..7bb2ff5edc68 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -328,32 +328,41 @@ bool SwFEShell::DeleteRow(bool bCompleteTable)
 
 CurrShell aCurr( this );
 
-// tracked deletion: remove only textbox content,
-// and set IsNoTracked table line property to false
-if ( GetDoc()->GetDocShell()->IsChangeRecording() )
-{
-// all rows have already had tracked row change in the table selection
-if ( !SwDoc::HasRowNotTracked( *getShellCursor( false ) ) )
-return false;
+bool bRecordChanges = GetDoc()->GetDocShell()->IsChangeRecording();
+ 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - oox/inc oox/source sd/qa

2022-03-01 Thread Tünde Tóth (via logerrit)
 oox/inc/drawingml/textparagraph.hxx|2 ++
 oox/source/drawingml/textbody.cxx  |   18 +-
 oox/source/drawingml/textparagraph.cxx |   15 ---
 sd/qa/unit/data/pptx/tdf103800.pptx|binary
 sd/qa/unit/import-tests.cxx|   17 +
 5 files changed, 40 insertions(+), 12 deletions(-)

New commits:
commit 366954ef0acce4952c4a8945e43a531dc20659fa
Author: Tünde Tóth 
AuthorDate: Fri Feb 18 10:30:54 2022 +0100
Commit: László Németh 
CommitDate: Tue Mar 1 14:08:41 2022 +0100

tdf#103800 PPTX shape import: fix regression of text color

defined by list styles. Properties in a:lstStyle of p:txBody
should take precedence over the same properties defined in
a:fontRef of style elements.

Change-Id: I02cc886eb9eba94f49fe413a63bf7c46c9e3c127
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130237
Tested-by: László Németh 
Reviewed-by: László Németh 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130712
Tested-by: Jenkins

diff --git a/oox/inc/drawingml/textparagraph.hxx 
b/oox/inc/drawingml/textparagraph.hxx
index 021434d6a5fb..1f43249372a5 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -63,6 +63,7 @@ public:
 
 TextCharacterProperties  getCharacterStyle(
 const TextCharacterProperties& rTextStyleProperties,
+const TextListStyle& rMasterTextListStyle,
 const TextListStyle& rTextListStyle) const;
 
 TextParagraphProperties*  getParagraphStyle(
@@ -73,6 +74,7 @@ public:
 const css::uno::Reference < 
css::text::XText > & xText,
 const css::uno::Reference < 
css::text::XTextCursor > &xAt,
 const TextCharacterProperties& 
rTextStyleProperties,
+const TextListStyle& rMasterTextListStyle,
 const TextListStyle& rTextListStyle,
 bool bFirst,
 float nDefaultCharHeight) const;
diff --git a/oox/source/drawingml/textbody.cxx 
b/oox/source/drawingml/textbody.cxx
index f4da6886a69c..41a237e97cee 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -57,16 +57,15 @@ void TextBody::insertAt(
 const TextCharacterProperties& rTextStyleProperties,
 const TextListStylePtr& pMasterTextListStylePtr ) const
 {
-TextListStyle aCombinedTextStyle;
-aCombinedTextStyle.apply( *pMasterTextListStylePtr );
-aCombinedTextStyle.apply( maTextListStyle );
+TextListStyle aMasterTextStyle(*pMasterTextListStylePtr);
 
 Reference xPropertySet(xAt, UNO_QUERY);
 float nCharHeight = 
xPropertySet->getPropertyValue("CharHeight").get();
 size_t nIndex = 0;
 for (auto const& paragraph : maParagraphs)
 {
-paragraph->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, 
aCombinedTextStyle, (nIndex == 0), nCharHeight );
+paragraph->insertAt(rFilterBase, xText, xAt, rTextStyleProperties, 
aMasterTextStyle,
+maTextListStyle, (nIndex == 0), nCharHeight);
 ++nIndex;
 }
 }
@@ -127,15 +126,16 @@ void TextBody::ApplyStyleEmpty(
 return;
 
 // Apply character properties
-TextListStyle aCombinedTextStyle;
-aCombinedTextStyle.apply( *pMasterTextListStylePtr );
-aCombinedTextStyle.apply( maTextListStyle );
-
 PropertySet aPropSet(xText);
-TextCharacterProperties 
aTextCharacterProps(maParagraphs[0]->getCharacterStyle(rTextStyleProperties, 
aCombinedTextStyle));
+TextCharacterProperties 
aTextCharacterProps(maParagraphs[0]->getCharacterStyle(
+rTextStyleProperties, *pMasterTextListStylePtr, maTextListStyle));
 aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase);
 
 // Apply paragraph properties
+TextListStyle aCombinedTextStyle;
+aCombinedTextStyle.apply(*pMasterTextListStylePtr);
+aCombinedTextStyle.apply(maTextListStyle);
+
 TextParagraphProperties* pTextParagraphStyle = 
maParagraphs[0]->getParagraphStyle(aCombinedTextStyle);
 if (pTextParagraphStyle)
 {
diff --git a/oox/source/drawingml/textparagraph.cxx 
b/oox/source/drawingml/textparagraph.cxx
index 9e4f309e9391..f91ee279bb3b 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -48,14 +48,18 @@ TextParagraph::~TextParagraph()
 
 TextCharacterProperties TextParagraph::getCharacterStyle (
 const TextCharacterProperties& rTextStyleProperties,
+const TextListStyle& rMasterTextListStyle,
 const TextListStyle& rTextListStyle) const
 {
+const TextParagraphProperties* pMasterTextParagraphStyle = 
getParagraphStyle(rMasterTextListStyle);
 const TextParagraphProperties* pTextParagraphStyle = 
getParagraphStyle(rTextListStyle);
 
 TextCharacterPrope

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - svx/source

2022-03-01 Thread Miklos Vajna (via logerrit)
 svx/source/unodraw/unoshap2.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 02b34caefc9fbcbdc2db45dba942783d384a5832
Author: Miklos Vajna 
AuthorDate: Tue Mar 1 08:34:32 2022 +0100
Commit: Michael Meeks 
CommitDate: Tue Mar 1 13:46:14 2022 +0100

svx: the SdrObject of SvxGraphicObject can be nullptr

Crashreport:

Graphic::GetType() const
vcl/inc/impgraph.hxx:122
SvxGraphicObject::getPropertyValueImpl(rtl::OUString const&, 
SfxItemPropertySimpleEntry const*, com::sun::star::uno::Any&)
svx/source/unodraw/unoshap2.cxx:1466 (discriminator 1)
SvxShape::_getPropertyValue(rtl::OUString const&)
svx/source/unodraw/unoshape.cxx:1747
non-virtual thunk to SvxShape::getPropertyValue(rtl::OUString 
const&)
svx/source/unodraw/unoshape.cxx:1732

During SVG export of a selected shape.

Change-Id: I29b56d49b0c5418dfe8fec8491ac8667e5ade2ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130740
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
(cherry picked from commit 8311a2716924ad0bac7fc0a9e75279382a9553b0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130684

diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 688fd1b29ee6..19268527fc26 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1496,7 +1496,8 @@ bool SvxGraphicObject::getPropertyValueImpl( const 
OUString& rName, const SfxIte
 
 Reference xGraphic;
 auto pSdrGraphicObject = static_cast(GetSdrObject());
-if (pSdrGraphicObject->GetGraphicObject().GetType() != 
GraphicType::NONE)
+if (pSdrGraphicObject
+&& pSdrGraphicObject->GetGraphicObject().GetType() != 
GraphicType::NONE)
 xGraphic = pSdrGraphicObject->GetGraphic().GetXGraphic();
 rValue <<= xGraphic;
 break;


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

2022-03-01 Thread Tibor Nagy (via logerrit)
 oox/source/drawingml/customshapepresetdata.cxx |   67 +
 oox/source/drawingml/customshapes/oox-drawingml-cs-presets |   22 ++--
 sd/qa/unit/data/pptx/tdf147459.pptx|binary
 sd/qa/unit/data/xml/n820786_0.xml  |2 
 sd/qa/unit/data/xml/tdf109317_0.xml|3 
 sd/qa/unit/import-tests.cxx|   35 ++
 6 files changed, 118 insertions(+), 11 deletions(-)

New commits:
commit 744e6c0b758fefe6011f09860b44f03ab70fbcfe
Author: Tibor Nagy 
AuthorDate: Mon Feb 21 14:07:51 2022 +0100
Commit: László Németh 
CommitDate: Tue Mar 1 13:45:48 2022 +0100

tdf#147459 PPTX: add "glue points" to some basic shapes

(ellipse, triangle, right triangle, trapezoid,
parallelogram, diamond, pentagon, hexagon, heptagon,
octagon).

These glue points allow to add and use connectors
on basic shapes, e.g. by specifying 8 glue points on
outline of ellipses (and not 4 glue points only on
their bounding boxes).

Usage: insert a basic shape from the list above,
select it, and click on the icon Connectors to
show and use the new glue points on the outline of
the shape.

Note: PPTX import doesn't import connectors
connected to the glue points – only ODP export keeps
them for the planned editing, i.e. moving the connected
shapes without losing the connecting lines and arrows.

Change-Id: Iaef21ce8dc3f6677fa2fd6a484adf6d546e72ad1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130281
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/oox/source/drawingml/customshapepresetdata.cxx 
b/oox/source/drawingml/customshapepresetdata.cxx
index a80ddeacae21..ea1fcbb41362 100644
--- a/oox/source/drawingml/customshapepresetdata.cxx
+++ b/oox/source/drawingml/customshapepresetdata.cxx
@@ -507,6 +507,71 @@ void 
lcl_parsePathCoordinates(std::vector& rPath, const OS
 }
 }
 
+void lcl_parsePathGluePointsValues(std::vector& rPath, 
const OString& rValue)
+{
+std::vector aPairs;
+sal_Int32 nLevel = 0;
+sal_Int32 nStart = 0;
+for (sal_Int32 i = 0; i < rValue.getLength(); ++i)
+{
+if (rValue[i] == '{')
+{
+if (!nLevel)
+nStart = i;
+nLevel++;
+}
+else if (rValue[i] == '}')
+{
+nLevel--;
+if (!nLevel)
+aPairs.push_back(lcl_parseEnhancedCustomShapeParameterPair(
+rValue.copy(nStart + strlen("{ "), i - nStart - strlen(" 
},";
+}
+}
+
+beans::PropertyValue aPropertyValue;
+aPropertyValue.Name = "GluePoints";
+aPropertyValue.Value <<= comphelper::containerToSequence(aPairs);
+rPath.push_back(aPropertyValue);
+}
+
+void lcl_parsePathGluePoints(std::vector& rPath, const 
OString& rValue)
+{
+sal_Int32 nLevel = 0;
+bool bIgnore = false;
+sal_Int32 nStart = 0;
+for (sal_Int32 i = 0; i < rValue.getLength(); ++i)
+{
+if (rValue[i] == '{')
+{
+if (!nLevel)
+bIgnore = true;
+nLevel++;
+}
+else if (rValue[i] == '}')
+{
+nLevel--;
+if (!nLevel)
+bIgnore = false;
+}
+else if (rValue[i] == ',' && !bIgnore)
+{
+OString aToken = rValue.copy(nStart, i - nStart);
+static const char aExpectedPrefix[]
+= "Value = (any) { 
([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { ";
+if (aToken.startsWith(aExpectedPrefix))
+{
+aToken = aToken.copy(strlen(aExpectedPrefix),
+ aToken.getLength() - 
strlen(aExpectedPrefix) - strlen(" } }"));
+lcl_parsePathGluePointsValues(rPath, aToken);
+}
+else if (!aToken.startsWith("Name =") && 
!aToken.startsWith("Handle ="))
+SAL_WARN("oox", "lcl_parsePathGluePoints: unexpected token: " 
<< aToken);
+nStart = i + strlen(", ");
+}
+}
+}
+
 void lcl_parsePathSegmentValues(std::vector& rPath, 
const OString& rValue)
 {
 std::vector aSegments;
@@ -725,6 +790,8 @@ void lcl_parsePath(std::vector& 
rPath, const OString& rVal
 OString aToken = rValue.copy(nStart + strlen("{ "), i - nStart 
- strlen(" },"));
 if (aToken.startsWith("Name = \"Coordinates\""))
 lcl_parsePathCoordinates(rPath, aToken);
+else if (aToken.startsWith("Name = \"GluePoints\""))
+lcl_parsePathGluePoints(rPath, aToken);
 else if (aToken.startsWith("Name = \"Segments\""))
 lcl_parsePathSegments(rPath, aToken);
 else if (aToken.startsWith("Name = \"TextFrames\""))
diff --git a/oox/source/drawingml/customshapes/oox-drawingml-cs-presets 
b/oox/source/

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source

2022-03-01 Thread Mert Tumer (via logerrit)
 sc/source/ui/docshell/docsh.cxx |   29 ++---
 1 file changed, 18 insertions(+), 11 deletions(-)

New commits:
commit 8363d389fa70fc6a7ab16ce5b71e4ed9c815faa6
Author: Mert Tumer 
AuthorDate: Wed Dec 29 16:34:38 2021 +0300
Commit: Henry Castro 
CommitDate: Tue Mar 1 13:41:09 2022 +0100

LOK android: Fix csv sheet name becomes temp name

Signed-off-by: Mert Tumer 
Change-Id: If43d7a995a5e53734fc7ecdcbf9b750b4886dc45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127583
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 2bf345635645..551ab8d03f32 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -132,6 +132,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace com::sun::star;
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::lang::XMultiServiceFactory;
@@ -1305,17 +1307,22 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 sc::SetFormulaDirtyContext aCxt;
 m_aDocument.SetAllFormulasDirty(aCxt);
 
-// The same resulting name has to be handled in
-// ScExternalRefCache::initializeDoc() and related, hence
-// pass 'true' for RenameTab()'s bExternalDocument for a
-// composed name so ValidTabName() will not be checked,
-// which could veto the rename in case it contained
-// characters that Excel does not handle. If we wanted to
-// change that then it needed to be handled in all
-// corresponding places of the external references
-// manager/cache. Likely then we'd also need a method to
-// compose a name excluding such characters.
-m_aDocument.RenameTab( 0, INetURLObject( 
rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
+bool bIsMobile = comphelper::LibreOfficeKit::isActive() && 
SfxViewShell::Current()
+&& SfxViewShell::Current()->isLOKMobilePhone();
+// for mobile case, we use a copy of the original document 
and give it a temporary name before editing
+// Therefore, the sheet name becomes ugly, long and 
nonsensical.
+if (!bIsMobile)
+// The same resulting name has to be handled in
+// ScExternalRefCache::initializeDoc() and related, 
hence
+// pass 'true' for RenameTab()'s bExternalDocument for 
a
+// composed name so ValidTabName() will not be checked,
+// which could veto the rename in case it contained
+// characters that Excel does not handle. If we wanted 
to
+// change that then it needed to be handled in all
+// corresponding places of the external references
+// manager/cache. Likely then we'd also need a method 
to
+// compose a name excluding such characters.
+m_aDocument.RenameTab( 0, INetURLObject( 
rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
 
 bOverflowRow = aImpEx.IsOverflowRow();
 bOverflowCol = aImpEx.IsOverflowCol();


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

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/sft.cxx |   45 +++---
 1 file changed, 34 insertions(+), 11 deletions(-)

New commits:
commit 5911b25000f443d8ab39265e356628b8117f8a73
Author: Caolán McNamara 
AuthorDate: Tue Mar 1 09:15:40 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 13:25:36 2022 +0100

ofz: measure legal range from glyph offset, not table start

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

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index f59b571eb329..919f599d061e 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -381,11 +381,11 @@ static int GetSimpleTTOutline(AbstractTrueTypeFont const 
*ttf, sal_uInt32 glyphI
 
 sal_uInt16 instLen = GetUInt16(ptr, 10 + numberOfContours*2);
 sal_uInt32 nOffset = 10 + 2 * numberOfContours + 2 + instLen;
-if (nOffset > nTableSize)
+if (nOffset > nMaxGlyphSize)
 return 0;
 const sal_uInt8* p = ptr + nOffset;
 
-const sal_uInt32 nBytesRemaining = nTableSize - nOffset;
+const sal_uInt32 nBytesRemaining = nMaxGlyphSize - nOffset;
 const sal_uInt32 palen = lastPoint+1;
 
 //at a minimum its one byte per entry
@@ -639,8 +639,8 @@ static int GetCompoundTTOutline(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID, C
  */
 static int GetTTGlyphOutline(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, 
ControlPoint **pointArray, TTGlyphMetrics *metrics, std::vector< sal_uInt32 >* 
glyphlist)
 {
-sal_uInt32 nSize;
-const sal_uInt8 *table = ttf->table(O_glyf, nSize);
+sal_uInt32 glyflength;
+const sal_uInt8 *table = ttf->table(O_glyf, glyflength);
 sal_Int16 numberOfContours;
 int res;
 *pointArray = nullptr;
@@ -651,14 +651,26 @@ static int GetTTGlyphOutline(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID, Cont
 if (glyphID >= ttf->glyphCount())
 return -1;
 
-const sal_uInt8* ptr = table + ttf->glyphOffset(glyphID);
-int length = ttf->glyphOffset(glyphID + 1) - ttf->glyphOffset(glyphID);
+sal_uInt32 nNextOffset = ttf->glyphOffset(glyphID + 1);
+if (nNextOffset > glyflength)
+return -1;
 
+sal_uInt32 nOffset = ttf->glyphOffset(glyphID);
+if (nOffset > nNextOffset)
+return -1;
+
+int length = nNextOffset - nOffset;
 if (length == 0) {  /*- empty glyphs 
still have hmtx and vmtx metrics values */
 if (metrics) GetMetrics(ttf, glyphID, metrics);
 return 0;
 }
 
+const sal_uInt8* ptr = table + nOffset;
+const sal_uInt32 nMaxGlyphSize = glyflength - nOffset;
+
+if (nMaxGlyphSize < 2)
+return -1;
+
 numberOfContours = GetInt16(ptr, 0);
 
 if (numberOfContours >= 0)
@@ -1389,16 +1401,27 @@ int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, 
sal_uInt32 glyphID, std::vec
 if (glyphID >= ttf->glyphCount())
 return 0;
 
-sal_uInt32 nSize;
-const sal_uInt8* glyf = ttf->table(O_glyf, nSize);
-const sal_uInt8* ptr = glyf + ttf->glyphOffset(glyphID);
-const sal_uInt8* nptr = glyf + ttf->glyphOffset(glyphID + 1);
+sal_uInt32 glyflength;
+const sal_uInt8* glyf = ttf->table(O_glyf, glyflength);
+
+sal_uInt32 nNextOffset = ttf->glyphOffset(glyphID + 1);
+if (nNextOffset > glyflength)
+return 0;
+
+sal_uInt32 nOffset = ttf->glyphOffset(glyphID);
+if (nOffset > nNextOffset)
+return 0;
+
+const sal_uInt8* ptr = glyf + nOffset;
+const sal_uInt8* nptr = glyf + nNextOffset;
 if (nptr <= ptr)
 return 0;
 
 glyphlist.push_back( glyphID );
 
-if (GetInt16(ptr, 0) == -1) {
+const sal_uInt32 nMaxGlyphSize = glyflength - nOffset;
+
+if (nMaxGlyphSize >= 10 && GetInt16(ptr, 0) == -1) {
 sal_uInt16 flags, index;
 ptr += 10;
 do {


[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: sax/source

2022-03-01 Thread Deep17 (via logerrit)
 sax/source/fastparser/fastparser.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit f63a6f2e396fa41ed1338dcec874e06159cafa9f
Author: Deep17 
AuthorDate: Sun Feb 27 14:55:58 2022 -0500
Commit: Ilmari Lauhakangas 
CommitDate: Tue Mar 1 13:03:05 2022 +0100

tdf#145538 - Use range based for loops

Change-Id: I489a13330501ddfa1556a523f8334460505c0e61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130658
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sax/source/fastparser/fastparser.cxx 
b/sax/source/fastparser/fastparser.cxx
index 9effb82c348c..beb30443ba02 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -674,11 +674,11 @@ FastSaxParserImpl::~FastSaxParserImpl()
 {
 if( mxDocumentLocator.is() )
 mxDocumentLocator->dispose();
-for ( size_t i = 0; i < m_TemporalEntities.size(); ++i )
+for (const auto& entity : m_TemporalEntities)
 {
-if (!m_TemporalEntities[i])
+if (!entity)
 continue;
-xmlNodePtr pPtr = reinterpret_cast(m_TemporalEntities[i]);
+xmlNodePtr pPtr = reinterpret_cast(entity);
 xmlUnlinkNode(pPtr);
 xmlFreeNode(pPtr);
 }


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

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/sft.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 2ca987b1a9bcb6bf248d31972b3035fb5e302896
Author: Caolán McNamara 
AuthorDate: Mon Feb 28 21:12:07 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 12:44:38 2022 +0100

ofz: measure maximum possible contours

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

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index f101670d9ab5..f59b571eb329 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -348,7 +348,13 @@ static int GetSimpleTTOutline(AbstractTrueTypeFont const 
*ttf, sal_uInt32 glyphI
 if (glyphID >= ttf->glyphCount())
 return 0;
 
-const sal_uInt8* ptr = table + ttf->glyphOffset(glyphID);
+sal_uInt32 nGlyphOffset = ttf->glyphOffset(glyphID);
+if (nGlyphOffset > nTableSize)
+return 0;
+
+const sal_uInt8* ptr = table + nGlyphOffset;
+const sal_uInt32 nMaxGlyphSize = nTableSize - nGlyphOffset;
+
 const sal_Int16 numberOfContours = GetInt16(ptr, 
GLYF_numberOfContours_offset);
 if( numberOfContours <= 0 ) /*- glyph is not simple */
 return 0;
@@ -363,7 +369,7 @@ static int GetSimpleTTOutline(AbstractTrueTypeFont const 
*ttf, sal_uInt32 glyphI
 
 /* determine the last point and be extra safe about it. But probably this 
code is not needed */
 sal_uInt16 lastPoint=0;
-const sal_Int32 nMaxContours = (nTableSize - 10)/2;
+const sal_Int32 nMaxContours = (nMaxGlyphSize - 10)/2;
 if (numberOfContours > nMaxContours)
 return 0;
 for (i=0; i

[Libreoffice-commits] core.git: tsan-suppress.txt

2022-03-01 Thread Noel Grandin (via logerrit)
 tsan-suppress.txt |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 2195e03808864a8d5cb3e130f62759684a19d012
Author: Noel Grandin 
AuthorDate: Mon Dec 27 22:44:46 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 11:41:09 2022 +0100

tsan more suppression

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

diff --git a/tsan-suppress.txt b/tsan-suppress.txt
index 66153afa6894..ccae30ac767c 100644
--- a/tsan-suppress.txt
+++ b/tsan-suppress.txt
@@ -54,3 +54,4 @@ race:slab_allocator_alloc_chunk
 race:g_source_destroy_internal
 race:g_source_unref_internal
 race:g_task_finalize
+race:g_socket_send_message_with_timeout


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

2022-03-01 Thread Hossein (via logerrit)
 sc/source/core/data/bcaslot.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit acc008c6600070837599c994e5552e66ec85c18c
Author: Hossein 
AuthorDate: Thu Feb 10 23:36:15 2022 +0100
Commit: Hossein 
CommitDate: Tue Mar 1 11:40:15 2022 +0100

Add asserts to make sure the calculation is correct

On Linux/gcc (Ubuntu 10.3.0-1ubuntu1~20.04), I was getting this
warning:

sc/source/core/data/bcaslot.cxx:647:25: warning: comparison of
unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
  647 | assert(slot >= 0 && slot < mnBcaSlots);
  |~^~~~

slot variable is of type SCSIZE, which is defined as size_t in
sc/inc/address.hxx.

This is fixed in 405a7a09558ad17642808cc3739ab202f86bea0c. To make
sure the calculation of slot is OK, I have added these 2 asserts:

assert(nRow >= rSD.nStartRow);
assert(nCol >= rSD.nStartCol);

Change-Id: I731c1b6e913febde51fc16042d32c35950e707db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129805
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 65bc2600d475..09493963469c 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -639,6 +639,8 @@ inline SCSIZE ScBroadcastAreaSlotMachine::ComputeSlotOffset(
 {
 if (nRow < rSD.nStopRow && nCol < rSD.nStopCol)
 {
+assert(nRow >= rSD.nStartRow);
+assert(nCol >= rSD.nStartCol);
 SCSIZE slot = rSD.nCumulatedRow
 + static_cast(nRow - rSD.nStartRow) / rSD.nSliceRow
 + rSD.nCumulatedCol


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

2022-03-01 Thread Noel Grandin (via logerrit)
 sc/source/ui/view/auditsh.cxx  |   13 +---
 sc/source/ui/view/cellsh1.cxx  |   35 +---
 sc/source/ui/view/cellsh2.cxx  |  112 +++--
 sc/source/ui/view/cellsh3.cxx  |   29 +-
 sc/source/ui/view/editsh.cxx   |   10 +--
 sc/source/ui/view/formatsh.cxx |   72 +++---
 sc/source/ui/view/output2.cxx  |   20 +++
 sc/source/ui/view/preview.cxx  |   10 +--
 sc/source/ui/view/prevwsh.cxx  |   12 ++--
 sc/source/ui/view/printfun.cxx |8 --
 sc/source/ui/view/tabvwsha.cxx |6 --
 sc/source/ui/view/tabvwshe.cxx |   16 ++---
 12 files changed, 152 insertions(+), 191 deletions(-)

New commits:
commit fc8e5f91fcf3a63d6bcd29c498e58a67e9abe67f
Author: Noel Grandin 
AuthorDate: Tue Mar 1 11:09:12 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 11:26:17 2022 +0100

use SfxItemSet::GetItemIfSet in sc/source/ui/view/

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

diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx
index 1caea374fb71..2ea903f59e75 100644
--- a/sc/source/ui/view/auditsh.cxx
+++ b/sc/source/ui/view/auditsh.cxx
@@ -85,15 +85,12 @@ void ScAuditingShell::Execute( const SfxRequest& rReq )
 const SfxItemSet* pReqArgs = rReq.GetArgs();
 if ( pReqArgs )
 {
-const SfxPoolItem* pXItem;
-const SfxPoolItem* pYItem;
-if ( pReqArgs->GetItemState( SID_RANGE_COL, true, &pXItem 
) == SfxItemState::SET
-  && pReqArgs->GetItemState( SID_RANGE_ROW, true, &pYItem 
) == SfxItemState::SET )
+const SfxInt16Item* pXItem = pReqArgs->GetItemIfSet( 
SID_RANGE_COL );
+const SfxInt32Item* pYItem = pReqArgs->GetItemIfSet( 
SID_RANGE_ROW );
+if ( pXItem && pYItem )
 {
-assert( dynamic_cast( pXItem) && 
dynamic_cast( pYItem) &&
-"wrong items" );
-SCCOL nCol = static_cast(static_cast(pXItem)->GetValue());
-SCROW nRow = static_cast(static_cast(pYItem)->GetValue());
+SCCOL nCol = static_cast(pXItem->GetValue());
+SCROW nRow = static_cast(pYItem->GetValue());
 ScViewFunc* pView = rViewData.GetView();
 pView->MoveCursorAbs( nCol, nRow, SC_FOLLOW_LINE, 
false, false );
 switch ( nFunction )
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 9bf7099b9d34..a3d4b0125437 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -809,12 +809,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 
 if( pReqArgs != nullptr )
 {
-const SfxPoolItem* pItem;
-
-if( pReqArgs->HasItem( FID_FILL_AUTO, &pItem ) )
+if( const SfxStringItem* pItem = pReqArgs->GetItemIfSet( 
FID_FILL_AUTO ) )
 {
 ScAddress aScAddress;
-OUString aArg = static_cast(pItem)->GetValue();
+OUString aArg = pItem->GetValue();
 
 if( aScAddress.Parse( aArg, rDoc, 
rDoc.GetAddressConvention() ) & ScRefFlags::VALID )
 {
@@ -1927,12 +1925,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 
 case SID_CONSOLIDATE:
 {
-const SfxPoolItem* pItem;
-if ( pReqArgs && SfxItemState::SET ==
-pReqArgs->GetItemState( SCITEM_CONSOLIDATEDATA, true, 
&pItem ) )
+const ScConsolidateItem* pItem;
+if ( pReqArgs && (pItem =
+pReqArgs->GetItemIfSet( SCITEM_CONSOLIDATEDATA )) )
 {
-const ScConsolidateParam& rParam =
-static_cast(pItem)->GetData();
+const ScConsolidateParam& rParam = pItem->GetData();
 
 pTabViewShell->Consolidate( rParam );
 GetViewData().GetDocument().SetConsolidateDlgData( 
std::unique_ptr(new ScConsolidateParam(rParam)) );
@@ -2305,16 +2302,14 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 case SID_INSERT_POSTIT:
 case SID_EDIT_POSTIT:
 {
-const SfxPoolItem* pText;
-if ( pReqArgs && pReqArgs->HasItem( SID_ATTR_POSTIT_TEXT, 
&pText) )
+const SvxPostItTextItem* pTextItem;
+if ( pReqArgs && (pTextItem = pReqArgs->GetItemIfSet( 
SID_ATTR_POSTIT_TEXT )) )
 {
-const SfxPoolItem* pCellId;
 OUString aCellId;
 // 

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

2022-03-01 Thread Noel Grandin (via logerrit)
 sc/source/core/tool/progress.cxx|6 +++---
 sc/source/filter/excel/xeextlst.cxx |5 ++---
 sc/source/filter/excel/xehelper.cxx |   11 +--
 sc/source/filter/excel/xestyle.cxx  |5 ++---
 sc/source/filter/html/htmlexp.cxx   |5 ++---
 sc/source/filter/rtf/eeimpars.cxx   |5 ++---
 sc/source/filter/xcl97/xcl97rec.cxx |5 ++---
 7 files changed, 18 insertions(+), 24 deletions(-)

New commits:
commit 1e157252a2074729d1d89d6b49054dfd74ffe789
Author: Noel Grandin 
AuthorDate: Tue Mar 1 11:06:32 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 11:03:59 2022 +0100

use SfxItemSet::GetItemIfSet in sc/source/filter

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

diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx
index 9a695bb8cfe5..83f4e687f609 100644
--- a/sc/source/core/tool/progress.cxx
+++ b/sc/source/core/tool/progress.cxx
@@ -53,9 +53,9 @@ static bool lcl_IsHiddenDocument( const SfxObjectShell* 
pObjSh )
 if (pMed)
 {
 SfxItemSet* pSet = pMed->GetItemSet();
-const SfxPoolItem* pItem;
-if ( pSet && SfxItemState::SET == pSet->GetItemState( SID_HIDDEN, 
true, &pItem ) &&
-static_cast(pItem)->GetValue() )
+const SfxBoolItem* pItem;
+if ( pSet && (pItem = pSet->GetItemIfSet( SID_HIDDEN )) &&
+pItem->GetValue() )
 return true;
 }
 }
diff --git a/sc/source/filter/excel/xeextlst.cxx 
b/sc/source/filter/excel/xeextlst.cxx
index f556c47ecdca..242f21dbb8fa 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -221,10 +221,9 @@ void XclExpExtCF::SaveXml( XclExpXmlStream& rStrm )
 std::unique_ptr pFont(new XclExpDxfFont(GetRoot(), rSet));
 
 std::unique_ptr pNumFormat;
-const SfxPoolItem *pPoolItem = nullptr;
-if( rSet.GetItemState( ATTR_VALUE_FORMAT, true, &pPoolItem ) == 
SfxItemState::SET )
+if( const SfxUInt32Item* pPoolItem = rSet.GetItemIfSet( ATTR_VALUE_FORMAT 
) )
 {
-sal_uInt32 nScNumFmt = static_cast< const SfxUInt32Item* 
>(pPoolItem)->GetValue();
+sal_uInt32 nScNumFmt = pPoolItem->GetValue();
 XclExpNumFmtBuffer& rNumFmtBuffer = GetRoot().GetNumFmtBuffer();
 sal_uInt32 nXclNumFmt = rNumFmtBuffer.Insert(nScNumFmt);
 pNumFormat.reset(new XclExpNumFmt(nScNumFmt, nXclNumFmt, 
rNumFmtBuffer.GetFormatCode(nScNumFmt)));
diff --git a/sc/source/filter/excel/xehelper.cxx 
b/sc/source/filter/excel/xehelper.cxx
index bd60fd355cd5..aeed23121e35 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -464,10 +464,9 @@ XclExpStringRef lclCreateFormattedString(
 if( aSel.nStartPos + 1 == aSel.nEndPos )
 {
 // test if the character is a text field
-const SfxPoolItem* pItem;
-if( aEditSet.GetItemState( EE_FEATURE_FIELD, false, &pItem ) 
== SfxItemState::SET )
+if( const SvxFieldItem* pItem = aEditSet.GetItemIfSet( 
EE_FEATURE_FIELD, false ) )
 {
-const SvxFieldData* pField = static_cast< const 
SvxFieldItem* >( pItem )->GetField();
+const SvxFieldData* pField = pItem->GetField();
 if( const SvxURLField* pUrlField = dynamic_cast( pField )  )
 {
 // convert URL field to string representation
@@ -807,11 +806,11 @@ void XclExpHFConverter::AppendPortion( const 
EditTextObject* pTextObj, sal_Unico
 
 // --- text content or text fields ---
 
-const SfxPoolItem* pItem;
+const SvxFieldItem* pItem;
 if( (aSel.nStartPos + 1 == aSel.nEndPos) && // fields are 
single characters
-(aEditSet.GetItemState( EE_FEATURE_FIELD, false, &pItem ) 
== SfxItemState::SET) )
+(pItem = aEditSet.GetItemIfSet( EE_FEATURE_FIELD, false )) 
)
 {
-if( const SvxFieldData* pFieldData = static_cast< const 
SvxFieldItem* >( pItem )->GetField() )
+if( const SvxFieldData* pFieldData = pItem->GetField() )
 {
 if( dynamic_cast( pFieldData) !=  
nullptr )
 aParaText.append("&P");
diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index 1dd6401a79eb..1e9c426a3dc9 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -3151,10 +3151,9 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot )
 std::unique_ptr pFont(new 
XclExpDxfFont(rRoot, rSet));
 
 std::unique_ptr pNumFormat;
-const SfxPoolItem *pPoolItem = nullptr;
-   

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - chart2/source

2022-03-01 Thread Ouyang Leyan (via logerrit)
 chart2/source/tools/DataSeriesHelper.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 3b7c754dd83a8c9e887b7092aa10b0ff7041462d
Author: Ouyang Leyan 
AuthorDate: Sun Jan 16 12:25:58 2022 +0100
Commit: Xisco Fauli 
CommitDate: Tue Mar 1 10:52:57 2022 +0100

tdf#146463 Apply data series filter to the chart legend

Consider a data series as hidden if there is no unfiltered value, do not
consider data labels. It solves a regression introduced when working on
tdf#134059.

Change-Id: I6072bf469137d70e0aa353ffbeb0d0a1216ffa5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128476
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 7c5cfe54357e4e8d08b4696e80741097d3335dcb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130645
Reviewed-by: Xisco Fauli 
(cherry picked from commit 73e443d32d5c275da953c29f4c493ff565426e8d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130671

diff --git a/chart2/source/tools/DataSeriesHelper.cxx 
b/chart2/source/tools/DataSeriesHelper.cxx
index 9f17273c1607..2c96c9b16b28 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -671,8 +671,6 @@ bool hasUnhiddenData( const uno::Reference< 
chart2::XDataSeries >& xSeries )
 continue;
 if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getValues() ) )
 return true;
-if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getLabel() ) )
-return true;
 }
 return false;
 }


[Libreoffice-commits] core.git: config_host/config_features.h.in config_host.mk.in configure.ac include/tools sc/inc sc/Module_sc.mk sc/qa sc/source

2022-03-01 Thread Luboš Luňák (via logerrit)
 config_host.mk.in   |1 +
 config_host/config_features.h.in|6 ++
 configure.ac|   22 ++
 include/tools/long.hxx  |1 +
 sc/Module_sc.mk |7 ++-
 sc/inc/defaultsoptions.hxx  |4 +++-
 sc/qa/unit/jumbosheets-test.cxx |3 ---
 sc/source/core/data/documen2.cxx|2 ++
 sc/source/core/tool/defaultsoptions.cxx |6 +-
 sc/source/ui/optdlg/tpdefaults.cxx  |6 +-
 10 files changed, 51 insertions(+), 7 deletions(-)

New commits:
commit 0156eba76667fe1b0ed4355272fa77f98f9f63a4
Author: Luboš Luňák 
AuthorDate: Mon Feb 28 16:06:09 2022 +0100
Commit: Luboš Luňák 
CommitDate: Tue Mar 1 10:48:13 2022 +0100

make Calc jumbo sheets an explicit build feature

On 32bit platforms tools::Long is 32bit, which is not enough
for pixel coordinates with 1m+ Calc rows+. So do not allow jumbo
sheets for such platforms.

Change-Id: I2ebd56a051470d33fca967918af3e7d2b0172dc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130713
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/config_host.mk.in b/config_host.mk.in
index 0cb682c4862c..ee5d0326c981 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -171,6 +171,7 @@ export DISABLE_GUI=@DISABLE_GUI@
 export ENABLE_HEADLESS=@ENABLE_HEADLESS@
 export ENABLE_HTMLHELP=@ENABLE_HTMLHELP@
 export ENABLE_JAVA=@ENABLE_JAVA@
+export ENABLE_JUMBO_SHEETS=@ENABLE_JUMBO_SHEETS@
 export ENABLE_LDAP=@ENABLE_LDAP@
 export ENABLE_LIBEOT=@ENABLE_LIBEOT@
 export ENABLE_LPSOLVE=@ENABLE_LPSOLVE@
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index 3cc5109ca25a..de3e9d58f7d2 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -151,4 +151,10 @@
  */
 #define HAVE_FEATURE_PAGEIN 0
 
+/*
+ * Whether Calc supports jumbo sheets (more than 1m rows), which can overflow
+ * 32bit drawing coordinates (see tools::Long definition).
+ */
+#define HAVE_FEATURE_JUMBO_SHEETS 0
+
 #endif
diff --git a/configure.ac b/configure.ac
index accb60493657..3e65a8298aff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7135,6 +7135,28 @@ 
AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
 
+dnl Calc jumbo sheets (1m+ rows) depend on 64 bit tools::Long .
+AC_MSG_CHECKING([whether jumbo sheets are supported])
+if test "$_os" != "WINNT"; then
+if test $SAL_TYPES_SIZEOFLONG -gt 4; then
+AC_MSG_RESULT([yes])
+ENABLE_JUMBO_SHEETS=TRUE
+AC_DEFINE(HAVE_FEATURE_JUMBO_SHEETS)
+else
+AC_MSG_RESULT([no])
+fi
+else
+if test $WIN_HOST_BITS -gt 32; then
+# 64bit windows is special-cased for tools::Long because long is 32bit
+AC_MSG_RESULT([yes])
+ENABLE_JUMBO_SHEETS=TRUE
+AC_DEFINE(HAVE_FEATURE_JUMBO_SHEETS)
+else
+AC_MSG_RESULT([no])
+fi
+fi
+AC_SUBST(ENABLE_JUMBO_SHEETS)
+
 dnl ===
 dnl Check whether to enable runtime optimizations
 dnl ===
diff --git a/include/tools/long.hxx b/include/tools/long.hxx
index 5e0800f2c274..2388565df077 100644
--- a/include/tools/long.hxx
+++ b/include/tools/long.hxx
@@ -23,6 +23,7 @@
  * of tools::Long in the codebase as meaning "we're not sure what the ideal 
size of the datatype is",
  * and where possible, replace it with a better datatype like 
sal_Int32/sal_Int64/etc.
  *
+ * NOTE: If you change this, make sure HAVE_FEATURE_JUMBO_SHEETS matches this, 
as it requires at least 64bit tools::Long.
  */
 namespace tools
 {
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index c37b37dd2a14..5179c5fdb292 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -73,7 +73,6 @@ $(eval $(call gb_Module_add_slowcheck_targets,sc, \
CppunitTest_sc_cond_format_merge \
CppunitTest_sc_copypaste \
CppunitTest_sc_html_export_test \
-   CppunitTest_sc_jumbosheets_test \
CppunitTest_sc_macros_test \
CppunitTest_sc_new_cond_format_api \
CppunitTest_sc_pdf_export \
@@ -85,6 +84,12 @@ $(eval $(call gb_Module_add_slowcheck_targets,sc, \
CppunitTest_sc_uicalc \
 ))
 
+ifneq ($(ENABLE_JUMBO_SHEETS),)
+$(eval $(call gb_Module_add_slowcheck_targets,sc, \
+   CppunitTest_sc_jumbosheets_test \
+))
+endif
+
 # Various function tests fail in 32-bit linux_x86 build due to dreaded floating
 # point weirdness (x87, registers, compiler optimization, ... whatever),
 # disable them until someone finds a real cure.
diff --git a/sc/inc/defaultsoptions.hxx b/sc/inc/defaultsoptions.hxx
index 3deefb8fc150..21e3cc0f2ed3 100644
--- a/sc/inc/defaultsoptions.hxx
+++ b/sc/inc/defaultsoptions.hxx
@@ -11,6 +11,7 @@
 
 #include

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

2022-03-01 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/layout/layout.cxx |   34 +-
 1 file changed, 13 insertions(+), 21 deletions(-)

New commits:
commit da77aec27e3121c895a6c6c287225216489cc8bc
Author: Mike Kaganski 
AuthorDate: Tue Mar 1 10:12:15 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Mar 1 10:47:07 2022 +0100

Fix flaky test on Win64

Obviously the left values are unstable; they were excluded on macOS,
and they fail exactly on the same lines for me locally on Win64 build.
So just test that the values are restored after delete and undo.

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

diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 0888e6c493ce..49b53b8b790e 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -1270,29 +1270,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239)
 SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf143239-1-min.odt");
 SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
 
+// These are unstable on macOS and Win64 builds,
+// so only test that they restore original values for now
+OUString p2txt1Left, p2txt2Left, p3txt1Left;
+
 {
 xmlDocUniquePtr pXmlDoc = parseLayoutDump();
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "18540");
-#ifndef MACOSX
-assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3559");
-#endif
+p2txt1Left
+= getXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left");
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top",
 "23894");
-#ifndef MACOSX
-assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left",
-"1964");
-#endif
+p2txt2Left
+= getXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left");
 assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "35662");
-#ifndef MACOSX
-assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3129");
-#endif
+p3txt1Left
+= getXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left");
 assertXPath(pXmlDoc, "/root/page", 3);
 discardDumpedLayout();
 }
@@ -1308,24 +1306,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf143239)
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "18540");
-#ifndef MACOSX
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3559");
-#endif
+p2txt1Left);
 assertXPath(pXmlDoc, "/root/page[2]/body/txt[2]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "top",
 "23894");
-#ifndef MACOSX
 assertXPath(pXmlDoc, 
"/root/page[2]/body/txt[2]/anchored/fly[1]/infos/bounds", "left",
-"1964");
-#endif
+p2txt2Left);
 assertXPath(pXmlDoc, "/root/page[3]/body/txt[1]/anchored/fly", 1);
 assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "top",
 "35662");
-#ifndef MACOSX
 assertXPath(pXmlDoc, 
"/root/page[3]/body/txt[1]/anchored/fly[1]/infos/bounds", "left",
-"3129");
-#endif
+p3txt1Left);
 assertXPath(pXmlDoc, "/root/page", 3);
 discardDumpedLayout();
 }


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

2022-03-01 Thread Stephan Bergmann (via logerrit)
 sw/source/filter/ww8/WW8Sttbf.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 4c68c4b93c41c4e9c2d5faf6c02ece2d40e95eb4
Author: Stephan Bergmann 
AuthorDate: Tue Mar 1 08:23:31 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Mar 1 10:30:09 2022 +0100

misaligned-pointer-use

...during CppunitTest_sw_filters_test,


~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/bits/stl_algobase.h:385:20:
 runtime error: load of misaligned address 0x61d001aedef7 for type 'const 
char16_t', which requires 2 byte alignment
0x61d001aedef7: note: pointer points here
 01 00 00 00 ff  00 00 00 00 00 00 00 00  be be be be be be be be  be be be 
be be be be be  be be be
 ^
 #0 in char16_t* std::__copy_move::__copy_m(char16_t 
const*, char16_t const*, char16_t*) at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/bits/stl_algobase.h:385:20
 #1 in char16_t* std::__copy_move_a2(char16_t const*, char16_t const*, char16_t*) at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/bits/stl_algobase.h:491:9
 #2 in char16_t* std::__copy_move_a1(char16_t const*, char16_t const*, char16_t*) at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/bits/stl_algobase.h:522:14
 #3 in char16_t* std::__copy_move_a(char16_t const*, char16_t const*, char16_t*) at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/bits/stl_algobase.h:530:3
 #4 in char16_t* std::copy(char16_t const*, 
char16_t const*, char16_t*) at 
~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/bits/stl_algobase.h:619:14
 #5 in void rtl::str::Copy(char16_t*, char16_t const*, int) at 
sal/rtl/strtmpl.hxx:50:5
 #6 in void rtl::str::newFromStr_WithLength<_rtl_uString, 
char16_t>(_rtl_uString**, char16_t const*, int, int) at 
sal/rtl/strtmpl.hxx:1054:9
 #7 in rtl_uString_newFromStr_WithLength at sal/rtl/ustring.cxx:1246:5
 #8 in rtl::OUString::OUString(char16_t const*, int) at 
include/rtl/ustring.hxx:332:9
 #9 in ww8::WW8Struct::getUString(unsigned int, unsigned int) at 
sw/source/filter/ww8/WW8Sttbf.cxx:87:23

presumably since 22de5757a2c7c6cd4544a4699e5d4c69969f5961 "Deduplicate 
string
buffer code" changed the Copy function template in sal/rtl/strtmpl.hxx from
using memcpy to using std::copy.

(And this revealed that the !OSL_LITENDIAN code had apparently started to 
rot
and lacked #include .)

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

diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx 
b/sw/source/filter/ww8/WW8Sttbf.cxx
index 1e23c8ca89a7..2739f208d902 100644
--- a/sw/source/filter/ww8/WW8Sttbf.cxx
+++ b/sw/source/filter/ww8/WW8Sttbf.cxx
@@ -24,6 +24,7 @@
 #include "WW8Sttbf.hxx"
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -83,15 +84,10 @@ namespace ww8
 sal_uInt32 nAvailable = (mn_size - nStartOff)/sizeof(sal_Unicode);
 if (nCount > nAvailable)
 nCount = nAvailable;
-#if defined OSL_LITENDIAN
-aResult = OUString(reinterpret_cast(
-m_pData.get() + nStartOff), nCount);
-#else
 OUStringBuffer aBuf;
 for (sal_uInt32 i = 0; i < nCount; ++i)
 aBuf.append(static_cast(getU16(nStartOff+i*2)));
 aResult = aBuf.makeStringAndClear();
-#endif
 }
 
 SAL_INFO( "sw.ww8.level2", "

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

2022-03-01 Thread Noel Grandin (via logerrit)
 sc/source/core/data/attarray.cxx |   42 +-
 sc/source/core/data/column2.cxx  |   32 +-
 sc/source/core/data/docpool.cxx  |7 
 sc/source/core/data/documen4.cxx |4 
 sc/source/core/data/documen8.cxx |3 
 sc/source/core/data/fillinfo.cxx |   46 +--
 sc/source/core/data/global.cxx   |6 
 sc/source/core/data/patattr.cxx  |  594 +++
 sc/source/core/data/stlpool.cxx  |   15 
 sc/source/core/data/table2.cxx   |6 
 sc/source/core/data/table5.cxx   |   12 
 11 files changed, 379 insertions(+), 388 deletions(-)

New commits:
commit a5a1863e16d209eb40758cd1f77500c6ff945f59
Author: Noel Grandin 
AuthorDate: Tue Mar 1 08:57:10 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 10:05:14 2022 +0100

use SfxItemSet::GetItemIfSet in sc/source/core/data

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

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 1f48990aa05d..71efb305750c 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -299,11 +299,9 @@ void ScAttrArray::AddCondFormat( SCROW nStartRow, SCROW 
nEndRow, sal_uInt32 nInd
 GetPatternRange( nPatternStartRow, nPatternEndRow, nTempStartRow );
 
 nTempEndRow = std::min( nPatternEndRow, nEndRow );
-const SfxPoolItem* pItem = nullptr;
-pPattern->GetItemSet().GetItemState( ATTR_CONDITIONAL, true, 
&pItem );
-if(pItem)
+if (const ScCondFormatItem* pItem = 
pPattern->GetItemSet().GetItemIfSet( ATTR_CONDITIONAL ))
 {
-ScCondFormatIndexes const & rCondFormatData = 
static_cast(pItem)->GetCondFormatData();
+ScCondFormatIndexes const & rCondFormatData = 
pItem->GetCondFormatData();
 if (rCondFormatData.find(nIndex) == rCondFormatData.end())
 {
 ScCondFormatIndexes aNewCondFormatData;
@@ -357,9 +355,7 @@ void ScAttrArray::RemoveCondFormat( SCROW nStartRow, SCROW 
nEndRow, sal_uInt32 n
 GetPatternRange( nPatternStartRow, nPatternEndRow, nTempStartRow );
 
 nTempEndRow = std::min( nPatternEndRow, nEndRow );
-const SfxPoolItem* pItem = nullptr;
-pPattern->GetItemSet().GetItemState( ATTR_CONDITIONAL, true, 
&pItem );
-if(pItem)
+if (const ScCondFormatItem* pItem = 
pPattern->GetItemSet().GetItemIfSet( ATTR_CONDITIONAL ))
 {
 auto pPatternAttr = std::make_unique( *pPattern 
);
 if (nIndex == 0)
@@ -370,7 +366,7 @@ void ScAttrArray::RemoveCondFormat( SCROW nStartRow, SCROW 
nEndRow, sal_uInt32 n
 }
 else
 {
-ScCondFormatIndexes const & rCondFormatData = 
static_cast(pItem)->GetCondFormatData();
+ScCondFormatIndexes const & rCondFormatData = 
pItem->GetCondFormatData();
 auto itr = rCondFormatData.find(nIndex);
 if(itr != rCondFormatData.end())
 {
@@ -739,23 +735,20 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, 
SCROW nEndRow,
 {
 const ScPatternAttr*pOldPattern = mvData[nPos].pPattern;
 const SfxItemSet&   rOldSet = pOldPattern->GetItemSet();
-const SfxPoolItem*  pBoxItem = nullptr;
-SfxItemStateeState = rOldSet.GetItemState( ATTR_BORDER, 
true, &pBoxItem );
-const SfxPoolItem*  pTLBRItem = nullptr;
-SfxItemStateeTLBRState = rOldSet.GetItemState( 
ATTR_BORDER_TLBR, true, &pTLBRItem );
-const SfxPoolItem*  pBLTRItem = nullptr;
-SfxItemStateeBLTRState = rOldSet.GetItemState( 
ATTR_BORDER_BLTR, true, &pBLTRItem );
+const SvxBoxItem*   pBoxItem = rOldSet.GetItemIfSet( ATTR_BORDER );
+const SvxLineItem*  pTLBRItem = rOldSet.GetItemIfSet( 
ATTR_BORDER_TLBR );
+const SvxLineItem*  pBLTRItem = rOldSet.GetItemIfSet( 
ATTR_BORDER_BLTR );
 
-if ( (SfxItemState::SET == eState) || (SfxItemState::SET == 
eTLBRState) || (SfxItemState::SET == eBLTRState) )
+if ( pBoxItem || pTLBRItem || pBLTRItem )
 {
 std::unique_ptr pNewPattern(new 
ScPatternAttr(*pOldPattern));
 SfxItemSet& rNewSet = pNewPattern->GetItemSet();
 SCROW   nY1 = nStart;
 SCROW   nY2 = mvData[nPos].nEndRow;
 
-std::unique_ptr  pNewBoxItem( pBoxItem ? 
static_cast(pBoxItem->Clone()) : nullptr);
-std::unique_ptr pNewTLBRItem( pTLBRItem ? 
static_cast(pTLBRItem->Clone()) : nullptr);
-std::unique_ptr pNewBLTRItem(pBLTRItem ? 
static_cast(pBLTRItem->Clone()) : nullptr);
+std::unique_ptr  pNewBoxItem( pBoxItem ? 
pBoxItem->Clone() : nullptr);
+ 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - svx/source

2022-03-01 Thread Miklos Vajna (via logerrit)
 svx/source/unodraw/unoshap2.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8311a2716924ad0bac7fc0a9e75279382a9553b0
Author: Miklos Vajna 
AuthorDate: Tue Mar 1 08:34:32 2022 +0100
Commit: Michael Meeks 
CommitDate: Tue Mar 1 10:03:16 2022 +0100

svx: the SdrObject of SvxGraphicObject can be nullptr

Crashreport:

Graphic::GetType() const
vcl/inc/impgraph.hxx:122
SvxGraphicObject::getPropertyValueImpl(rtl::OUString const&, 
SfxItemPropertySimpleEntry const*, com::sun::star::uno::Any&)
svx/source/unodraw/unoshap2.cxx:1466 (discriminator 1)
SvxShape::_getPropertyValue(rtl::OUString const&)
svx/source/unodraw/unoshape.cxx:1747
non-virtual thunk to SvxShape::getPropertyValue(rtl::OUString 
const&)
svx/source/unodraw/unoshape.cxx:1732

During SVG export of a selected shape.

Change-Id: I29b56d49b0c5418dfe8fec8491ac8667e5ade2ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130740
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 1ff2d3e03e9d..216605ebfa03 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1463,7 +1463,8 @@ bool SvxGraphicObject::getPropertyValueImpl( const 
OUString& rName, const SfxIte
 
 Reference xGraphic;
 auto pSdrGraphicObject = static_cast(GetSdrObject());
-if (pSdrGraphicObject->GetGraphicObject().GetType() != 
GraphicType::NONE)
+if (pSdrGraphicObject
+&& pSdrGraphicObject->GetGraphicObject().GetType() != 
GraphicType::NONE)
 xGraphic = pSdrGraphicObject->GetGraphic().GetXGraphic();
 rValue <<= xGraphic;
 break;


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

2022-03-01 Thread Noel Grandin (via logerrit)
 svx/source/dialog/dlgutil.cxx  |   12 -
 svx/source/dialog/hdft.cxx |6 
 svx/source/dialog/optgrid.cxx  |   17 --
 svx/source/form/fmview.cxx |5 
 svx/source/sdr/primitive2d/sdrattributecreator.cxx |   16 +-
 svx/source/svdraw/MediaShellHelpers.cxx|   10 -
 svx/source/svdraw/svdedtv1.cxx |  139 -
 svx/source/svdraw/svdobj.cxx   |  121 ++
 svx/source/svdraw/svdpntv.cxx  |   14 +-
 svx/source/svdraw/svdundo.cxx  |8 -
 svx/source/table/svdotable.cxx |   12 -
 svx/source/table/tablecontroller.cxx   |   30 ++--
 svx/source/unodraw/unobrushitemhelper.cxx  |8 -
 svx/source/unodraw/unoshape.cxx|   10 -
 14 files changed, 221 insertions(+), 187 deletions(-)

New commits:
commit 535359269ed23e2faead8e9e905d57cc6121e269
Author: Noel Grandin 
AuthorDate: Tue Mar 1 08:55:54 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 09:54:18 2022 +0100

use SfxItemSet::GetItemIfSet in svx

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

diff --git a/svx/source/dialog/dlgutil.cxx b/svx/source/dialog/dlgutil.cxx
index 3d40889a839f..a33e1ca9476c 100644
--- a/svx/source/dialog/dlgutil.cxx
+++ b/svx/source/dialog/dlgutil.cxx
@@ -30,9 +30,8 @@
 
 FieldUnit GetModuleFieldUnit( const SfxItemSet& rSet )
 {
-if (const SfxPoolItem* pItem = nullptr;
-SfxItemState::SET == rSet.GetItemState(SID_ATTR_METRIC, false, &pItem))
-return static_cast(static_cast(pItem)->GetValue());
+if (const SfxUInt16Item* pItem = rSet.GetItemIfSet(SID_ATTR_METRIC, false))
+return static_cast(pItem->GetValue());
 
 return SfxModule::GetCurrentFieldUnit();
 }
@@ -40,9 +39,8 @@ FieldUnit GetModuleFieldUnit( const SfxItemSet& rSet )
 bool GetApplyCharUnit( const SfxItemSet& rSet )
 {
 bool  bUseCharUnit = false;
-const SfxPoolItem* pItem = nullptr;
-if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_APPLYCHARUNIT, 
false, &pItem ) )
-bUseCharUnit =  static_cast(pItem)->GetValue();
+if ( const SfxBoolItem* pItem = rSet.GetItemIfSet( SID_ATTR_APPLYCHARUNIT, 
false ) )
+bUseCharUnit =  pItem->GetValue();
 else
 {
 // FIXME - this might be wrong, cf. the DEV300 changes in 
GetModuleFieldUnit()
@@ -57,7 +55,7 @@ bool GetApplyCharUnit( const SfxItemSet& rSet )
 {
 pItem = pModule->GetItem( SID_ATTR_APPLYCHARUNIT );
 if ( pItem )
-bUseCharUnit = static_cast(pItem)->GetValue();
+bUseCharUnit = pItem->GetValue();
 }
 else
 {
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index f3bb4eccfd38..9f0985ad1057 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -416,13 +416,13 @@ void SvxHFPage::Reset( const SfxItemSet* rSet )
 m_xCntSharedBox->save_state();
 RangeHdl();
 
-const SfxPoolItem* pItem = nullptr;
 SfxObjectShell* pShell;
-if(SfxItemState::SET == rSet->GetItemState(SID_HTML_MODE, false, &pItem) ||
+const SfxUInt16Item* pItem = rSet->GetItemIfSet(SID_HTML_MODE, false);
+if(pItem  ||
 ( nullptr != (pShell = SfxObjectShell::Current()) &&
 nullptr != (pItem = pShell->GetItem(SID_HTML_MODE
 {
-sal_uInt16 nHtmlMode = static_cast(pItem)->GetValue();
+sal_uInt16 nHtmlMode = pItem->GetValue();
 if (nHtmlMode & HTMLMODE_ON)
 {
 m_xCntSharedBox->hide();
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 06cedb798ca4..3cd12b48d1ae 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -175,12 +175,10 @@ bool SvxGridTabPage::FillItemSet( SfxItemSet* rCoreSet )
 
 void SvxGridTabPage::Reset( const SfxItemSet* rSet )
 {
-const SfxPoolItem* pAttr = nullptr;
+const SvxGridItem* pGridAttr = nullptr;
 
-if( SfxItemState::SET == rSet->GetItemState( SID_ATTR_GRID_OPTIONS , false,
-&pAttr ))
+if( (pGridAttr = rSet->GetItemIfSet( SID_ATTR_GRID_OPTIONS , false )) )
 {
-const SvxGridItem* pGridAttr = static_cast(pAttr);
 m_xCbxUseGridsnap->set_active(pGridAttr->bUseGridsnap);
 m_xCbxSynchronize->set_active(pGridAttr->bSynchronize);
 m_xCbxGridVisible->set_active(pGridAttr->bGridVisible);
@@ -199,11 +197,9 @@ void SvxGridTabPage::Reset( const SfxItemSet* rSet )
 
 void SvxGridTabPage::ActivatePage( const SfxItemSet& rSet )
 {
-const SfxPoolItem* pAttr = nullptr;
-if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS , false,
-  

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

2022-03-01 Thread Caolán McNamara (via logerrit)
 vcl/source/fontsubset/sft.cxx |   17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit ca3e12d5b560d27615aeac986f9dbc1258993e65
Author: Caolán McNamara 
AuthorDate: Mon Feb 28 20:49:20 2022 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 1 09:43:20 2022 +0100

ofz: verify table offsets

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

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 685e923d31e4..f101670d9ab5 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1648,11 +1648,20 @@ SFErrCodes CreateTTFromTTGlyphs(AbstractTrueTypeFont  
*ttf,
 
 /**   post  **/
 if ((p = ttf->table(O_post, nTableSize)) != nullptr)
+{
+sal_Int32 nItalic = (POST_italicAngle_offset + 4 < nTableSize) ?
+GetInt32(p, POST_italicAngle_offset) : 0;
+sal_Int16 nPosition = (POST_underlinePosition_offset + 2 < nTableSize) 
?
+GetInt16(p, POST_underlinePosition_offset) : 0;
+sal_Int16 nThickness = (POST_underlineThickness_offset + 2 < 
nTableSize) ?
+GetInt16(p, POST_underlineThickness_offset) : 0;
+sal_uInt32 nFixedPitch = (POST_isFixedPitch_offset + 4 < nTableSize) ?
+GetUInt32(p, POST_isFixedPitch_offset) : 0;
+
 post = TrueTypeTableNew_post(0x0003,
- GetInt32(p, POST_italicAngle_offset),
- GetInt16(p, 
POST_underlinePosition_offset),
- GetInt16(p, 
POST_underlineThickness_offset),
- GetUInt32(p, POST_isFixedPitch_offset));
+ nItalic, nPosition,
+ nThickness, nFixedPitch);
+}
 else
 post = TrueTypeTableNew_post(0x0003, 0, 0, 0, 0);
 


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

2022-03-01 Thread Noel Grandin (via logerrit)
 starmath/inc/starmath.hrc   |   25 +---
 starmath/source/cfgitem.cxx |   45 +---
 starmath/source/dialog.cxx  |   14 ++---
 3 files changed, 43 insertions(+), 41 deletions(-)

New commits:
commit f1bf33a26b20a2fd0aa941cce5ad40e3737e0eb4
Author: Noel Grandin 
AuthorDate: Tue Mar 1 08:55:22 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Mar 1 09:12:45 2022 +0100

use SfxItemSet::GetItemIfSet in starmath

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

diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc
index c566783156ca..83c17c94da09 100644
--- a/starmath/inc/starmath.hrc
+++ b/starmath/inc/starmath.hrc
@@ -21,6 +21,9 @@
 
 #include 
 
+class SfxBoolItem;
+class SfxUInt16Item;
+
 #define SID_NEXTERR (SID_SMA_START + 1)
 #define SID_PREVERR (SID_SMA_START + 2)
 #define SID_NEXTMARK(SID_SMA_START + 3)
@@ -51,23 +54,23 @@
 #define SID_MODIFYSTATUS(SID_SMA_START + 110)
 #define SID_TEXTSTATUS  (SID_SMA_START + 111)
 
-#define SID_PRINTTITLE  (SID_SMA_START + 112)
-#define SID_PRINTTEXT   (SID_SMA_START + 113)
-#define SID_PRINTFRAME  (SID_SMA_START + 114)
-#define SID_PRINTSIZE   (SID_SMA_START + 115)
-#define SID_PRINTZOOM   (SID_SMA_START + 116)
+#define SID_PRINTTITLE  TypedWhichId(SID_SMA_START + 
112)
+#define SID_PRINTTEXT   TypedWhichId(SID_SMA_START + 
113)
+#define SID_PRINTFRAME  TypedWhichId(SID_SMA_START + 
114)
+#define SID_PRINTSIZE   TypedWhichId(SID_SMA_START 
+ 115)
+#define SID_PRINTZOOM   TypedWhichId(SID_SMA_START 
+ 116)
 
 #define SID_COPYOBJECT  (SID_SMA_START + 117)
 #define SID_PASTEOBJECT (SID_SMA_START + 118)
-#define SID_AUTOREDRAW  (SID_SMA_START + 119)
+#define SID_AUTOREDRAW  TypedWhichId(SID_SMA_START + 
119)
 
 #define SID_GETEDITTEXT (SID_SMA_START + 121)
 #define SID_CMDBOXWINDOW(SID_SMA_START + 122)
-#define SID_NO_RIGHT_SPACES (SID_SMA_START + 124)
-#define SID_SAVE_ONLY_USED_SYMBOLS  (SID_SMA_START + 125)
+#define SID_NO_RIGHT_SPACES TypedWhichId(SID_SMA_START + 
124)
+#define SID_SAVE_ONLY_USED_SYMBOLS  TypedWhichId(SID_SMA_START + 
125)
 #define SID_ELEMENTSDOCKINGWINDOW   (SID_SMA_START + 126)
-#define SID_AUTO_CLOSE_BRACKETS (SID_SMA_START + 127)
-#define SID_SMEDITWINDOWZOOM(SID_SMA_START + 129)
-#define SID_DEFAULT_SM_SYNTAX_VERSION (SID_SMA_START + 130)
+#define SID_AUTO_CLOSE_BRACKETS TypedWhichId(SID_SMA_START + 
127)
+#define SID_SMEDITWINDOWZOOMTypedWhichId(SID_SMA_START 
+ 129)
+#define SID_DEFAULT_SM_SYNTAX_VERSION 
TypedWhichId(SID_SMA_START + 130)
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 16e6d67b7312..7692aaa3ff5c 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -1357,56 +1357,55 @@ void SmMathConfig::Notify( const css::uno::Sequence< 
OUString >& rNames )
 void SmMathConfig::ItemSetToConfig(const SfxItemSet &rSet)
 {
 CommitLocker aLock(*this);
-const SfxPoolItem *pItem = nullptr;
 
 sal_uInt16 nU16;
 bool bVal;
-if (rSet.GetItemState(SID_PRINTSIZE, true, &pItem) == SfxItemState::SET)
-{   nU16 = static_cast(pItem)->GetValue();
+if (const SfxUInt16Item* pPrintSizeItem = rSet.GetItemIfSet(SID_PRINTSIZE))
+{   nU16 = pPrintSizeItem->GetValue();
 SetPrintSize( static_cast(nU16) );
 }
-if (rSet.GetItemState(SID_PRINTZOOM, true, &pItem) == SfxItemState::SET)
-{   nU16 = static_cast(pItem)->GetValue();
+if (const SfxUInt16Item* pPrintZoomItem = rSet.GetItemIfSet(SID_PRINTZOOM))
+{   nU16 = pPrintZoomItem->GetValue();
 SetPrintZoomFactor( nU16 );
 }
-if (rSet.GetItemState(SID_SMEDITWINDOWZOOM, true, &pItem) == 
SfxItemState::SET)
-{   nU16 = static_cast(pItem)->GetValue();
+if (const SfxUInt16Item* pPrintZoomItem = 
rSet.GetItemIfSet(SID_SMEDITWINDOWZOOM))
+{   nU16 = pPrintZoomItem->GetValue();
 SetSmEditWindowZoomFactor( nU16 );
 }
-if (rSet.GetItemState(SID_PRINTTITLE, true, &pItem) == SfxItemState::SET)
-{   bVal = static_cast(pItem)->GetValue();
+if (const SfxBoolItem* pPrintTitleItem = rSet.GetItemIfSet(SID_PRINTTITLE))
+{   bVal = pPrintTitleItem->GetValue();
 SetPrintTitle( bVal );
 }
-if (rSet.GetItemState(SID_PRINTTEXT, true, &pItem) == SfxItemState::SET)
-{   bVal = static_cast(pItem)->GetValue();
+if (const SfxBoolItem* pPrintTextItem = rSet.GetItemIfSet(SID_PRINTTEXT))
+{   bVal = pPrintTextItem->GetValue();
 SetPrintFormulaText( bVal );
 }
-if (rSet

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

2022-03-01 Thread Stephan Bergmann (via logerrit)
 vcl/unx/generic/printer/cupsmgr.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit f8238187bad40d0a4b8eccbae9f99eca4aa10f7a
Author: Stephan Bergmann 
AuthorDate: Mon Feb 28 23:12:11 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Mar 1 09:12:04 2022 +0100

Always join thread before destroying it

m_aDestThread had been added with 7d6c646ec244f9ea1db9b5bd160ecfc43ac27f13
"INTEGRATION: CWS vcl24", apparently for "#i28763# workaround possibly 
hanging
CUPS calls" to address 
"Loading document hangs if CUPS printer doesn't deliver PPD" and its 
duplicate
 "OO.o hangs if cupsd 
hangs".

However, PythonTest_sc_python now occasionally failed for me with a SIGSEGV 
in
thread #1 of python.bin at

> Thread 2 (Thread 0x7fc8df392fc0 (LWP 2268774)):
> #0  0x7fc8df42ee28 in _int_free () at /lib64/libc.so.6
> #1  0x7fc8df431c05 in free () at /lib64/libc.so.6
> #2  0x7fc8df7e4fe9 in _PyMem_RawFree (ctx=0x0, ptr=0xff64c0) at 
workdir/UnpackedTarball/python3/Objects/obmalloc.c:127
> #3  0x7fc8df7e5af7 in _PyMem_DebugRawFree (ctx=0x7fc8dfb36d88 
<_PyMem_Debug>, p=0xff64d0) at 
workdir/UnpackedTarball/python3/Objects/obmalloc.c:2187
> #4  0x7fc8df7e5ff0 in PyMem_RawFree (ptr=0xff64d0) at 
workdir/UnpackedTarball/python3/Objects/obmalloc.c:595
> #5  0x7fc8df7e5301 in _PyObject_Free (ctx=0x0, p=0xff64d0) at 
workdir/UnpackedTarball/python3/Objects/obmalloc.c:1898
> #6  0x7fc8df7e5af7 in _PyMem_DebugRawFree (ctx=0x7fc8dfb36de8 
<_PyMem_Debug+96>, p=0xff64e0) at 
workdir/UnpackedTarball/python3/Objects/obmalloc.c:2187
> #7  0x7fc8df7e5bb2 in _PyMem_DebugFree (ctx=0x7fc8dfb36de8 
<_PyMem_Debug+96>, ptr=0xff64e0) at 
workdir/UnpackedTarball/python3/Objects/obmalloc.c:2318
> #8  0x7fc8df7e64c0 in PyObject_Free (ptr=0xff64e0) at 
workdir/UnpackedTarball/python3/Objects/obmalloc.c:709
> #9  0x7fc8df853d8d in unicode_dealloc (unicode=) at workdir/UnpackedTarball/python3/Objects/unicodeobject.c:1879
> #10 0x7fc8df7e47b6 in _Py_Dealloc (op=) 
at workdir/UnpackedTarball/python3/Objects/object.c:2215
> #11 0x7fc8df81aeff in _Py_DECREF (filename=0x7fc8dfa46c76 
"Objects/unicodeobject.c", lineno=15296, op=) at 
workdir/UnpackedTarball/python3/Include/object.h:478
> #12 0x7fc8df81adc6 in PyUnicode_InternInPlace (p=0x7ffdf1d0b048) at 
workdir/UnpackedTarball/python3/Objects/unicodeobject.c:15296
> #13 0x7fc8df7c7791 in PyDict_SetItemString (v={'__name__': 'sys', 
'__doc__': "This module provides access to some objects used or maintained by 
the\ninterpreter and to functions that interact strongly with the 
interpreter.\n\nDynamic objects:\n\nargv -- command line arguments; argv[0] is 
the script pathname if known\npath -- module search path; path[0] is the script 
directory, else ''\nmodules -- dictionary of loaded modules\n\ndisplayhook -- 
called to show results in an interactive session\nexcepthook -- called to 
handle any uncaught exception other than SystemExit\n  To customize printing in 
an interactive session or to install a custom\n  top-level exception handler, 
assign other functions to replace these.\n\nstdin -- standard input file 
object; used by input()\nstdout -- standard output file object; used by 
print()\nstderr -- standard error object; used for error messages\n  By 
assigning other file objects (or objects that behave like files)\n  to these, 
it is possible
  to redirect all of the interpreter's I/O.\n\nlast_type -- type of last 
uncaught e...(truncated), key=0x7fc8dfa71535 "stdin", item=<_io.TextIOWrapper 
at remote 0x1079630>) at 
workdir/UnpackedTarball/python3/Objects/dictobject.c:3416
> #14 0x7fc8df92af89 in PyImport_Cleanup () at 
workdir/UnpackedTarball/python3/Python/import.c:447
> #15 0x7fc8df94af6d in Py_FinalizeEx () at 
workdir/UnpackedTarball/python3/Python/pylifecycle.c:1229
> #16 0x7fc8df981f2d in Py_RunMain () at 
workdir/UnpackedTarball/python3/Modules/main.c:691
> #17 0x7fc8df9822fd in pymain_main (args=0x7ffdf1d0b1f0) at 
workdir/UnpackedTarball/python3/Modules/main.c:719
> #18 0x7fc8df982347 in Py_BytesMain (argc=4, argv=0x7ffdf1d0b378) at 
workdir/UnpackedTarball/python3/Modules/main.c:743
> #19 0x00401152 in main (argc=4, argv=0x7ffdf1d0b378) at 
workdir/UnpackedTarball/python3/Programs/python.c:16
> #20 0x7fc8df3c1560 in __libc_start_call_main () at /lib64/libc.so.6
> #21 0x7fc8df3c160c in __libc_start_main_impl () at /lib64/libc.so.6
> #22 0x00401065 in _start ()
>
> Thread 1 (Thread 0x7fc8be2dc640 (LWP 2269049)):
> #0  0x7fc8df424e24 in pthread_mutex_lock@@GLIBC_2.2.5 () at 
/lib64/libc.so.6
> #1  0x7fc8d19a8e57 in osl_acquireMutex(oslMutex) 
(pMutex=0xcdcdcdcdcdcdcdcd) at sal/osl/unx/mutex.cxx