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

2023-01-17 Thread Noel Grandin (via logerrit)
 vcl/source/bitmap/alpha.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 55eabf68ff48762d620b69daefd4116c2023cb0c
Author: Noel Grandin 
AuthorDate: Tue Jan 17 09:00:25 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 08:18:38 2023 +

assert/SAL_WARN in BlendWith

instead of just silently doing nothing, so we get some indication of
error

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

diff --git a/vcl/source/bitmap/alpha.cxx b/vcl/source/bitmap/alpha.cxx
index 196ba30d5f57..8618c052ab03 100644
--- a/vcl/source/bitmap/alpha.cxx
+++ b/vcl/source/bitmap/alpha.cxx
@@ -91,8 +91,12 @@ void AlphaMask::BlendWith(const Bitmap& rOther)
 AlphaMask aOther(rOther); // to 8 bits
 Bitmap::ScopedReadAccess pOtherAcc(aOther);
 AlphaScopedWriteAccess pAcc(*this);
+assert (pOtherAcc && pAcc && pOtherAcc->GetBitCount() == 8 && 
pAcc->GetBitCount() == 8 && "cannot BlendWith this combination");
 if (!(pOtherAcc && pAcc && pOtherAcc->GetBitCount() == 8 && 
pAcc->GetBitCount() == 8))
+{
+SAL_WARN("vcl", "cannot BlendWith this combination");
 return;
+}
 
 const tools::Long nHeight = std::min(pOtherAcc->Height(), pAcc->Height());
 const tools::Long nWidth = std::min(pOtherAcc->Width(), pAcc->Width());


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

2023-01-17 Thread Miklos Vajna (via logerrit)
 sw/qa/uibase/shells/shells.cxx  |   26 ++
 sw/sdi/swriter.sdi  |2 +-
 sw/source/uibase/shells/textfld.cxx |   12 
 3 files changed, 39 insertions(+), 1 deletion(-)

New commits:
commit ceea8f3924f26d5f10adc41b9ea587c77c2fda74
Author: Miklos Vajna 
AuthorDate: Mon Jan 16 16:34:40 2023 +0100
Commit: Miklos Vajna 
CommitDate: Tue Jan 17 08:30:47 2023 +

sw: .uno:TextFormField: add new Wrapper parameter

Currently all fieldmarks are inserted into the document body
unconditionally when this UNO command is dispatched.

Inserting at the current cursor position makes sense, but some citation
styles want to insert the actual citation as footnotes, and only have
the footnote anchor at the cursor position.

Fix the problem by adding a new Wrapper parameter to this UNO command:
currently the only interesting value it may have is Footnote, if this is
specified then first we insert a footnote and the footnote content will
host the fieldmark, not the original body text.

The same will be wanted for endnotes as well, but that's not yet done in
this commit.

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

diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index 8ed71760baa7..6dfc6ed6e9da 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /// Covers sw/source/uibase/shells/ fixes.
 class SwUibaseShellsTest : public SwModelTestBase
@@ -935,6 +936,31 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testDeleteFields)
 CPPUNIT_ASSERT_EQUAL(static_cast(0), pDoc->GetRefMarks());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testInsertTextFormFieldFootnote)
+{
+// Given an empty document:
+createSwDoc();
+SwDoc* pDoc = getSwDoc();
+
+// When inserting an ODF_UNHANDLED fieldmark inside a footnote:
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("FieldType", 
uno::Any(OUString(ODF_UNHANDLED))),
+comphelper::makePropertyValue("FieldCommand",
+  uno::Any(OUString("ADDIN ZOTERO_BIBL foo 
bar"))),
+comphelper::makePropertyValue("FieldResult", 
uno::Any(OUString("result"))),
+comphelper::makePropertyValue("Wrapper", 
uno::Any(OUString("Footnote"))),
+};
+dispatchCommand(mxComponent, ".uno:TextFormField", aArgs);
+
+// Then make sure that the footnote is created:
+SwFootnoteIdxs& rFootnotes = pDoc->GetFootnoteIdxs();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// i.e. no footnote was created.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rFootnotes.size());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index bc1b52b92b43..b974614b1e01 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -8354,7 +8354,7 @@ SfxBoolItem ShowInlineTooltips FN_SHOW_INLINETOOLTIPS
 ]
 
 SfxVoidItem TextFormField FN_INSERT_TEXT_FORMFIELD
-(SfxStringItem FieldType FN_PARAM_1, SfxStringItem FieldCommand FN_PARAM_2, 
SfxStringItem FieldResult FN_PARAM_3)
+(SfxStringItem FieldType FN_PARAM_1, SfxStringItem FieldCommand FN_PARAM_2, 
SfxStringItem FieldResult FN_PARAM_3, SfxStringItem Wrapper FN_PARAM_4)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index 77d68cddf3d7..239e4a076812 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -748,6 +748,18 @@ FIELD_INSERT:
 aFieldResult = pFieldResult->GetValue();
 }
 
+const SfxStringItem* pWrapper = 
rReq.GetArg(FN_PARAM_4);
+if (pWrapper)
+{
+// Wrap the fieldmark in the requested container instead 
of inserting it
+// directly at the cursor position.
+OUString aWrapper = pWrapper->GetValue();
+if (aWrapper == "Footnote")
+{
+rSh.InsertFootnote(OUString());
+}
+}
+
 // Split node to remember where the start position is.
 bool bSuccess = 
rSh.GetDoc()->getIDocumentContentOperations().SplitNode(
 *pCursorPos->GetPoint(), false);


[Libreoffice-commits] core.git: oox/Library_oox.mk

2023-01-17 Thread Caolán McNamara (via logerrit)
 oox/Library_oox.mk |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 0b471dc61b60180508d071a26e45b217ea65d13f
Author: Caolán McNamara 
AuthorDate: Mon Jan 16 16:43:13 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 17 08:35:27 2023 +

docmodel appears twice in Library_oox.mk

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

diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk
index 7729003a3742..15d706713982 100644
--- a/oox/Library_oox.mk
+++ b/oox/Library_oox.mk
@@ -43,14 +43,13 @@ $(eval $(call gb_Library_use_libraries,oox,\
 comphelper \
 cppu \
 cppuhelper \
-editeng \
 docmodel \
-expwrap \
 drawinglayer \
-docmodel \
+editeng \
+expwrap \
+i18nlangtag \
 msfilter \
 sal \
-i18nlangtag \
 sax \
 sfx \
 svl \
@@ -61,8 +60,8 @@ $(eval $(call gb_Library_use_libraries,oox,\
 tl \
 utl \
 vcl \
-xo \
 xmlscript \
+xo \
 ))
 
 $(eval $(call gb_Library_use_externals,oox,\


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

2023-01-17 Thread DowdyJ (via logerrit)
 sw/inc/TextCursorHelper.hxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit b8cda1fe1c87af9f378b49bbd3beee25f3c4a942
Author: DowdyJ 
AuthorDate: Tue Jan 17 02:17:14 2023 +
Commit: Ilmari Lauhakangas 
CommitDate: Tue Jan 17 08:37:40 2023 +

tdf#143148 Use pragma once instead of include guards

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

diff --git a/sw/inc/TextCursorHelper.hxx b/sw/inc/TextCursorHelper.hxx
index 3f15248a6dda..f14d68ab2c41 100644
--- a/sw/inc/TextCursorHelper.hxx
+++ b/sw/inc/TextCursorHelper.hxx
@@ -16,9 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SW_INC_TEXTCURSORHELPER_HXX
-#define INCLUDED_SW_INC_TEXTCURSORHELPER_HXX
-
+#pragma once
 #include 
 #include 
 
@@ -44,6 +42,4 @@ protected:
 ~OTextCursorHelper() {}
 };
 
-#endif // INCLUDED_SW_INC_TEXTCURSORHELPER_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - include/sax oox/source sax/source

2023-01-17 Thread Mike Kaganski (via logerrit)
 include/sax/fastattribs.hxx|   28 +++--
 oox/source/drawingml/textfield.cxx |6 ++---
 sax/source/tools/fastattribs.cxx   |   40 +
 3 files changed, 26 insertions(+), 48 deletions(-)

New commits:
commit 0fceacdb62b40d5d7b739064fd5bee7f28368c60
Author: Mike Kaganski 
AuthorDate: Mon Jan 16 13:29:19 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jan 17 08:54:39 2023 +

Simplify FastAttributeList

Change-Id: Id89edb25e35527e8603c32e44fb2940721aeda58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145562
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 15fe7346ade34f09f9be016ff847421ce0fa56f4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145580
Tested-by: Mike Kaganski 

diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
index 22512bd5a929..2dc7c3d72420 100644
--- a/include/sax/fastattribs.hxx
+++ b/include/sax/fastattribs.hxx
@@ -25,6 +25,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -105,9 +106,18 @@ public:
 bool getAsInteger( sal_Int32 nToken, sal_Int32 &rInt) const;
 bool getAsDouble( sal_Int32 nToken, double &rDouble) const;
 bool getAsView( sal_Int32 nToken, std::string_view& rPos ) const;
-sal_Int32 getAsIntegerByIndex( sal_Int32 nTokenIndex ) const;
-std::string_view getAsViewByIndex( sal_Int32 nTokenIndex ) const;
-OUString getValueByIndex( sal_Int32 nTokenIndex ) const;
+sal_Int32 getAsIntegerByIndex( sal_Int32 nTokenIndex ) const
+{
+return o3tl::toInt32(getAsViewByIndex(nTokenIndex));
+}
+std::string_view getAsViewByIndex( sal_Int32 nTokenIndex ) const
+{
+return std::string_view(getFastAttributeValue(nTokenIndex), 
AttributeValueLength(nTokenIndex));
+}
+OUString getValueByIndex( sal_Int32 nTokenIndex ) const
+{
+return OStringToOUString(getAsViewByIndex(nTokenIndex), 
RTL_TEXTENCODING_UTF8);
+}
 
 // XFastAttributeList
 virtual sal_Bool SAL_CALL hasAttribute( ::sal_Int32 Token ) override;
@@ -168,14 +178,12 @@ public:
 sal_Int32 toInt32() const
 {
 assert(mnIdx < mrList.maAttributeTokens.size());
-return rtl_str_toInt32(mrList.getFastAttributeValue(mnIdx), 10);
+return mrList.getAsIntegerByIndex(mnIdx);
 }
 double toDouble() const
 {
 assert(mnIdx < mrList.maAttributeTokens.size());
-const char* pStr = mrList.getFastAttributeValue(mnIdx);
-sal_Int32 nLen = mrList.AttributeValueLength(mnIdx);
-return rtl_math_stringToDouble(pStr, pStr + nLen, '.', 0, nullptr, 
nullptr);
+return o3tl::toDouble(mrList.getAsViewByIndex(mnIdx));
 }
 bool toBoolean() const
 {
@@ -185,9 +193,7 @@ public:
 OUString toString() const
 {
 assert(mnIdx < mrList.maAttributeTokens.size());
-return OUString(mrList.getFastAttributeValue(mnIdx),
-mrList.AttributeValueLength(mnIdx),
-RTL_TEXTENCODING_UTF8);
+return mrList.getValueByIndex(mnIdx);
 }
 const char* toCString() const
 {
@@ -202,7 +208,7 @@ public:
 std::string_view toView() const
 {
 assert(mnIdx < mrList.maAttributeTokens.size());
-return std::string_view(mrList.getFastAttributeValue(mnIdx), 
mrList.AttributeValueLength(mnIdx));
+return mrList.getAsViewByIndex(mnIdx);
 }
 bool isString(const char *str) const
 {
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx
index d020e18de18c..27d7e57f8ad5 100644
--- a/sax/source/tools/fastattribs.cxx
+++ b/sax/source/tools/fastattribs.cxx
@@ -210,33 +210,19 @@ bool FastAttributeList::getAsInteger( sal_Int32 nToken, 
sal_Int32 &rInt) const
 for (size_t i = 0, n = maAttributeTokens.size(); i < n; ++i)
 if (maAttributeTokens[i] == nToken)
 {
-sal_Int64 nVal = rtl_str_toInt64_WithLength( 
getFastAttributeValue(i), 10, AttributeValueLength(i) );
-if (nVal < SAL_MIN_INT32 || nVal > SAL_MAX_INT32) {
-nVal = 0;
-}
-rInt = nVal;
+rInt = getAsIntegerByIndex(i);
 return true;
 }
 return false;
 }
 
-sal_Int32 FastAttributeList::getAsIntegerByIndex( sal_Int32 nTokenIndex ) const
-{
-sal_Int64 n = rtl_str_toInt64_WithLength( 
getFastAttributeValue(nTokenIndex), 10, AttributeValueLength(nTokenIndex) );
-if (n < SAL_MIN_INT32 || n > SAL_MAX_INT32) {
-n = 0;
-}
-return n;
-}
-
 bool FastAttributeList::getAsDouble( sal_Int32 nToken, double &rDouble) const
 {
 rDouble = 0.0;
 for (size_t i = 0, n = maAttributeTokens.size(); i < n; ++i)
 if (maAttributeTokens[i] == nToken)
 {
-auto const p = get

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

2023-01-17 Thread Noel Grandin (via logerrit)
 framework/inc/uielement/rootitemcontainer.hxx |8 --
 framework/source/fwi/uielement/rootitemcontainer.cxx  |   12 
--
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |6 ++---
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |6 ++---
 4 files changed, 7 insertions(+), 25 deletions(-)

New commits:
commit 5ed9bb8bdcb1bee63d89909eed82110da31edfe5
Author: Noel Grandin 
AuthorDate: Mon Jan 16 08:48:06 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 09:03:04 2023 +

XUnoTunnel->dynamic_cast in RootItemContainer

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

diff --git a/framework/inc/uielement/rootitemcontainer.hxx 
b/framework/inc/uielement/rootitemcontainer.hxx
index cdfc82fada3e..159137f0f67e 100644
--- a/framework/inc/uielement/rootitemcontainer.hxx
+++ b/framework/inc/uielement/rootitemcontainer.hxx
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -40,8 +39,7 @@ class ConstItemContainer;
 
 typedef ::cppu::WeakImplHelper<
 css::container::XIndexContainer,
-css::lang::XSingleComponentFactory,
-css::lang::XUnoTunnel > RootItemContainer_BASE;
+css::lang::XSingleComponentFactory > RootItemContainer_BASE;
 
 class RootItemContainer final : private cppu::BaseMutex,
 public ::cppu::OBroadcastHelper
 ,
@@ -65,10 +63,6 @@ class RootItemContainer final : private cppu::BaseMutex,
 // XTypeProvider
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;
 
-// XUnoTunnel
-static const css::uno::Sequence< sal_Int8 >&   getUnoTunnelId() 
noexcept;
-sal_Int64   SAL_CALL 
getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override;
-
 // XIndexContainer
 virtual void SAL_CALL insertByIndex( sal_Int32 Index, const 
css::uno::Any& Element ) override;
 
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx 
b/framework/source/fwi/uielement/rootitemcontainer.cxx
index db267f54a658..fdfb6b709c4a 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -138,18 +138,6 @@ Reference< XIndexAccess > 
RootItemContainer::deepCopyContainer( const Reference<
 return xReturn;
 }
 
-// XUnoTunnel
-sal_Int64 RootItemContainer::getSomething( const css::uno::Sequence< sal_Int8 
>& rIdentifier )
-{
-return comphelper::getSomethingImpl(rIdentifier, this);
-}
-
-const Sequence< sal_Int8 >& RootItemContainer::getUnoTunnelId() noexcept
-{
-static const comphelper::UnoIdInit theRootItemContainerUnoTunnelId;
-return theRootItemContainerUnoTunnelId.getSeq();
-}
-
 // XElementAccess
 sal_Bool SAL_CALL RootItemContainer::hasElements()
 {
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 235190ac9d0d..a75b84e7457f 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -429,7 +429,7 @@ void 
ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
 {
 MenuConfiguration aMenuCfg( m_xContext );
 Reference< XIndexAccess > xContainer( 
aMenuCfg.CreateMenuBarConfigurationFromXML( xInputStream ));
-auto pRootItemContainer = 
comphelper::getFromUnoTunnel( xContainer );
+auto pRootItemContainer = 
dynamic_cast( xContainer.get() );
 if ( pRootItemContainer )
 aUIElementData.xSettings = new 
ConstItemContainer( pRootItemContainer, true );
 else
@@ -448,7 +448,7 @@ void 
ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
 {
 Reference< XIndexContainer > xIndexContainer( new 
RootItemContainer() );
 ToolBoxConfiguration::LoadToolBox( m_xContext, 
xInputStream, xIndexContainer );
-auto pRootItemContainer = 
comphelper::getFromUnoTunnel( xIndexContainer );
+auto pRootItemContainer = 
dynamic_cast( xIndexContainer.get() );
 aUIElementData.xSettings = new ConstItemContainer( 
pRootItemContainer, true );
 return;
 }
@@ -465,7 +465,7 @@ void 
ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement
 {
 Refer

Re: Crash test update

2023-01-17 Thread Caolán McNamara
On Mon, 2023-01-16 at 00:23 +, crashtest wrote:
> 104 files have crashed during import.
> 
> 4 files have crashed during export.

I've grouped the crashes together by shared stacktrace and ranked by
frequency, first column is task id, e.g. 796 is the stacktrace of
https://dev-builds.libreoffice.org/crashtest/d85a6fd228b3eaeb9214e73cdec0c6ef88e058e3/backtraces/task796-core.backtrace.txt
where known gerrit link to commit which seems to be related to the
crash is mentioned.

ScQueryCellIterator< FindEqualOrSortedLastInRange
 -> assert(!"FindEqualOrSortedLastInRange: rEntry.nField -= nColDiff <
0")
796 forums/xls/forum-mso-en4-144513.xls
901 forums/xls/forum-mso-en4-433310.xls
1034 forums/xls/forum-mso-en4-130543.xls
1132 forums/xls/forum-mso-en4-433308.xls
1255 forums/xlsx/forum-mso-de-62049.xlsx
1461 forums/xls/forum-mso-en4-433031.xls
1601 forums/xls/forum-mso-en4-156881.xls
2074 forums/xlsx/forum-mso-en4-491002.xlsx
2504 forums/xlsx/forum-mso-en4-527778.xlsx
2564 forums/xlsx/forum-mso-en4-606273.xlsx
2945 forums/xlsx/forum-mso-en4-643938.xlsx
3016 forums/xlsx/forum-mso-en4-544867.xlsx
3111 forums/xlsx/forum-mso-en4-629391.xlsx
3928 forums/xlsx/forum-mso-en4-353197.xlsx
4501 forums/xlsx/forum-mso-en4-544866.xlsx
4801 forums/xlsx/forum-mso-en4-606285.xlsx
6552 forums/xlsx/forum-mso-en4-606274.xlsx
6119 forums/xlsx/forum-mso-en4-70163.xlsx
6101 forums/xlsx/forum-mso-en4-183459.xlsx
5500 forums/xlsx/forum-mso-en4-112469.xlsx
5253 forums/xlsx/forum-mso-en4-606289.xlsx
5176 forums/xlsx/forum-mso-de-62049.xlsx

ScInterpreter::ScCountIfs
977 forums/xls/forum-mso-en4-253817.xls
1067 forums/xls/forum-mso-en4-102869.xls
1052 forums/xls/forum-mso-en4-254291.xls
1080 forums/xls/forum-mso-en4-102992.xls
1468 forums/xls/forum-mso-en4-76565.xls
1611 forums/xls/forum-mso-en4-253599.xls
2606 forums/xls/forum-mso-en4-495011.xls
2846 forums/xlsx/forum-mso-en4-253503.xlsx
2925 forums/xlsx/forum-mso-en4-433106.xlsx
3097 forums/xlsx/forum-mso-en4-554783.xlsx
3183 forums/xlsx/forum-mso-en4-688373.xlsx
3207 forums/xlsx/forum-mso-en4-606117.xlsx
3344 forums/xlsx/forum-mso-de-103125.xlsx
3660 forums/xlsx/forum-mso-en4-799216.xslx
3798 forums/xlsx/forum-mso-en4-561782.xslx
3853 forums/xlsx/forum-mso-en4-623773.xslx
3876 forums/xlsx/forum-mso-en4-258065.xslx
4001 forums/xlsx/forum-mso-en4-688266.xlsx
4086 forums/xlsx/forum-mso-en4-335212.xlsx
4213 forums/xlsx/forum-mso-en4-614547.xlsx
4471 forums/xlsx/forum-mso-en4-253934.xlsx
4604 forums/xlsx/forum-mso-en4-394112.xlsx

ScFormulaCell::MaybeInterpret()
891 forums/xls/forum-mso-de-48401.xls
2679 forums/xlsx/forum-mso-en4-237685.xlsx
2735 forums/xlsx/forum-mso-en4-271721.xlsx
3354 forums/xlsx/forum-mso-en4-237668.xlsx
3748 forums/xlsx/forum-mso-en4-314789.xslx
6837 forums/xlsx/forum-mso-en4-264966.xlsx
6480 forums/xlsx/forum-mso-en4-264977.xlsx
5577 forums/xlsx/forum-mso-en4-457928.xlsx
5217 forums/xlsx/forum-mso-en4-604336.xlsx
5053 forums/xlsx/forum-mso-en4-784502.xlsx
4935 forums/xlsx/forum-mso-en4-184573.xlsx
4813 forums/xlsx/forum-mso-en4-264966.xlsx

Scinterpreter::IterateParametersIfs
6505 forums/xlsx/forum-mso-en4-495026.xlsx
6486 forums/xlsx/forum-mso-en4-602328.xlsx
6477 forums/xlsx/forum-mso-en4-688411.xlsx
6266 forums/xlsx/forum-mso-en4-487034.xlsx
5641 forums/xlsx/forum-mso-en4-654001.xlsx
5618 forums/xlsx/forum-mso-en4-257571.xlsx
5609 forums/xlsx/forum-mso-en4-688409.xlsx
5446 forums/xlsx/forum-mso-en4-340908.xlsx
5428 forums/xlsx/forum-mso-en4-702161.xlsx
3426 forums/xlsx/forum-mso-en4-702177.xlsx

SwSubFont::GetTextSize_
629 forums/docx/forum-mso-de-118466.docx
641 forums/docx/forum-mso-de-76224.docx
649 forums/docx/forum-mso-de-118517.docx
656 forums/docx/forum-mso-de-118440.docx
664 forums/docx/forum-mso-de-118507.docx
679 forums/docx/forum-mso-de-118414.docx

SwSortedObjs::Insert
 -> bisected to https://gerrit.libreoffice.org/c/core/+/136192 (noted
there)
672 forums/docx/forum-mso-en-9381.docx
666 forums/docx/forum-mso-en4-137999.docx
7704 bugtrackers/docx/fdo45193-1.docx
7671 bugtrackers/docx/fdo45195-1.docx

ScTokenArray::ImplGetReference from ReadQsi
889 forums/forum-mso-en4-69844.xls
1338 forums/forum-mso-en4-69589.xls
1788 forums/forum-mso-en4-69308.xls

ScFilterDescriptorBase::setFilterFields
6464 forums/xlsx/forum-mso-en4-334072.xlsx
5722 forums/xlsx/forum-mso-en4-100882.xlsx

ScCountIfCellIterator<::GetCount()
790 forums/xls/forum-mso-en4-75791.xls
835 forums/xls/forum-mso-en4-601987.xls

SwTable::ConvertSubtableBox
 -> bisected to https://gerrit.libreoffice.org/c/core/+/141079
1842 bugtrackers/sxw/ooo27428-1.sxw
1620 bugtrackers/odt/ooo98643-1.odt

XclExpFmlaCompImpl::RecalcTokenClass
2849 forums/xlsx/forum-mso-en4-253503.xlsx
4613 forums/xlsx/forum-mso-en4-568971.xlsx

sw::CalcBreaks
653 forums/docx/forum-mso-en-4208.docx
   -> https://gerrit.libreoffice.org/c/core/+/127015 
   -> https://gerrit.libreoffice.org/c/core/+/127127
I suspect the SwSubFont::GetTextSize_ are similar
   -> https://bugs.documentfoundation.org/show_bug.cgi?id=152038

sw::m

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - sw/inc sw/qa sw/source

2023-01-17 Thread Attila Bakos (NISZ) (via logerrit)
 sw/inc/textboxhelper.hxx|   19 +
 sw/inc/unomid.h |3 
 sw/inc/unoprnms.hxx |1 
 sw/qa/extras/layout/data/TextBoxFrame.odt   |binary
 sw/qa/extras/layout/layout2.cxx |   41 
 sw/qa/uitest/data/ComplexGroupShapeTest.odt |binary
 sw/qa/uitest/writer_tests2/ComplexGroupShapeTest.py |  127 
 sw/source/core/doc/docdraw.cxx  |   56 -
 sw/source/core/doc/textboxhelper.cxx|  203 +++-
 sw/source/core/draw/dcontact.cxx|6 
 sw/source/core/draw/dview.cxx   |9 
 sw/source/core/unocore/unodraw.cxx  |   77 +--
 sw/source/core/unocore/unomap.cxx   |3 
 13 files changed, 495 insertions(+), 50 deletions(-)

New commits:
commit d4b87c11b451cb08aa950e09efed3cc6fa1422f3
Author: Attila Bakos (NISZ) 
AuthorDate: Tue Nov 30 15:38:26 2021 +0100
Commit: Miklos Vajna 
CommitDate: Tue Jan 17 09:24:00 2023 +

tdf#143574 sw: textboxes in group shapes -- part 4

A new UNO property has been added and implemented
for the filters. This provides the possibility of
assigning textboxes in the filter at import time via UNO.

Follow-up to commit e5650de86072b9db586a4532b5239acda77598c4
"tdf#143574 sw: textboxes in group shapes - part 3 take 2".

Change-Id: I58c445cb7f6d865c1d82dbe68f985e4c11ff832e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126162
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143366
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx
index 924b3e6b5c91..1a0cadabc0e9 100644
--- a/sw/inc/textboxhelper.hxx
+++ b/sw/inc/textboxhelper.hxx
@@ -60,6 +60,9 @@ public:
 /// the original text in the shape will be copied to the frame
 /// The textbox is created for the shape given by the pObject parameter.
 static void create(SwFrameFormat* pShape, SdrObject* pObject, bool 
bCopyText = false);
+/// Sets the given textframe as textbox for the given (group member) shape.
+static void set(SwFrameFormat* pShape, SdrObject* pObject,
+css::uno::Reference xNew);
 /// Destroy a TextBox for a shape. If the format has more textboxes
 /// like group shapes, it will destroy only that textbox what belongs
 /// to the given pObject shape.
diff --git a/sw/inc/unomid.h b/sw/inc/unomid.h
index d249b32fc25a..9f413509ae1c 100644
--- a/sw/inc/unomid.h
+++ b/sw/inc/unomid.h
@@ -151,6 +151,9 @@
 // SwFormatFollowTextFlow
 #define MID_FOLLOW_TEXT_FLOW0
 
+#define MID_TEXT_BOX0
+#define MID_TEXT_BOX_CONTENT1
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 3a8df7c69182..bb3ee1f47b3c 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -74,6 +74,7 @@
 #define UNO_NAME_FOOTER_RIGHT_MARGIN "FooterRightMargin"
 #define UNO_NAME_TEXT_RANGE "TextRange"
 #define UNO_NAME_TEXT_BOX "TextBox"
+#define UNO_NAME_TEXT_BOX_CONTENT "TextBoxContent"
 #define UNO_NAME_NAME "Name"
 #define UNO_NAME_CHAR_STYLE_NAME "CharStyleName"
 #define UNO_NAME_ANCHOR_CHAR_STYLE_NAME "AnchorCharStyleName"
diff --git a/sw/qa/extras/layout/data/TextBoxFrame.odt 
b/sw/qa/extras/layout/data/TextBoxFrame.odt
new file mode 100644
index ..a6155e34fdfb
Binary files /dev/null and b/sw/qa/extras/layout/data/TextBoxFrame.odt differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 466f640b..9fd595eafefc 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -1647,6 +1647,47 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf141220)
 CPPUNIT_ASSERT_LESS(static_cast(15), nTextBoxTop - nShapeTop);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, TestTextBoxChangeViaUNO)
+{
+CPPUNIT_ASSERT(createSwDoc(DATA_DIRECTORY, "TextBoxFrame.odt"));
+// this file has a shape and a frame inside. Try to set up
+// the frame for the shape as textbox. Before this was not
+// implemented. This will be necesary for proper WPG import.
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There must be a shape and a frame!", 2, 
getShapes());
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("This must be a custom shape!",
+ OUString("com.sun.star.drawing.CustomShape"),
+ getShape(1)->getShapeType());
+CPPUNIT_ASSERT_EQUAL_MESSAGE("This must be a frame shape!", 
OUString("FrameShape"),
+ getShape(2)->getShapeType());
+
+CPPUNIT_ASSERT_MESSAGE("This is not supposed to be a textbox!",
+   !uno::Reference(getShape(1), 
uno::UNO_QUERY_THROW)
+->

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - include/oox oox/source sw/qa writerfilter/source

2023-01-17 Thread Attila Bakos (NISZ) (via logerrit)
 include/oox/shape/ShapeContextHandler.hxx |5 +-
 oox/source/drawingml/shape.cxx|2 
 oox/source/shape/ShapeContextHandler.cxx  |8 ++-
 oox/source/shape/WpgContext.cxx   |   45 +-
 oox/source/shape/WpgContext.hxx   |8 ++-
 sw/qa/extras/ooxmlexport/data/testWPGtextboxes.docx   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx|   21 
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |7 +-
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |2 
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx |4 -
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx |7 +-
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx |7 ++
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |4 +
 13 files changed, 92 insertions(+), 28 deletions(-)

New commits:
commit b5034017e566cd4e5a236bf59555196598fd01cf
Author: Attila Bakos (NISZ) 
AuthorDate: Wed Nov 10 14:10:11 2021 +0100
Commit: Miklos Vajna 
CommitDate: Tue Jan 17 09:24:12 2023 +

tdf#143574 OOXML export/import of textboxes in group shapes

In this part, oox module has been modified in order to prepare
for WPG handling during OOXML import. Note: Wpg is the drawingML
equivalent of v:group, supporting text boxes in the group.

1) Added new parameter for WpgContext to support nested
Wpg shapes, and WPS enabled for the WPG member shapes.

2) A bug has fixed, where group member line shape and
connector shapes have wrong positions before in the group.

3) Unit tests had to be modified, and 3 of them disabled
temporarily due to missing Writerfilter implementation (what
will be the next commit)

Now group shapes can have textboxes and the text is imported
for that, but complex content is still missing (this will be
fixed in writerfilter by the next commit).

Known issue: WPG shapes with textboxes in floating table
have issues during import at floating table conversion, so until
this is not fixed this function is disabled for shapes in tables
(will be fixed a follow-up commit later).

Follow-up to commit 19394a924fdc486202ca27e318385287eb0df26f
"tdf#143574 sw: textboxes in group shapes -- part 4".

Change-Id: I71032187697807087bd8f27f7c3a7b052e174bd7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124964
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143367
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/include/oox/shape/ShapeContextHandler.hxx 
b/include/oox/shape/ShapeContextHandler.hxx
index dadaf7f64cb3..fcd713e4c5a6 100644
--- a/include/oox/shape/ShapeContextHandler.hxx
+++ b/include/oox/shape/ShapeContextHandler.hxx
@@ -96,6 +96,9 @@ public:
 
 void setPosition(const css::awt::Point& rPosition);
 
+const bool& getFullWPGSupport() { return m_bFullWPGSUpport; };
+void setFullWPGSupport(const bool& rbUse) { m_bFullWPGSUpport = rbUse; };
+
 void setDocumentProperties(const 
css::uno::Reference& xDocProps);
 void setMediaDescriptor(const 
css::uno::Sequence& rMediaDescriptor);
 
@@ -110,7 +113,7 @@ private:
 
 ::sal_uInt32 mnStartToken;
 css::awt::Point maPosition;
-
+bool m_bFullWPGSUpport;
 drawingml::ShapePtr mpShape;
 std::shared_ptr< vml::Drawing > mpDrawing;
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 7740c2e153be..2343f8b3b027 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1567,7 +1567,7 @@ Reference< XShape > const & Shape::createAndInsert(
 // These can have a custom geometry, so position should be set here,
 // after creation but before custom shape handling, using the position
 // we got from the caller.
-if (mbWps && aServiceName == "com.sun.star.drawing.LineShape")
+if (mbWps && aServiceName == "com.sun.star.drawing.LineShape" && 
!pParentGroupShape)
 mxShape->setPosition(maPosition);
 
 if( bIsCustomShape )
diff --git a/oox/source/shape/ShapeContextHandler.cxx 
b/oox/source/shape/ShapeContextHandler.cxx
index 09b7d8613ce9..8aa5aad6d869 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -47,7 +47,9 @@ using namespace drawingml;
 
 ShapeContextHandler::ShapeContextHandler(const 
rtl::Reference& xFilterBase) :
   mnStartToken(0),
+  m_bFullWPGSUpport(false),
   mxShapeFilterBase(xFilterBase)
+
 {
 }
 
@@ -139,8 +141,12 @@ uno::Reference const & 
ShapeContextHandler::getWp
 switch (getBaseToken(nElement))
 {
 case XML_wgp:
-mxWpgContext.set(static_cast(new 
WpgContext(*rFragmentHandler)));
+{
+rtl::Reference rContext = new 
WpgContext(*rFragmentHandler

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - sw/inc sw/qa sw/source xmloff/qa

2023-01-17 Thread Attila Bakos (NISZ) (via logerrit)
 sw/inc/frmfmt.hxx |6 
 sw/inc/textboxhelper.hxx  |   26 -
 sw/qa/extras/ooxmlexport/data/Tdf147485.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx|6 
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |   18 -
 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/DocumentLayoutManager.cxx  |8 
 sw/source/core/doc/docdraw.cxx|   29 +-
 sw/source/core/doc/textboxhelper.cxx  |  373 --
 sw/source/core/draw/dcontact.cxx  |2 
 sw/source/core/frmedt/feshview.cxx|8 
 sw/source/core/layout/atrfrm.cxx  |   31 --
 sw/source/core/text/porfly.cxx|   56 ---
 sw/source/core/undo/undobj1.cxx   |   22 -
 sw/source/core/undo/undraw.cxx|   32 +-
 xmloff/qa/unit/draw.cxx   |2 
 18 files changed, 417 insertions(+), 338 deletions(-)

New commits:
commit 044c63c631f0af832aa8452bc4a8b0b38dc91c23
Author: Attila Bakos (NISZ) 
AuthorDate: Wed Mar 30 13:05:37 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jan 17 09:24:56 2023 +

tdf#147485 sw: fix group shape crash using std::shared_ptr

for SwFrameFormat::m_pOtherTextBoxeFormats.
Before there was broken manual handling of this
member, resulting random crashes.

Details: Writer textboxes are textframe + shape
pairs. Accordingly the shape has a draw format,
the frame has a fly format. In case of group
shapes the paired structure doesn't work, because
there is one shape format and many fly formats.
To handle this there is a class (SwTextBoxNode)
which has a small frame format table inside.
This cache gives the possibility to handle
each frame shape pairs inside the group depending
on what SdrObject owns that textbox.

However there is another place where these formats
stored, namely the SpzFrameFormatTable in SwDoc.
The only problem is that, when a flyframe removed,
it has to be deleted from both tables, but if the
DelLayoutFormat() is called, that will call the
~FrameFormat(), and if the format already deleted
from the SwTextBoxNode, there will be double deleting
for the same address, which caused the crash.

To avoid this the following is present:

When fly deletion occurs, first the format is
deleted from the doc, then via the ~SwFrameFomat()
will be deleted from the TextBoxNode. If the deleted
format is a drawing, the whole node will be destructed
via the shared_ptr. Hopefully that will be fine,
without any leak.

Change-Id: I007724695bc035998cb35efeefecd308aae36e85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132308
Reviewed-by: László Németh 
Tested-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143369
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 59aee54a2f4a..808bbb482e5d 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -74,7 +74,7 @@ class SW_DLLPUBLIC SwFrameFormat
 // The assigned SwFrmFmt list.
 SwFrameFormats *m_ffList;
 
-SwTextBoxNode* m_pOtherTextBoxFormat;
+std::shared_ptr< SwTextBoxNode > m_pOtherTextBoxFormats;
 
 struct change_name
 {
@@ -102,8 +102,8 @@ protected:
 
 public:
 
-SwTextBoxNode* GetOtherTextBoxFormat() const { return 
m_pOtherTextBoxFormat; };
-void SetOtherTextBoxFormat(SwTextBoxNode* pNew) { m_pOtherTextBoxFormat = 
pNew; };
+const std::shared_ptr< SwTextBoxNode >& GetOtherTextBoxFormats() const { 
return m_pOtherTextBoxFormats; };
+void SetOtherTextBoxFormats(const std::shared_ptr& rNew) { 
m_pOtherTextBoxFormats = rNew; };
 
 virtual ~SwFrameFormat() override;
 
diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx
index fd194a639bcc..a389634c60eb 100644
--- a/sw/inc/textboxhelper.hxx
+++ b/sw/inc/textboxhelper.hxx
@@ -214,7 +214,7 @@ public:
 ~SwTextBoxNode();
 
 // default copy ctor is enough
-SwTextBoxNode(SwTextBoxNode&) = default;
+SwTextBoxNode(const SwTextBoxNode&) = default;
 
 // This method adds a textbox entry to the shape
 // Parameters:
@@ -225,7 +225,12 @@ public:
 // This will remove the textbox entry.
 // Parameters:
 // pDrawObject: The shape which have the textbox to be deleted.
-void DelTextBox(const SdrObject* pDrawObject);
+void DelTextBox(const SdrObject* pDrawObject, bool bDelFromDoc = false);
+
+// This will remove the textbox entry.
+// Parameters:
+// pTextBox: The textbox what have to be deleted.
+void DelTextBox(const SwFrameFormat* pTextBox, bool bDelFromDoc = false);
 
 // This will return with the frame format of the textbox what belon

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/inc sw/qa sw/source

2023-01-17 Thread Attila Bakos (NISZ) (via logerrit)
 sw/inc/textboxhelper.hxx |   11 +++
 sw/qa/extras/uiwriter/data/tdf149550.docx|binary
 sw/qa/extras/uiwriter/uiwriter4.cxx  |   25 
 sw/source/core/doc/DocumentLayoutManager.cxx |   65 +
 sw/source/core/doc/textboxhelper.cxx |   81 ++-
 5 files changed, 120 insertions(+), 62 deletions(-)

New commits:
commit d981737bcebf825949cd8b13c2c609a109abc984
Author: Attila Bakos (NISZ) 
AuthorDate: Tue Jun 14 10:38:46 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jan 17 09:25:29 2023 +

tdf#149550 sw: fix crash by implementing nested textbox copy

Grouped shapes with a nested textbox were copied without
the textbox with frequent crashing.

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

Change-Id: Ie2cc24f10706d8999026dc92ebad21f2c5673003
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135815
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143370
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx
index a389634c60eb..b0ab5618b466 100644
--- a/sw/inc/textboxhelper.hxx
+++ b/sw/inc/textboxhelper.hxx
@@ -27,6 +27,7 @@ class SdrObject;
 class SfxItemSet;
 class SwFrameFormat;
 class SwFrameFormats;
+class SwFormatAnchor;
 class SwFormatContent;
 class SwDoc;
 namespace tools
@@ -204,6 +205,8 @@ class SwTextBoxNode
 // (and the textboxes)
 SwFrameFormat* m_pOwnerShapeFormat;
 
+mutable bool m_bIsCloningInProgress;
+
 public:
 // Not needed.
 SwTextBoxNode() = delete;
@@ -251,6 +254,14 @@ public:
 size_t GetTextBoxCount() const { return m_pTextBoxes.size(); };
 // Returns with a const collection of textboxes owned by this node.
 std::map GetAllTextBoxes() const;
+
+void Clone(SwDoc* pDoc, const SwFormatAnchor& rNewAnc, SwFrameFormat* 
o_pTarget, bool bSetAttr,
+   bool bMakeFrame) const;
+
+private:
+void Clone_Impl(SwDoc* pDoc, const SwFormatAnchor& rNewAnc, SwFrameFormat* 
o_pTarget,
+const SdrObject* pSrcObj, SdrObject* pDestObj, bool 
bSetAttr,
+bool bMakeFrame) const;
 };
 
 #endif // INCLUDED_SW_INC_TEXTBOXHELPER_HXX
diff --git a/sw/qa/extras/uiwriter/data/tdf149550.docx 
b/sw/qa/extras/uiwriter/data/tdf149550.docx
new file mode 100644
index ..3434fc1fff93
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf149550.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx 
b/sw/qa/extras/uiwriter/uiwriter4.cxx
index fc7bd27e3124..76f0506d52fa 100644
--- a/sw/qa/extras/uiwriter/uiwriter4.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter4.cxx
@@ -292,6 +292,7 @@ public:
 void testInsertPdf();
 void testTdf143760WrapContourToOff();
 void testHatchFill();
+void testNestedGroupTextBoxCopyCrash();
 
 CPPUNIT_TEST_SUITE(SwUiWriterTest4);
 CPPUNIT_TEST(testTdf96515);
@@ -417,6 +418,7 @@ public:
 CPPUNIT_TEST(testInsertPdf);
 CPPUNIT_TEST(testTdf143760WrapContourToOff);
 CPPUNIT_TEST(testHatchFill);
+CPPUNIT_TEST(testNestedGroupTextBoxCopyCrash);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -4140,6 +4142,29 @@ void SwUiWriterTest4::testHatchFill()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(30), getProperty(getShape(1), 
"FillTransparence"));
 }
 
+void SwUiWriterTest4::testNestedGroupTextBoxCopyCrash()
+{
+createSwDoc(DATA_DIRECTORY, "tdf149550.docx");
+
+dispatchCommand(mxComponent, ".uno:SelectAll", {});
+Scheduler::ProcessEventsToIdle();
+dispatchCommand(mxComponent, ".uno:Copy", {});
+Scheduler::ProcessEventsToIdle();
+// This crashed here before the fix.
+SwXTextDocument* pXTextDocument = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pXTextDocument);
+pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_ESCAPE);
+Scheduler::ProcessEventsToIdle();
+dispatchCommand(mxComponent, ".uno:Paste", {});
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_MESSAGE("Where is the doc, it crashed, isn't it?!", 
mxComponent);
+
+auto pLayout = parseLayoutDump();
+// There must be 2 textboxes!
+assertXPath(pLayout, "/root/page/body/txt/anchored/fly[2]");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest4);
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx 
b/sw/source/core/doc/DocumentLayoutManager.cxx
index 006501b3aa36..a03d5dc1d60d 100644
--- a/sw/source/core/doc/DocumentLayoutManager.cxx
+++ b/sw/source/core/doc/DocumentLayoutManager.cxx
@@ -463,67 +463,6 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat(
 if( bMakeFrames )
 pDest->MakeFrames();
 
-// If the draw format has a TextBox, then copy its fly format as well.
-if (rSource.Which() == RES_DRAWFRMFMT && rSource.GetOtherTextBoxFormats

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa sw/source

2023-01-17 Thread Attila Bakos (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/data/testWPGZOrder.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx   |4 -
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx   |   49 +++
 sw/source/core/doc/textboxhelper.cxx |   15 ---
 sw/source/core/draw/dcontact.cxx |8 +++
 5 files changed, 68 insertions(+), 8 deletions(-)

New commits:
commit 0cb370d02bebf6a9d65b5852815e2c617b33a89a
Author: Attila Bakos (NISZ) 
AuthorDate: Tue Jan 11 12:09:46 2022 +0100
Commit: Miklos Vajna 
CommitDate: Tue Jan 17 09:26:33 2023 +

Related tdf#66039 DOCX import: fix Z-order of group shapes

A missing function resulted covered textboxes which weren't
visible in group shapes.

Follow-up to 121cbc250b36290f0f8c7265fea57256dad69553
"tdf#66039 DOCX: import textboxes (with tables, images etc.)
in group shapes".

Change-Id: I08eb1c1cf4a4f4769af8812500b9cf9778b01e9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128279
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143372
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/data/testWPGZOrder.docx 
b/sw/qa/extras/ooxmlexport/data/testWPGZOrder.docx
new file mode 100644
index ..664f47a0b623
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/testWPGZOrder.docx 
differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index e23a42bf4983..3dafae143432 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -116,9 +116,9 @@ protected:
 
 DECLARE_OOXMLEXPORT_TEST(testWPGtextboxes, "testWPGtextboxes.docx")
 {
-CPPUNIT_ASSERT_EQUAL(1, getShapes());
+CPPUNIT_ASSERT_EQUAL(2, getShapes());
 
-auto MyShape = getShape(1);
+auto MyShape = getShape(2);
 CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), 
MyShape->getShapeType());
 
 uno::Reference xGroup(MyShape, uno::UNO_QUERY_THROW);
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index 395f0dbf03fc..42b7a0891877 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 #include 
@@ -28,6 +29,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -390,6 +392,53 @@ DECLARE_OOXMLEXPORT_TEST(testTdf126287, "tdf126287.docx")
 CPPUNIT_ASSERT_EQUAL(2, getPages());
 }
 
+DECLARE_OOXMLEXPORT_TEST(TestWPGZOrder, "testWPGZOrder.docx")
+{
+// Check if the load failed.
+CPPUNIT_ASSERT(mxComponent);
+
+// Get the WPG
+uno::Reference xGroup(getShape(1), uno::UNO_QUERY_THROW);
+uno::Reference xGroupProperties(xGroup, 
uno::UNO_QUERY_THROW);
+
+// Initialize a queue for subgroups
+std::queue> xGroupList;
+xGroupList.push(xGroup);
+
+// Every textbox shall be visible.
+while (xGroupList.size())
+{
+// Get the first group
+xGroup = xGroupList.front();
+xGroupList.pop();
+for (sal_Int32 i = 0; i < xGroup->getCount(); ++i)
+{
+// Get the child shape
+uno::Reference 
xChildShapeProperties(xGroup->getByIndex(i),
+uno::UNO_QUERY_THROW);
+// Check for textbox
+if 
(!xChildShapeProperties->getPropertyValue("TextBox").get())
+{
+// Is this a Group Shape? Put it into the queue.
+uno::Reference 
xInnerGroup(xGroup->getByIndex(i), uno::UNO_QUERY);
+if (xInnerGroup)
+xGroupList.push(xInnerGroup);
+continue;
+}
+
+// Get the textbox properties
+uno::Reference xTextBoxFrameProperties(
+xChildShapeProperties->getPropertyValue("TextBoxContent"), 
uno::UNO_QUERY_THROW);
+
+// Assert that the textbox ZOrder greater than the groupshape
+
CPPUNIT_ASSERT_GREATER(xGroupProperties->getPropertyValue("ZOrder").get(),
+
xTextBoxFrameProperties->getPropertyValue("ZOrder").get());
+// Before the fix, this failed because that was less, and the 
textboxes were covered.
+}
+
+}
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf123642_BookmarkAtDocEnd, "tdf123642.docx")
 {
 // get bookmark interface
diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index bcdf25002305..bb1d6f331dbc 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -1432,15 +1432,20 @@ bool 
SwTextBoxHelper::DoTextBoxZOrderCorrection(SwFrameFormat* pShape, const Sdr
 {
 // TODO: do this with group shape textboxes.
 SdrObject* pShpObj = nullptr;
-//if (pObj)
-//pShpObj = pObj;
-//else
+
 pShpObj

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa writerfilter/inc writerfilter/source

2023-01-17 Thread Attila Bakos (NISZ) (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf66039.docx   |binary
 sw/qa/extras/ooxmlexport/ooxmlexport10.cxx|   30 +--
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx|   12 +++
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |   22 ++---
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |2 
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx |   11 +-
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx |   22 ++---
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   14 +--
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx |   13 +--
 writerfilter/inc/dmapper/resourcemodel.hxx|7 +
 writerfilter/source/dmapper/DomainMapper.cxx  |   11 ++
 writerfilter/source/dmapper/DomainMapper.hxx  |3 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   69 +-
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |   10 ++
 writerfilter/source/dmapper/FontTable.hxx |2 
 writerfilter/source/dmapper/GraphicImport.hxx |2 
 writerfilter/source/dmapper/LoggedResources.cxx   |4 +
 writerfilter/source/dmapper/LoggedResources.hxx   |4 +
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |   23 +-
 writerfilter/source/ooxml/OOXMLFastContextHandler.hxx |1 
 20 files changed, 207 insertions(+), 55 deletions(-)

New commits:
commit c4f3aa127ad33fe691b00336cdc9d6c88a9ebfb9
Author: Attila Bakos (NISZ) 
AuthorDate: Thu Nov 11 14:02:12 2021 +0100
Commit: Mike Kaganski 
CommitDate: Tue Jan 17 09:29:15 2023 +

tdf#66039 DOCX: import textboxes (with tables, images etc.) in group shapes

Text boxes in group shapes were imported as shapes, losing
complex text content: tables (tdf#66039), colors (tdf#73022),
images (tdf#81958), lists, paragraph styles, hyperlinks
(tdf#122960) and track changes.

Note: a few unit tests have been deactivated temporarily.
Test document "groupshape-trackedchanges.docx" of
testGroupshapeTrackedchanges is imported correctly now:
with track changes, and the test was modified accordingly.

Follow-up to commit 2951cbdf3a6e2b62461665546b47e1d253fcb834
"tdf#143574 OOXML export/import of textboxes in group shapes".

Change-Id: I6eb918dbf64393fd723fe43f798f93b5b9a12575
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125051
Tested-by: László Németh 
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143371
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf66039.docx 
b/sw/qa/extras/ooxmlexport/data/tdf66039.docx
new file mode 100644
index ..f17032b3f90b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf66039.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 3dafae143432..cfeafa71170b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -439,13 +439,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf59274)
 // This was 3674: too wide last cell in first row
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[4]/w:tcPr/w:tcW", "w", "1695");
 }
-
-DECLARE_OOXMLEXPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx")
-{
-uno::Reference xGroupShape(getShape(1), uno::UNO_QUERY);
-// The text in the groupshape was missing due to the w:sdt and 
w:sdtContent wrapper around it.
-CPPUNIT_ASSERT_EQUAL(OUString("sdt and sdtContent inside groupshape"), 
uno::Reference(xGroupShape->getByIndex(1), 
uno::UNO_QUERY_THROW)->getString());
-}
+//FIXME:
+//DECLARE_OOXMLEXPORT_TEST(testDMLGroupshapeSdt, "dml-groupshape-sdt.docx")
+//{
+//uno::Reference xGroupShape(getShape(1), 
uno::UNO_QUERY);
+//// The text in the groupshape was missing due to the w:sdt and 
w:sdtContent wrapper around it.
+//CPPUNIT_ASSERT_EQUAL(OUString("sdt and sdtContent inside groupshape"), 
uno::Reference(xGroupShape->getByIndex(1), 
uno::UNO_QUERY_THROW)->getString());
+//}
 
 DECLARE_OOXMLEXPORT_TEST(testDmlCharheightDefault, 
"dml-charheight-default.docx")
 {
@@ -745,9 +745,21 @@ DECLARE_OOXMLEXPORT_TEST(testCaption, "caption.docx")
 DECLARE_OOXMLEXPORT_TEST(testGroupshapeTrackedchanges, 
"groupshape-trackedchanges.docx")
 {
 uno::Reference xGroup(getShape(1), uno::UNO_QUERY);
-uno::Reference xShape(xGroup->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xShape(xGroup->getByIndex(0), 
uno::UNO_QUERY);
 // Shape text was completely missing, ensure inserted text is available.
-CPPUNIT_ASSERT_EQUAL(OUString(" Inserted"), xShape->getString());
+uno::Reference xText
+= uno::Reference(xShape, 
uno::UNO_QUERY_THROW)->getText();
+auto xParagraph = getParagraphOfText(1, xText);
+
+CPPUNIT_ASSERT(hasProperty(getRun(xParagraph, 1), "RedlineType"));
+CPPUNIT_ASSERT_EQUAL(OUString("Delete"),
+  

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

2023-01-17 Thread Radhey Parekh (via logerrit)
 framework/inc/strings.hrc   |1 +
 framework/source/fwe/helper/titlehelper.cxx |5 -
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit f7d4efc02118a92a3f3cb17ea131674e88907a7b
Author: Radhey Parekh 
AuthorDate: Mon Jan 16 02:13:53 2023 +0530
Commit: Heiko Tietze 
CommitDate: Tue Jan 17 09:35:31 2023 +

tdf#146638 In a titlebar, separator is changed from a hyphen to an emdash

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

diff --git a/framework/inc/strings.hrc b/framework/inc/strings.hrc
index 18b372915b9b..182c3cf120ac 100644
--- a/framework/inc/strings.hrc
+++ b/framework/inc/strings.hrc
@@ -36,6 +36,7 @@
 #define STR_CLEAR_RECENT_FILES  
NC_("STR_CLEAR_RECENT_FILES", "Clear List")
 #define STR_CLEAR_RECENT_FILES_HELP 
NC_("STR_CLEAR_RECENT_FILES_HELP", "Clears the list with the most recently 
opened files. This action can not be undone.")
 #define STR_REMOTE_TITLENC_("STR_REMOTE_TITLE", " 
(Remote)")
+#define STR_EMDASH_SEPARATOR
NC_("STR_EMDASH_SEPARATOR", " — ")
 #define STR_SAFEMODE_TITLE  NC_("STR_SAFEMODE_TITLE", 
" (Safe Mode)")
 #define STR_TOOLBAR_TITLE_ADDON 
NC_("STR_TOOLBAR_TITLE_ADDON", "Add-On %num%")
 #define STR_FULL_DISC_RETRY_BUTTON  
NC_("STR_FULL_DISC_RETRY_BUTTON", "Retry" )
diff --git a/framework/source/fwe/helper/titlehelper.cxx 
b/framework/source/fwe/helper/titlehelper.cxx
index aa4e8f0b2010..51025f71e4a5 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -536,7 +536,10 @@ void TitleHelper::impl_appendProductName (OUStringBuffer& 
sTitle)
 if (!name.isEmpty())
 {
 if (!sTitle.isEmpty())
-sTitle.append(" - ");
+{
+OUString separator (FwkResId (STR_EMDASH_SEPARATOR));
+sTitle.append(separator);
+}
 sTitle.append(name);
 }
 }


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

2023-01-17 Thread Tünde Tóth (via logerrit)
 sd/source/ui/docshell/sdclient.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit fdf95de18ef1891862bdce26669d1ce2c6f24764
Author: Tünde Tóth 
AuthorDate: Fri Jan 13 09:54:00 2023 +0100
Commit: László Németh 
CommitDate: Tue Jan 17 10:00:46 2023 +

tdf#152991 sd: fix oversized rectangle of edited embedded object

The embedded object became unusably oversized after editing,
because it was not possible to minimize it by the mouse. Now
the object keeps its original size to avoid of the UX problem.

Note: losing the original zoom of the OLE content is still a problem.

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

diff --git a/sd/source/ui/docshell/sdclient.cxx 
b/sd/source/ui/docshell/sdclient.cxx
index 02521c2575ad..c7f79c3ea813 100644
--- a/sd/source/ui/docshell/sdclient.cxx
+++ b/sd/source/ui/docshell/sdclient.cxx
@@ -143,6 +143,13 @@ void Client::ViewChanged()
 if (!pView)
 return;
 
+// Do not recalculate the visareasize if the embedded object is opening in 
a new window.
+if (!IsObjectInPlaceActive())
+{
+pSdrOle2Obj->BroadcastObjectChange();
+return;
+}
+
 ::tools::Rectangle aLogicRect( pSdrOle2Obj->GetLogicRect() );
 Size aLogicSize( aLogicRect.GetWidth(), aLogicRect.GetHeight() );
 


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

2023-01-17 Thread Mike Kaganski (via logerrit)
 vcl/source/bitmap/BitmapTools.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit ebac691388ed71aafd0aaa78efc5810a68486b7f
Author: Mike Kaganski 
AuthorDate: Tue Jan 17 11:27:25 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jan 17 10:06:56 2023 +

Reset BitmapWriteAccess before further bitmap use

It started failing an assertion recently (maybe after the 1-bit images
support drop in commit 21734247d58a6e915b058d8fa55ece949d049613), when
opening Styles sidebar, with this call stack:

  ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * 
file_name, unsigned int line_number) Line 444  C++
  vcllo.dll!SkiaSalBitmap::AcquireBuffer(BitmapAccessMode nMode) Line 230   
C++
  vcllo.dll!BitmapInfoAccess::BitmapInfoAccess(Bitmap & rBitmap, 
BitmapAccessMode nMode) Line 47C++
  vcllo.dll!Bitmap::AcquireInfoAccess() Line 368C++
  
vcllo.dll!vcl::ScopedBitmapAccess::ScopedBitmapAccess(Bitmap
 & rBitmap) Line 55   C++
  vcllo.dll!Bitmap::HasGreyPalette8Bit() Line 291   C++
  vcllo.dll!Bitmap::Convert(BmpConversion eConversion) Line 868 C++
  vcllo.dll!AlphaMask::AlphaMask(const Bitmap & rBitmap) Line 35C++
  vcllo.dll!BitmapEx::BitmapEx(const Bitmap & rBmp, const AlphaMask & 
rAlphaMask) Line 142  C++
  vcllo.dll!vcl::bitmap::CreateFromData(const unsigned char * pData, long 
nWidth, long nHeight, long nStride, char nBitCount, bool bReversColors, bool 
bReverseAlpha) Line 216  C++
  ...

The comment at the assert in SkiaSalBitmap::AcquireBuffer (that is called
from BitmapInfoAccess ctor) tells:

  BitmapWriteAccess stores also a copy of the palette and it can
  be modified, so concurrent reading of it might result in inconsistencies

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

diff --git a/vcl/source/bitmap/BitmapTools.cxx 
b/vcl/source/bitmap/BitmapTools.cxx
index 7c19c237d57f..164a5606debb 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -212,6 +212,9 @@ BitmapEx CreateFromData(sal_uInt8 const *pData, sal_Int32 
nWidth, sal_Int32 nHei
 }
 }
 }
+// Avoid further bitmap use with unfinished write access
+pWrite.reset();
+xMaskAcc.reset();
 if (nBitCount == 32)
 return BitmapEx(aBmp, *pAlphaMask);
 else


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

2023-01-17 Thread Michael Stahl (via logerrit)
 sw/source/core/text/redlnitr.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ee73d14e06180d8a60fc4fc34ab71f23095e7621
Author: Michael Stahl 
AuthorDate: Mon Jan 16 13:31:44 2023 +0100
Commit: Michael Stahl 
CommitDate: Tue Jan 17 10:10:59 2023 +

tdf#152872 sw: fix crash on ooo27109-1.sxw

Has a redline that ends on the body end node.

(regression from commit 2bcfb7231b5ca74f02274cfb74ca8463f78905d6)

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

diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index acf83551cba6..c44b527536c1 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -234,6 +234,7 @@ public:
 return false;
 };
 if (m_isHideParagraphBreaks
+&& m_pEndPos->GetNode().IsTextNode() // ooo27109-1.sxw
 // only merge if next node is also text node
 && 
m_pEndPos->GetNodes()[m_pEndPos->GetNodeIndex()+1]->IsTextNode()
 && hasHiddenItem(*m_pEndPos->GetNode().GetTextNode())


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

2023-01-17 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 79541a4808561fbe400cb4e0d33c8ddc23cf9d84
Author: Caolán McNamara 
AuthorDate: Mon Jan 16 21:11:04 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 17 10:13:15 2023 +

tdf#153049 use ScrollType::DontKnow for a mouse wheel spin

use has_grab() to try and distinguish these

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 09d2db890612..c051da78b969 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -8655,7 +8655,8 @@ public:
 
 virtual ScrollType get_scroll_type() const override
 {
-return ScrollType::Drag;
+// tdf#153049 want a mousewheel spin to be treated as DontKnow
+return has_grab() ? ScrollType::Drag : ScrollType::DontKnow;
 }
 
 virtual int get_scroll_thickness() const override


[Libreoffice-commits] core.git: linguistic/source offapi/com sw/inc sw/source

2023-01-17 Thread Fred Kruse (via logerrit)
 linguistic/source/gciterator.cxx  |2 ++
 offapi/com/sun/star/style/ParagraphProperties.idl |9 +
 sw/inc/cmdid.h|3 ++-
 sw/inc/unoprnms.hxx   |1 +
 sw/source/core/unocore/unocrsrhelper.cxx  |   12 
 sw/source/core/unocore/unoflatpara.cxx|   18 ++
 sw/source/core/unocore/unomapproperties.hxx   |1 +
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |1 +
 8 files changed, 46 insertions(+), 1 deletion(-)

New commits:
commit 04f15c8a8c733f159f77bd58905e4136a32b1be9
Author: Fred Kruse 
AuthorDate: Sun Jan 15 19:09:36 2023 +0100
Commit: Michael Stahl 
CommitDate: Tue Jan 17 10:17:19 2023 +

Properties SortedTextId and DocumentElementsCount added for grammar check

The LanguageTool extension (LT extension) runs not only a grammar check on 
the level of sentences and paragraphs, some rules work on the level of many 
paragraphs or full text. The LT extension uses a complex caching mechanism to 
support this feature. A mapping from a check request to the cached to the 
(flat)paragraphs is necessary. Until now, this is done by a time-consuming and 
error-prone mechanism.  The adding of the SortedTextId introduce a feature, a 
paragraph to be checked can be fast and easy identified. The flatparagraphs 
also can easily be mapped to cursors to get additional information of the 
paragraph, used for further features of LT extension.
The added Property DocumentElementsCount to flatparagraphs and 
doProofreading gives the extension the hint to recreate the cache.

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

diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 581f356f215e..1613b2dac36b 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -557,6 +557,8 @@ lcl_makeProperties(uno::Reference 
const& xFlatPara, sal_In
 return comphelper::InitPropertySequence({
 { "FieldPositions", xProps->getPropertyValue("FieldPositions") },
 { "FootnotePositions", xProps->getPropertyValue("FootnotePositions") },
+{ "SortedTextId", xProps->getPropertyValue("SortedTextId") },
+{ "DocumentElementsCount", 
xProps->getPropertyValue("DocumentElementsCount") },
 { "ProofInfo", a }
 });
 }
diff --git a/offapi/com/sun/star/style/ParagraphProperties.idl 
b/offapi/com/sun/star/style/ParagraphProperties.idl
index 9951703c8a3d..a7d6c059bd8a 100644
--- a/offapi/com/sun/star/style/ParagraphProperties.idl
+++ b/offapi/com/sun/star/style/ParagraphProperties.idl
@@ -419,6 +419,15 @@ published service ParagraphProperties
 @since LibreOffice 7.4
  */
 [optional, property] long ParaHyphenationZone;
+
+/** contains a paragraph identifier within the actual text,
+which also shows the position of the paragraph relative to the
+other paragraphs of the same text, i.e. a paragraph with lower
+identifier is there before the other ones with greater values.
+This property depends on implementation details and is considered 
experimental.
+@since LibreOffice 7.5
+ */
+[optional, property, readonly] long SortedTextId;
 };
 
 
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index c44745a0e861..02d78f338851 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -577,7 +577,8 @@ class SwUINumRuleItem;
 #define FN_UNO_FOOTER_LEFT  (FN_EXTRA2 + 39)
 #define FN_UNO_FOOTER_RIGHT (FN_EXTRA2 + 40)
 #define FN_UNO_TEXT_PARAGRAPH   (FN_EXTRA2 + 41)
-#define FN_UNO_PARENT_TEXT (FN_EXTRA2 + 42)
+#define FN_UNO_PARENT_TEXT  (FN_EXTRA2 + 42)
+#define FN_UNO_SORTED_TEXT_ID   (FN_EXTRA2 + 43)
 #define FN_UNO_FOLLOW_STYLE (FN_EXTRA2 + 59)
 
 #define FN_API_CALL 
TypedWhichId(FN_EXTRA2 + 60)
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 42a38fdef0aa..85a1938d61ce 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -412,6 +412,7 @@ inline constexpr OUStringLiteral 
UNO_NAME_FOOTER_IS_DYNAMIC_HEIGHT = u"FooterIsD
 inline constexpr OUStringLiteral UNO_NAME_FOOTER_IS_SHARED = u"FooterIsShared";
 inline constexpr OUStringLiteral UNO_NAME_TEXT_PARAGRAPH = u"TextParagraph";
 inline constexpr OUStringLiteral UNO_NAME_PARENT_TEXT = u"ParentText";
+inline constexpr OUStringLiteral UNO_NAME_SORTED_TEXT_ID = u"SortedTextId";
 
 inline constexpr OUStringLiteral UNO_NAME_FOOTER_HEIGHT = u"FooterHeight";
 inline constexpr OUStringLiteral UNO_NAME_FOOTER_IS_ON = u"FooterIsOn";
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index 04567219168f..3596e21c

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

2023-01-17 Thread Caolán McNamara (via logerrit)
 drawinglayer/source/processor2d/vclprocessor2d.cxx |5 +++-
 sw/qa/extras/layout/layout2.cxx|   23 +
 2 files changed, 10 insertions(+), 18 deletions(-)

New commits:
commit a4a31e6a7b6e84689ff5dbafbd0baf1992729495
Author: Caolán McNamara 
AuthorDate: Fri Jan 13 17:00:40 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 17 10:29:17 2023 +

tdf#152990 set the font after the MapMode is (potentially) set

Change-Id: I64617a5c85e7e6b444aac705ebbfdd777b4ea55a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145442
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit d5c8b38eab3d3766f403a33e11dffa498655be8f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145453
Reviewed-by: Xisco Fauli 
Reviewed-by: Michael Stahl 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index bd92921396ae..8bd9abadf15c 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -306,7 +306,6 @@ void 
VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
 mpOutputDevice->SetLayoutMode(nRTLLayoutMode);
 }
 
-mpOutputDevice->SetFont(aFont);
 mpOutputDevice->SetTextColor(Color(aRGBFontColor));
 
 OUString aText(rTextCandidate.getText());
@@ -364,6 +363,10 @@ void 
VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
 mpOutputDevice->SetMapMode(aMapMode);
 }
 
+// tdf#152990 set the font after the MapMode is (potentially) set 
so canvas uses the desired
+// font size
+mpOutputDevice->SetFont(aFont);
+
 if (!aDXArray.empty())
 {
 const SalLayoutGlyphs* pGlyphs = 
SalLayoutGlyphsCache::self()->GetLayoutGlyphs(
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index b8ba46bebc20..33196e019d86 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -1278,19 +1278,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126244)
 xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
 CPPUNIT_ASSERT(pXmlDoc);
 // Test the first level of vertical category axis labels orientation. The 
first level orientation should be horizontal.
-assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/font[1]", "orientation",
-"0");
+assertXPath(pXmlDoc, "(//font)[1]", "orientation", "0");
 // Test the second level of vertical category axis labels orientation. The 
second level orientation should be vertical.
-sal_Int32 nRotation
-= getXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/font[5]",
-   "orientation")
-  .toInt32();
+sal_Int32 nRotation = getXPath(pXmlDoc, "(//font)[5]", 
"orientation").toInt32();
 CPPUNIT_ASSERT(nRotation >= 899);
 CPPUNIT_ASSERT(nRotation <= 900);
 // Test the third level of vertical category axis labels orientation. The 
third level orientation should be vertical.
-nRotation = getXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/font[7]",
- "orientation")
-.toInt32();
+nRotation = getXPath(pXmlDoc, "(//font)[7]", "orientation").toInt32();
 CPPUNIT_ASSERT(nRotation >= 899);
 CPPUNIT_ASSERT(nRotation <= 900);
 }
@@ -1307,18 +1301,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127304)
 xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
 CPPUNIT_ASSERT(pXmlDoc);
 // Test the first level of horizontal category axis labels orientation. 
The first level orientation should be vertical.
-sal_Int32 nRotation
-= getXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/font[1]",
-   "orientation")
-  .toInt32();
+sal_Int32 nRotation = getXPath(pXmlDoc, "(//font)[1]", 
"orientation").toInt32();
 CPPUNIT_ASSERT(nRotation >= 899);
 CPPUNIT_ASSERT(nRotation <= 900);
 // Test the second level of horizontal category axis labels orientation. 
The second level orientation should be horizontal.
-assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/font[5]", "orientation",
-"0");
+assertXPath(pXmlDoc, "(//font)[5]", "orientation", "0");
 // Test the third level of horizontal category axis labels orientation. 
The third level orientation should be horizontal.
-assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/font[7]", "orientation",
-"0");
+assertXPath(pXmlDoc, "(//font)[7]", "orientation", "0");
 }
 
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHorizontal_multilevel)


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

2023-01-17 Thread Tünde Tóth (via logerrit)
 sc/source/ui/app/client.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit a1f16b4603bffddb2f6380874d63f928289de85a
Author: Tünde Tóth 
AuthorDate: Fri Jan 13 09:31:38 2023 +0100
Commit: László Németh 
CommitDate: Tue Jan 17 10:34:24 2023 +

tdf#152989 sc: fix oversized rectangle of edited embedded object

Editing resulted unusably oversized OLE objects. Keep
its original size to fix the UX problem.

Note: lost zoom is still a problem.

See also commit fdf95de18ef1891862bdce26669d1ce2c6f24764
"tdf#152991 sd: fix oversized rectangle of edited embedded object"

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

diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx
index 2c7fea5ab376..ea9ffa9ade9c 100644
--- a/sc/source/ui/app/client.cxx
+++ b/sc/source/ui/app/client.cxx
@@ -202,6 +202,12 @@ void ScClient::ViewChanged()
 if (!pDrawObj)
 return;
 
+if (!IsObjectInPlaceActive())
+{
+pDrawObj->ActionChanged();
+return;
+}
+
 tools::Rectangle aLogicRect = pDrawObj->GetLogicRect();
 Fraction aFractX = GetScaleWidth() * aVisSize.Width();
 Fraction aFractY = GetScaleHeight() * aVisSize.Height();


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

2023-01-17 Thread Miklos Vajna (via logerrit)
 sc/source/ui/view/viewdata.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit de0c7c099710d966725b820c0781029ab80b3cd5
Author: Miklos Vajna 
AuthorDate: Fri Jan 13 08:56:29 2023 +0100
Commit: Miklos Vajna 
CommitDate: Tue Jan 17 10:58:49 2023 +

sc: fix crash in ScViewData::GetCurXForTab()

Crashreport signature:

program/libsclo.so
ScViewData::GetCurXForTab(short) const
sc/source/ui/view/viewdata.cxx:1431
program/libsclo.so
ScViewFunc::OnLOKInsertDeleteColumn(short, long)
sc/source/ui/view/viewfunc.cxx:1552
program/libsclo.so
ScDocFunc::InsertCells(ScRange const&, ScMarkData const*, 
InsCellCmd, bool, bool, bool)
source/ui/docshell/docfunc.cxx:2256
program/libsclo.so
ScViewFunc::InsertCells(InsCellCmd, bool, bool)
sc/source/ui/view/viewfunc.cxx:1658

Seeing that e.g. ScViewData::WriteUserDataSequence() already checks if
the pointer in maTabData is a nullptr, do the same here.

Change-Id: I0ebdba8c8a5bedd3c3c57c36bdf0632e2fee45c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145431
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Marco Cecchetti 

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 26387834f45a..1f2991e23fb3 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1425,7 +1425,7 @@ SCROW ScViewData::GetPosY( ScVSplitPos eWhich, SCTAB 
nForTab ) const
 
 SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const
 {
-if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size(
+if (!ValidTab(nTabIndex) || (nTabIndex >= 
static_cast(maTabData.size())) || !maTabData[nTabIndex])
 return -1;
 
 return maTabData[nTabIndex]->nCurX;


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

2023-01-17 Thread Michael Weghorn (via logerrit)
 android/source/src/java/org/libreoffice/LOKitThread.java |
8 +++--
 android/source/src/java/org/mozilla/gecko/ZoomConstraints.java   |   
14 
 android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java |   
16 ++
 3 files changed, 10 insertions(+), 28 deletions(-)

New commits:
commit 377a8c8ed7dd997d1ac96918b69f805880d208af
Author: Michael Weghorn 
AuthorDate: Tue Jan 17 08:40:41 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Jan 17 11:08:27 2023 +

tdf#153058 android: Use "fit page" for min zoom level

So far, Android Viewer was using "fit page width"
as minimum zoom level, meaning that it was impossible
to zoom out to see the full page, e.g. when opening
a doc with page size A4 portrait and using
the device in landscape mode.

Change the minimum zoom level to take the page
height into account as well, i.e. adapt the minimum
zoom level to be "fit whole page" to allow doing that.

However, keep applying "fit page width" as
zoom level when double-tapping, by using
the "fit page width" zoom level as new
default zoom level and applying the default
instead of the minimum zoom level on
double-tap.
("Fit page width" is probably more desirable
than "fit whole page" at least when used on small
devices, at least in all cases where
writing is in horizontal direction, so the user
can see the current portion of text and scroll
down to continue reading/writing.)

Use on double-tap is currently the only use for the
default zoom level, the only previous occurence
was effectively unused since

commit 9ab43aebad67383057d2cc3f754ce2193fa78b4e
Date:   Wed Dec 4 17:18:20 2019 +0100

android: Allow zooming for Calc as well

and finally dropped with
Change-Id I702874f1d9161e5cef660bb4c4a0b7864d6e3c09
("android: Drop superfluous ZoomConstraints#mAllow{,DoubleTap}Zoom").

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

diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java 
b/android/source/src/java/org/libreoffice/LOKitThread.java
index 27568ace5599..fd40c3089102 100644
--- a/android/source/src/java/org/libreoffice/LOKitThread.java
+++ b/android/source/src/java/org/libreoffice/LOKitThread.java
@@ -184,9 +184,11 @@ class LOKitThread extends Thread {
 private void updateZoomConstraints() {
 if (mTileProvider == null) return;
 mLayerClient = mContext.getLayerClient();
-// Set min zoom to the page width so that you cannot zoom below page 
width
-final float minZoom = 
mLayerClient.getViewportMetrics().getWidth()/mTileProvider.getPageWidth();
-mLayerClient.setZoomConstraints(new ZoomConstraints(1f, minZoom, 0f));
+// Set default zoom to the page width and min zoom so that the whole 
page is visible
+final float pageHeightZoom = 
mLayerClient.getViewportMetrics().getHeight() / mTileProvider.getPageHeight();
+final float pageWidthZoom = 
mLayerClient.getViewportMetrics().getWidth() / mTileProvider.getPageWidth();
+final float minZoom = Math.min(pageWidthZoom, pageHeightZoom);
+mLayerClient.setZoomConstraints(new ZoomConstraints(pageWidthZoom, 
minZoom, 0f));
 }
 
 /**
diff --git 
a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java 
b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
index ef3d28e8ebb3..f1973d980e32 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
@@ -983,7 +983,7 @@ class JavaPanZoomController
 PointF pointOfTap = getMotionInDocumentCoordinates(motionEvent);
 ImmutableViewportMetrics metrics = getMetrics();
 float newZoom = metrics.getZoomFactor() >=
-DOUBLE_TAP_THRESHOLD ? 
mTarget.getZoomConstraints().getMinZoom() : DOUBLE_TAP_THRESHOLD;
+DOUBLE_TAP_THRESHOLD ? 
mTarget.getZoomConstraints().getDefaultZoom() : DOUBLE_TAP_THRESHOLD;
 // calculate new top_left point from the point of tap
 float ratio = newZoom/metrics.getZoomFactor();
 float newLeft = pointOfTap.x - 1/ratio * (pointOfTap.x - 
metrics.getOrigin().x / metrics.getZoomFactor());
commit 7c399767053b1cc6f68beccfbbb084c2891fe05e
Author: Michael Weghorn 
AuthorDate: Tue Jan 17 08:31:54 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Jan 17 11:08:21 2023 +

android: Drop superfluous ZoomConstraints#mAllow{,DoubleTap}Zoom

Both members are always set to true since

commit 9ab43aebad67383057d2cc3f754ce2193fa78b4e
Date:   Wed Dec 4 17:18:20 2019 +0100

android: Allow zooming for 

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

2023-01-17 Thread Noel Grandin (via logerrit)
 sc/inc/nameuno.hxx  |7 ---
 sc/source/ui/unoobj/nameuno.cxx |   14 --
 sc/source/ui/vba/vbaname.cxx|4 ++--
 3 files changed, 2 insertions(+), 23 deletions(-)

New commits:
commit 87d0f136dede84f694240f55a958d94e3d0fe9ce
Author: Noel Grandin 
AuthorDate: Mon Jan 16 14:05:19 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 11:28:43 2023 +

XUnoTunnel->dynamic_cast in ScNamedRangeObj

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

diff --git a/sc/inc/nameuno.hxx b/sc/inc/nameuno.hxx
index 4cd5423cfc0b..ee37dc365d2f 100644
--- a/sc/inc/nameuno.hxx
+++ b/sc/inc/nameuno.hxx
@@ -31,7 +31,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -47,7 +46,6 @@ class SC_DLLPUBLIC ScNamedRangeObj final : public 
::cppu::WeakImplHelper<
 css::sheet::XFormulaTokens,
 css::sheet::XCellRangeReferrer,
 css::beans::XPropertySet,
-css::lang::XUnoTunnel,
 css::lang::XServiceInfo >,
 public SfxListener
 {
@@ -109,11 +107,6 @@ public:
 virtual void SAL_CALL   removeVetoableChangeListener( const OUString& 
PropertyName,
 const css::uno::Reference< 
css::beans::XVetoableChangeListener >& aListener ) override;
 
-/// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-
-static const css::uno::Sequence& getUnoTunnelId();
-
 /// XServiceInfo
 virtual OUString SAL_CALL getImplementationName() override;
 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) 
override;
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 6d6a56a6d85b..a49748b1a951 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -419,20 +419,6 @@ uno::Sequence SAL_CALL 
ScNamedRangeObj::getSupportedServiceNames()
 return {SCNAMEDRANGEOBJ_SERVICE, SCLINKTARGET_SERVICE};
 }
 
-// XUnoTunnel
-
-sal_Int64 SAL_CALL ScNamedRangeObj::getSomething(
-const uno::Sequence& rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
-const uno::Sequence& ScNamedRangeObj::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theScNamedRangeObjUnoTunnelId;
-return theScNamedRangeObjUnoTunnelId.getSeq();
-}
-
 ScNamedRangesObj::ScNamedRangesObj(ScDocShell* pDocSh) :
 mbModifyAndBroadcast(true),
 pDocShell( pDocSh )
diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx
index ec0dbe982d28..98a242401e7d 100644
--- a/sc/source/ui/vba/vbaname.cxx
+++ b/sc/source/ui/vba/vbaname.cxx
@@ -87,7 +87,7 @@ ScVbaName::setVisible( sal_Bool /*bVisible*/ )
 
 OUString ScVbaName::getContent( const formula::FormulaGrammar::Grammar 
eGrammar )
 {
-ScNamedRangeObj* pNamedRange = comphelper::getFromUnoTunnel< 
ScNamedRangeObj >( mxNamedRange );
+ScNamedRangeObj* pNamedRange = dynamic_cast< ScNamedRangeObj* >( 
mxNamedRange.get() );
 OUString aContent;
 if ( pNamedRange )
 {
@@ -105,7 +105,7 @@ void  ScVbaName::setContent( const OUString& rContent, 
const formula::FormulaGra
 OUString sContent( rContent );
 if (sContent.startsWith("="))
 sContent = sContent.copy(1);
-ScNamedRangeObj* pNamedRange = comphelper::getFromUnoTunnel< 
ScNamedRangeObj >( mxNamedRange );
+ScNamedRangeObj* pNamedRange = dynamic_cast< ScNamedRangeObj* >( 
mxNamedRange.get() );
 
 // We should be able to do the below by just setting calling SetCode on 
pNamedRange
 // right?


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

2023-01-17 Thread Noel Grandin (via logerrit)
 dbaccess/source/core/dataaccess/databasecontext.cxx  |   11 ---
 dbaccess/source/core/dataaccess/databasedocument.cxx |8 
 dbaccess/source/core/inc/databasecontext.hxx |6 --
 3 files changed, 4 insertions(+), 21 deletions(-)

New commits:
commit c1d50d738fd9fcae5e621efcd687121ef5219f1f
Author: Noel Grandin 
AuthorDate: Sat Jan 14 12:37:35 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 11:51:25 2023 +

XUnoTunnel->dynamic_cast in ODatabaseContext

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

diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx 
b/dbaccess/source/core/dataaccess/databasecontext.cxx
index c4ca08ce0a08..dce39f3badd4 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -707,17 +707,6 @@ void ODatabaseContext::databaseDocumentURLChange( const 
OUString& _rOldURL, cons
 m_aDatabaseObjects.erase( oldPos );
 }
 
-sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& 
rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
-const Sequence< sal_Int8 > & ODatabaseContext::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit implId;
-return implId.getSeq();
-}
-
 void ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& 
_rxForDocument, BasicManager& _rBasicManager )
 {
 #if !HAVE_FEATURE_SCRIPTING
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx 
b/dbaccess/source/core/dataaccess/databasedocument.cxx
index fb4ed754380b..2aa2710006c0 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -2196,11 +2196,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 com_sun_star_comp_dba_ODatabaseDocument(css::uno::XComponentContext* context,
 css::uno::Sequence const &)
 {
-Reference xDBContextTunnel(DatabaseContext::create(context), 
UNO_QUERY_THROW);
-dbaccess::ODatabaseContext* pContext
-= 
comphelper::getFromUnoTunnel(xDBContextTunnel);
+Reference xDBContextTunnel(DatabaseContext::create(context), 
UNO_QUERY_THROW);
+rtl::Reference pContext
+= dynamic_cast(xDBContextTunnel.get());
 assert(pContext);
-
+
 rtl::Reference pImpl(
 new dbaccess::ODatabaseModelImpl(context, *pContext));
 css::uno::Reference 
inst(pImpl->createNewModel_deliverOwnership());
diff --git a/dbaccess/source/core/inc/databasecontext.hxx 
b/dbaccess/source/core/inc/databasecontext.hxx
index 89662ad2281d..2f9bf326c9e0 100644
--- a/dbaccess/source/core/inc/databasecontext.hxx
+++ b/dbaccess/source/core/inc/databasecontext.hxx
@@ -28,7 +28,6 @@
 #include "ModelImpl.hxx"
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -55,7 +54,6 @@ class DatabaseDocumentLoader;
 
 typedef ::cppu::WeakComponentImplHelper<   css::lang::XServiceInfo
,   css::sdb::XDatabaseContext
-   ,   css::lang::XUnoTunnel
>   DatabaseAccessContext_Base;
 
 class ODatabaseContext  :public DatabaseAccessContext_Base
@@ -155,10 +153,6 @@ public:
 virtual void SAL_CALL addContainerListener( const css::uno::Reference< 
css::container::XContainerListener >& xListener ) override;
 virtual void SAL_CALL removeContainerListener( const css::uno::Reference< 
css::container::XContainerListener >& xListener ) override;
 
-// css::lang::XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
 void registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl);
 void revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl);
 void databaseDocumentURLChange(const OUString& _sOldName, const OUString& 
_sNewName);


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

2023-01-17 Thread Noel Grandin (via logerrit)
 sd/source/ui/framework/factories/BasicPaneFactory.cxx|3 +--
 sd/source/ui/framework/factories/BasicViewFactory.cxx|3 +--
 sd/source/ui/framework/factories/PresentationFactory.cxx |2 +-
 sd/source/ui/framework/module/CenterViewFocusModule.cxx  |   12 +---
 sd/source/ui/framework/module/CenterViewFocusModule.hxx  |5 +++--
 sd/source/ui/framework/module/DrawModule.cxx |3 ++-
 sd/source/ui/framework/module/ImpressModule.cxx  |3 ++-
 sd/source/ui/framework/module/PresentationModule.cxx |2 +-
 sd/source/ui/framework/module/ShellStackGuard.cxx|   11 ---
 sd/source/ui/framework/module/ShellStackGuard.hxx|4 +++-
 sd/source/ui/framework/module/ToolBarModule.cxx  |   12 +---
 sd/source/ui/framework/module/ToolBarModule.hxx  |4 +++-
 sd/source/ui/inc/DrawController.hxx  |   10 +-
 sd/source/ui/inc/framework/DrawModule.hxx|7 ++-
 sd/source/ui/inc/framework/ImpressModule.hxx |7 ++-
 sd/source/ui/inc/framework/PresentationModule.hxx|7 ++-
 sd/source/ui/sidebar/PanelFactory.cxx|2 +-
 sd/source/ui/slidesorter/shell/SlideSorterService.cxx|3 +--
 sd/source/ui/unoidl/DrawController.cxx   |   13 -
 sd/source/ui/view/GraphicViewShellBase.cxx   |3 ++-
 sd/source/ui/view/ImpressViewShellBase.cxx   |5 +++--
 sd/source/ui/view/PresentationViewShellBase.cxx  |4 ++--
 sd/source/ui/view/ViewTabBar.cxx |6 ++
 23 files changed, 61 insertions(+), 70 deletions(-)

New commits:
commit 5355f52b14d7237ba0f9fdd910eca579292242bd
Author: Noel Grandin 
AuthorDate: Mon Jan 16 15:55:28 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 12:40:28 2023 +

XUnoTunnel->dynamic_cast in sd::DrawController

Just past the concrete type down through a couple of layers, rather than
using a generic type and then casting

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

diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx 
b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index c01d315a3d9c..64cec425ad54 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -132,8 +132,7 @@ void SAL_CALL BasicPaneFactory::initialize (const 
Sequence& aArguments)
 // Tunnel through the controller to obtain access to the ViewShellBase.
 try
 {
-Reference xTunnel (xController, UNO_QUERY_THROW);
-if (auto pController = 
comphelper::getFromUnoTunnel(xTunnel))
+if (auto pController = 
dynamic_cast(xController.get()))
 mpViewShellBase = pController->GetViewShellBase();
 }
 catch(RuntimeException&)
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx 
b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 5e862c6aebc2..6a6b8065e180 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -237,8 +237,7 @@ void SAL_CALL BasicViewFactory::initialize (const 
Sequence& aArguments)
 Reference xController (aArguments[0], 
UNO_QUERY_THROW);
 
 // Tunnel through the controller to obtain a ViewShellBase.
-Reference xTunnel (xController, UNO_QUERY_THROW);
-::sd::DrawController* pController = 
comphelper::getFromUnoTunnel(xTunnel);
+::sd::DrawController* pController = 
dynamic_cast(xController.get());
 if (pController != nullptr)
 mpBase = pController->GetViewShellBase();
 
diff --git a/sd/source/ui/framework/factories/PresentationFactory.cxx 
b/sd/source/ui/framework/factories/PresentationFactory.cxx
index c1d408856187..73c2d4bdb732 100644
--- a/sd/source/ui/framework/factories/PresentationFactory.cxx
+++ b/sd/source/ui/framework/factories/PresentationFactory.cxx
@@ -113,7 +113,7 @@ void SAL_CALL PresentationFactory::releaseResource (
 {
 ThrowIfDisposed();
 
-auto pController = 
comphelper::getFromUnoTunnel(mxController);
+auto pController = dynamic_cast(mxController.get());
 if (pController != nullptr)
 {
 ViewShellBase* pBase = pController->GetViewShellBase();
diff --git a/sd/source/ui/framework/module/CenterViewFocusModule.cxx 
b/sd/source/ui/framework/module/CenterViewFocusModule.cxx
index f5de61ca65d6..2c799e04bbb1 100644
--- a/sd/source/ui/framework/module/CenterViewFocusModule.cxx
+++ b/sd/source/ui/framework/module/CenterViewFocusModule.cxx
@@ -39,20 +39,18 @@ namespace sd::framework {
 
 //= CenterViewFocusModule 

 
-CenterViewFocusModule::CenterViewFocusModule (R

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/inc sw/qa sw/sdi sw/source

2023-01-17 Thread Miklos Vajna (via logerrit)
 sw/inc/cmdid.h  |1 
 sw/qa/uibase/shells/shells.cxx  |   36 
 sw/sdi/_textsh.sdi  |6 
 sw/sdi/swriter.sdi  |   14 +
 sw/source/uibase/shells/textsh1.cxx |   54 
 5 files changed, 111 insertions(+)

New commits:
commit 172f5703181fa3b911ee5da2bc81970332b42ff5
Author: Miklos Vajna 
AuthorDate: Mon Jan 16 08:10:16 2023 +0100
Commit: Pranam Lashkari 
CommitDate: Tue Jan 17 12:56:55 2023 +

sw: add a new .uno:DeleteFields UNO command

This is similar to 40753de837b9776dd8b33e830be0cceef83f024a (sw: add a
new .uno:DeleteBookmarks UNO command, 2023-01-13), but that was about
deleting bookmarks matching a given prefix with their name, and this one
is about reference marks (fields in general), matching a certain type &
prefix with their name.

(cherry picked from commit 1d6593dd799ff4eb931ffbb5338e4856fb87f77f)

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

diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 62c0e057a23a..113be21a7e77 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -317,6 +317,7 @@
 #define FN_UPDATE_BOOKMARK (FN_INSERT2 + 37)
 #define FN_UPDATE_FIELD (FN_INSERT2 + 38)
 #define FN_DELETE_BOOKMARKS (FN_INSERT2 + 39)
+#define FN_DELETE_FIELDS (FN_INSERT2 + 40)
 
 // Region: Format
 #define FN_AUTOFORMAT_APPLY (FN_FORMAT + 1 ) /* apply autoformat options */
diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index 300912595660..b031874c11c6 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -829,6 +829,42 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, 
testDeleteBookmarks)
 CPPUNIT_ASSERT(it != pDoc->getIDocumentMarkAccess()->getAllMarksEnd());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testDeleteFields)
+{
+// Given a document with a refmark:
+SwDoc* pDoc = createSwDoc();
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("TypeName", 
uno::Any(OUString("SetRef"))),
+comphelper::makePropertyValue(
+"Name", uno::Any(OUString("ZOTERO_ITEM CSL_CITATION {} 
RNDpyJknp173F"))),
+comphelper::makePropertyValue("Content", 
uno::Any(OUString("aaabbbccc"))),
+};
+dispatchCommand(mxComponent, ".uno:InsertField", aArgs);
+
+// When deleting the refmarks:
+std::vector aArgsVec = 
comphelper::JsonToPropertyValues(R"json(
+{
+"TypeName": {
+"type": "string",
+"value": "SetRef"
+},
+"NamePrefix": {
+"type": "string",
+"value": "ZOTERO_ITEM CSL_CITATION"
+}
+}
+)json");
+aArgs = comphelper::containerToSequence(aArgsVec);
+dispatchCommand(mxComponent, ".uno:DeleteFields", aArgs);
+
+// Then make sure that no refmark is kept:
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 0
+// - Actual  : 1
+// i.e. the refmark was not deleted.
+CPPUNIT_ASSERT_EQUAL(static_cast(0), pDoc->GetRefMarks());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 6cb500b8b4bf..a39f9187dff3 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -1831,6 +1831,12 @@ interface BaseText
 DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
 ]
 
+FN_DELETE_FIELDS
+[
+ExecMethod = Execute ;
+DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+]
+
 SID_FM_CTL_PROPERTIES
 [
 ExecMethod = Execute ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 80a424279e6c..391582c02d64 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -2582,6 +2582,20 @@ SfxVoidItem DeleteBookmarks FN_DELETE_BOOKMARKS
 GroupId = SfxGroupId::Controls;
 ]
 
+SfxVoidItem DeleteFields FN_DELETE_FIELDS
+(SfxStringItem TypeName FN_PARAM_1, SfxStringItem NamePrefix FN_PARAM_2)
+[
+AutoUpdate = TRUE,
+FastCall = FALSE,
+ReadOnlyDoc = FALSE,
+Toggle = FALSE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerSet;
+
+GroupId = SfxGroupId::Controls;
+]
+
 SfxVoidItem UpdateBookmark FN_UPDATE_BOOKMARK
 (SfxStringItem BookmarkNamePrefix FN_PARAM_1, SfxUnoAnyItem Bookmark 
FN_PARAM_2)
 [
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 469a47e206c0..be80f441b525 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -111,6 +111,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace com::sun::star::beans;
@@ -660,6 +661,53 @@ void DeleteBookmarks(SfxRequest& rReq, SwWrtShell& rWrtSh)
 pMarkAccess->deleteMark(pMark);
 }
 }
+
+void DeleteFields(SfxRequest& 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa sw/sdi sw/source

2023-01-17 Thread Miklos Vajna (via logerrit)
 sw/qa/uibase/shells/shells.cxx  |   25 +
 sw/sdi/swriter.sdi  |2 +-
 sw/source/uibase/shells/textfld.cxx |   12 
 3 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit b09b29073f0802cc7e30c9455e2c8d6ac1ea6c63
Author: Miklos Vajna 
AuthorDate: Mon Jan 16 16:34:40 2023 +0100
Commit: Miklos Vajna 
CommitDate: Tue Jan 17 13:05:29 2023 +

sw: .uno:TextFormField: add new Wrapper parameter

Currently all fieldmarks are inserted into the document body
unconditionally when this UNO command is dispatched.

Inserting at the current cursor position makes sense, but some citation
styles want to insert the actual citation as footnotes, and only have
the footnote anchor at the cursor position.

Fix the problem by adding a new Wrapper parameter to this UNO command:
currently the only interesting value it may have is Footnote, if this is
specified then first we insert a footnote and the footnote content will
host the fieldmark, not the original body text.

The same will be wanted for endnotes as well, but that's not yet done in
this commit.

(cherry picked from commit ceea8f3924f26d5f10adc41b9ea587c77c2fda74)

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

diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index b031874c11c6..f4fcbd8eeb7e 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 
 constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/uibase/shells/data/";
 
@@ -865,6 +866,30 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testDeleteFields)
 CPPUNIT_ASSERT_EQUAL(static_cast(0), pDoc->GetRefMarks());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testInsertTextFormFieldFootnote)
+{
+// Given an empty document:
+SwDoc* pDoc = createSwDoc();
+
+// When inserting an ODF_UNHANDLED fieldmark inside a footnote:
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("FieldType", 
uno::Any(OUString(ODF_UNHANDLED))),
+comphelper::makePropertyValue("FieldCommand",
+  uno::Any(OUString("ADDIN ZOTERO_BIBL foo 
bar"))),
+comphelper::makePropertyValue("FieldResult", 
uno::Any(OUString("result"))),
+comphelper::makePropertyValue("Wrapper", 
uno::Any(OUString("Footnote"))),
+};
+dispatchCommand(mxComponent, ".uno:TextFormField", aArgs);
+
+// Then make sure that the footnote is created:
+SwFootnoteIdxs& rFootnotes = pDoc->GetFootnoteIdxs();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// i.e. no footnote was created.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rFootnotes.size());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 391582c02d64..64da3512ef94 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -8322,7 +8322,7 @@ SfxBoolItem ShowInlineTooltips FN_SHOW_INLINETOOLTIPS
 ]
 
 SfxVoidItem TextFormField FN_INSERT_TEXT_FORMFIELD
-(SfxStringItem FieldType FN_PARAM_1, SfxStringItem FieldCommand FN_PARAM_2, 
SfxStringItem FieldResult FN_PARAM_3)
+(SfxStringItem FieldType FN_PARAM_1, SfxStringItem FieldCommand FN_PARAM_2, 
SfxStringItem FieldResult FN_PARAM_3, SfxStringItem Wrapper FN_PARAM_4)
 [
 AutoUpdate = TRUE,
 FastCall = FALSE,
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index c464ae31f528..cd9d1f61ebf6 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -739,6 +739,18 @@ FIELD_INSERT:
 aFieldResult = pFieldResult->GetValue();
 }
 
+const SfxStringItem* pWrapper = 
rReq.GetArg(FN_PARAM_4);
+if (pWrapper)
+{
+// Wrap the fieldmark in the requested container instead 
of inserting it
+// directly at the cursor position.
+OUString aWrapper = pWrapper->GetValue();
+if (aWrapper == "Footnote")
+{
+rSh.InsertFootnote(OUString());
+}
+}
+
 // Split node to remember where the start position is.
 bool bSuccess = 
rSh.GetDoc()->getIDocumentContentOperations().SplitNode(
 *pCursorPos->GetPoint(), false);


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

2023-01-17 Thread Xisco Fauli (via logerrit)
 sc/qa/unit/subsequent_export_test.cxx  |2 +-
 sc/qa/unit/subsequent_export_test2.cxx |4 ++--
 sc/qa/unit/ucalc_formula.cxx   |4 +---
 3 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 18f1e7ae9d57e888e316e9134ea321be98bf705a
Author: Xisco Fauli 
AuthorDate: Fri Jan 13 17:08:12 2023 +0100
Commit: Xisco Fauli 
CommitDate: Tue Jan 17 13:35:07 2023 +

sc: Use FormulaGrammarSwitch

Change-Id: Ia4d21886a5a8536f20fed87bfea9676ac8603d86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145481
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/subsequent_export_test.cxx 
b/sc/qa/unit/subsequent_export_test.cxx
index a010a9820ea4..5b66ae23f3d9 100644
--- a/sc/qa/unit/subsequent_export_test.cxx
+++ b/sc/qa/unit/subsequent_export_test.cxx
@@ -3053,7 +3053,7 @@ void ScExportTest::testSharedFormulaExportXLS()
 bool checkContent(ScDocument& rDoc)
 {
 formula::FormulaGrammar::Grammar eGram = 
formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1;
-rDoc.SetGrammar(eGram);
+FormulaGrammarSwitch aFGSwitch(&rDoc, eGram);
 sc::TokenStringContext aCxt(rDoc, eGram);
 
 // Check the title row.
diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index 9ac4aa7704b8..ab57145096a5 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -423,7 +423,7 @@ void ScExportTest2::testRefStringUnspecified()
  aConfig.meStringRefAddressSyntax);
 
 // change formula syntax (i.e. not string ref syntax) to ExcelA1
-pDoc->SetGrammar(formula::FormulaGrammar::GRAM_NATIVE_XL_A1);
+FormulaGrammarSwitch aFGSwitch(pDoc, 
formula::FormulaGrammar::GRAM_NATIVE_XL_A1);
 
 saveAndReload("calc8");
 
@@ -502,7 +502,7 @@ void ScExportTest2::testTdf121260()
 
 ScDocument* pDoc = getScDoc();
 // change formula syntax (i.e. not string ref syntax) to ExcelA1
-pDoc->SetGrammar(formula::FormulaGrammar::GRAM_NATIVE_XL_A1);
+FormulaGrammarSwitch aFGSwitch(pDoc, 
formula::FormulaGrammar::GRAM_NATIVE_XL_A1);
 
 save("Calc Office Open XML");
 xmlDocUniquePtr pChart1 = parseExport("xl/charts/chart1.xml");
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 3cc36c60615d..cdefff3cf434 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -9085,7 +9085,7 @@ void TestFormula::testIntersectionOpExcel()
 // Data in C2.
 m_pDoc->SetValue(2,1,0, 1.0);
 
-m_pDoc->SetGrammar(FormulaGrammar::GRAM_ENGLISH_XL_A1);
+FormulaGrammarSwitch aFGSwitch(m_pDoc, 
formula::FormulaGrammar::GRAM_ENGLISH_XL_A1);
 
 // Choose formula positions that don't intersect with those data ranges.
 ScAddress aPos(0,3,0);
@@ -9101,8 +9101,6 @@ void TestFormula::testIntersectionOpExcel()
 m_pDoc->SetString(aPos,"=2*(horz vert)");
 CPPUNIT_ASSERT_EQUAL_MESSAGE("A7 calculating with intersecting named 
expressions failed", 2.0, m_pDoc->GetValue(aPos));
 
-m_pDoc->SetGrammar(FormulaGrammar::GRAM_ENGLISH);
-
 m_pDoc->DeleteTab(0);
 }
 


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

2023-01-17 Thread Miklos Vajna (via logerrit)
 sw/qa/uibase/shells/shells.cxx  |   41 
 sw/source/uibase/shells/textfld.cxx |   16 ++
 2 files changed, 53 insertions(+), 4 deletions(-)

New commits:
commit 43d80906c8693ca27c5b3077fbaa259df4004924
Author: Miklos Vajna 
AuthorDate: Tue Jan 17 11:38:14 2023 +0100
Commit: Miklos Vajna 
CommitDate: Tue Jan 17 13:43:36 2023 +

sw: .uno:TextFormField: handle Endnote as a value for the Wrapper parameter

This is similar to the fieldmark-in-footnote case, but here we need to
make sure that the layout is calculated before the cursor attempts to
jump to the endnote, otherwise the fieldmark will be inserted before the
endnote anchor, not in the endnote body.

The move of StartAction() / EndAction() calls can be done
unconditionally, it's not a problem for the existing footnote case.

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

diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index 6dfc6ed6e9da..8dd312ad69d9 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /// Covers sw/source/uibase/shells/ fixes.
 class SwUibaseShellsTest : public SwModelTestBase
@@ -961,6 +962,46 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, 
testInsertTextFormFieldFootnote)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), rFootnotes.size());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testInsertTextFormFieldEndnote)
+{
+// Given an empty document:
+createSwDoc();
+SwDoc* pDoc = getSwDoc();
+
+// When inserting an ODF_UNHANDLED fieldmark inside an endnote:
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("FieldType", 
uno::Any(OUString(ODF_UNHANDLED))),
+comphelper::makePropertyValue("FieldCommand",
+  uno::Any(OUString("ADDIN ZOTERO_BIBL foo 
bar"))),
+comphelper::makePropertyValue("FieldResult", 
uno::Any(OUString("result"))),
+comphelper::makePropertyValue("Wrapper", 
uno::Any(OUString("Endnote"))),
+};
+dispatchCommand(mxComponent, ".uno:TextFormField", aArgs);
+
+// Then make sure that the endnote is created:
+SwFootnoteIdxs& rFootnotes = pDoc->GetFootnoteIdxs();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// i.e. no endnote was inserted.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), rFootnotes.size());
+SwTextFootnote* pEndnote = rFootnotes[0];
+const SwFormatFootnote& rFormatEndnote = pEndnote->GetFootnote();
+CPPUNIT_ASSERT(rFormatEndnote.IsEndNote());
+// Also check that the endnote body contains the fieldmark:
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+pWrtShell->SttEndDoc(/*bStt=*/true);
+pWrtShell->GotoFootnoteText();
+pWrtShell->EndOfSection(/*bSelect=*/true);
+SwCursor* pCursor = pWrtShell->GetCursor();
+OUString aActual = pCursor->GetText();
+static sal_Unicode const aForbidden[]
+= { CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDSEP, CH_TXT_ATR_FIELDEND, 0 
};
+aActual = comphelper::string::removeAny(aActual, aForbidden);
+// Then this was empty: the fieldmark was inserted before the note anchor, 
not in the note body.
+CPPUNIT_ASSERT_EQUAL(OUString("result"), aActual);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index 239e4a076812..97f94174e987 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -731,9 +731,6 @@ FIELD_INSERT:
 }
 
 
rSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT_FORM_FIELD, 
nullptr);
-// Don't update the layout after inserting content and before 
deleting temporary
-// text nodes.
-rSh.StartAction();
 
 SwPaM* pCursorPos = rSh.GetCursor();
 if(pCursorPos)
@@ -758,8 +755,19 @@ FIELD_INSERT:
 {
 rSh.InsertFootnote(OUString());
 }
+else if (aWrapper == "Endnote")
+{
+// It's important that there is no Start/EndAction() 
around this, so the
+// inner EndAction() triggers a layout update and the 
cursor can jump to the
+// created SwFootnoteFrame.
+rSh.InsertFootnote(OUString(), /*bEndNote=*/true);
+}
 }
 
+// Don't update the layout after inserting content and before 
deleting temporary
+// text nodes.
+rSh.StartAction();
+
 // Split node to

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

2023-01-17 Thread Michael Stahl (via logerrit)
 sw/source/core/doc/DocumentRedlineManager.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit bdef7bbcd9e51f1272b006962c17ca0b2493205a
Author: Michael Stahl 
AuthorDate: Tue Dec 20 14:52:40 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jan 17 13:53:56 2023 +

tdf#150823 sw: merge delete redlines in same paragraph

The problematic merge was with a redline that spanned multiple nodes.

(regression from commit 7d730cd580e957ab06b0c7f020ac37dd0c337aa2)

Change-Id: Ie3fd23d102056b45833314143ec6381c1e9ef373
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144615
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 5cd8ea4d8a4fa8c5ac8e28be8fbc240caf070ff4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144624
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 0a1076db29f4..caa1e97b0297 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1679,7 +1679,8 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* 
pNewRedl, bool const bCall
 break;
 
 case SwComparePosition::CollideEnd:
-if (pRStt->nContent != 0)
+if (pRStt->nContent != 0
+&& pRStt->nNode != pREnd->nNode)
 {   // tdf#147466 HACK: don't combine in this case to 
avoid the tdf#119571 code from *undeleting* section nodes
 break;
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa sw/source

2023-01-17 Thread Dennis Francis (via logerrit)
 sw/qa/extras/tiledrendering/data/savedauthorfield.odt |binary
 sw/qa/extras/tiledrendering/tiledrendering.cxx|   16 +++
 sw/source/uibase/uno/unotxdoc.cxx |   19 +-
 3 files changed, 34 insertions(+), 1 deletion(-)

New commits:
commit 5b1f5319fc065eac71267b29472111d81e0dc14e
Author: Dennis Francis 
AuthorDate: Tue Jan 17 12:23:44 2023 +0530
Commit: Miklos Vajna 
CommitDate: Tue Jan 17 14:26:29 2023 +

sw: lok: use redline author for saved author fields(2)

Without the fix author fields will expand to "Unknown author" when
loading files which have author fields in them. But only update the
fields when the first view joins and not for later view joins.

online.git does not expect document to be modified just after load, so
to avoid this situation clear the document modified flag just after
field update.

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

diff --git a/sw/qa/extras/tiledrendering/data/savedauthorfield.odt 
b/sw/qa/extras/tiledrendering/data/savedauthorfield.odt
new file mode 100644
index ..e4b41d28b92a
Binary files /dev/null and 
b/sw/qa/extras/tiledrendering/data/savedauthorfield.odt differ
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 88b4dcc95d7f..3330e419dc8b 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -3791,6 +3791,22 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, 
testAuthorField)
 assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", 
sAuthor);
 }
 
+CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSavedAuthorField)
+{
+SwXTextDocument* pXTextDocument = createDoc("savedauthorfield.odt");
+const OUString sAuthor("XYZ ABCD");
+uno::Sequence 
aPropertyValues1(comphelper::InitPropertySequence(
+{
+{".uno:Author", uno::makeAny(sAuthor)},
+}));
+pXTextDocument->initializeForTiledRendering(aPropertyValues1);
+
+Scheduler::ProcessEventsToIdle();
+
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", 
sAuthor);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index f91fe5626f1b..78af58de3184 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3570,6 +3570,9 @@ void SwXTextDocument::initializeForTiledRendering(const 
css::uno::SequenceGetRedlineAuthor(SW_MOD()->GetRedlineAuthor());
+OUString sAuthor;
+
 for (const beans::PropertyValue& rValue : rArguments)
 {
 if (rValue.Name == ".uno:HideWhitespace" && rValue.Value.has())
@@ -3578,8 +3581,9 @@ void SwXTextDocument::initializeForTiledRendering(const 
css::uno::Sequence());
 else if (rValue.Name == ".uno:Author" && rValue.Value.has())
 {
+sAuthor = rValue.Value.get();
 // Store the author name in the view.
-pView->SetRedlineAuthor(rValue.Value.get());
+pView->SetRedlineAuthor(sAuthor);
 // Let the actual author name pick up the value from the current
 // view, which would normally happen only during the next view
 // switch.
@@ -3589,6 +3593,19 @@ void SwXTextDocument::initializeForTiledRendering(const 
css::uno::Sequence());
 }
 
+if (!sAuthor.isEmpty() && sAuthor != sOrigAuthor)
+{
+SwView* pFirstView = static_cast(SfxViewShell::GetFirst());
+if (pFirstView && SfxViewShell::GetNext(*pFirstView) == nullptr)
+{
+if (SwEditShell* pShell = &pFirstView->GetWrtShell())
+{
+pShell->SwViewShell::UpdateFields(true);
+pShell->ResetModified();
+}
+}
+}
+
 // Set the initial zoom value to 1; usually it is set in setClientZoom and
 // SwViewShell::PaintTile; zoom value is used for chart in place
 // editing, see postMouseEvent and setGraphicSelection methods.


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

2023-01-17 Thread Noel Grandin (via logerrit)
 sc/inc/dapiuno.hxx|   13 ++---
 sc/source/filter/oox/pivottablebuffer.cxx |2 +-
 sc/source/ui/unoobj/dapiuno.cxx   |   16 +---
 3 files changed, 4 insertions(+), 27 deletions(-)

New commits:
commit 8446cac7d39d3f09f9dd0d5b513ceb96184b0da8
Author: Noel Grandin 
AuthorDate: Mon Jan 16 14:02:15 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 14:45:46 2023 +

XUnoTunnel->dynamic_cast in ScDataPilotDescriptorBase

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

diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx
index e10cf45f97e1..88c24ce1a4dc 100644
--- a/sc/inc/dapiuno.hxx
+++ b/sc/inc/dapiuno.hxx
@@ -26,7 +26,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -128,13 +127,11 @@ public:
 };
 
 //  ScDataPilotDescriptorBase is never instantiated directly
-class SAL_DLLPUBLIC_RTTI ScDataPilotDescriptorBase :
-  public cppu::WeakImplHelper<
+class SC_DLLPUBLIC ScDataPilotDescriptorBase : public cppu::WeakImplHelper<
 css::sheet::XDataPilotDescriptor,
 css::beans::XPropertySet,
 
css::sheet::XDataPilotDataLayoutFieldSupplier,
-css::lang::XServiceInfo,
-css::lang::XUnoTunnel>,
+css::lang::XServiceInfo>,
   public SfxListener
 {
 private:
@@ -193,12 +190,6 @@ public:
 virtual css::uno::Reference< css::sheet::XDataPilotField >
 SAL_CALL getDataLayoutField() override;
 
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence<
-sal_Int8 >& aIdentifier ) override;
-
-SC_DLLPUBLIC static const css::uno::Sequence& getUnoTunnelId();
-
 // XServiceInfo is in derived classes
 };
 
diff --git a/sc/source/filter/oox/pivottablebuffer.cxx 
b/sc/source/filter/oox/pivottablebuffer.cxx
index d57c17571282..e936d0fadd87 100644
--- a/sc/source/filter/oox/pivottablebuffer.cxx
+++ b/sc/source/filter/oox/pivottablebuffer.cxx
@@ -1241,7 +1241,7 @@ void PivotTable::finalizeImport()
 mxDPDescriptor->setTag( maDefModel.maTag );
 
 // TODO: This is a hack. Eventually we need to convert the whole thing 
to the internal API.
-auto pImpl = 
comphelper::getFromUnoTunnel(mxDPDescriptor);
+auto pImpl = 
dynamic_cast(mxDPDescriptor.get());
 if (!pImpl)
 return;
 
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 4be1c767fad0..7247b655bf23 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -414,7 +414,7 @@ void SAL_CALL ScDataPilotTablesObj::insertNewByName( const 
OUString& aNewName,
 if (!pDocShell)
 throw RuntimeException("DocShell is null", 
static_cast(this));
 
-auto pImp = comphelper::getFromUnoTunnel( 
xDescriptor );
+auto pImp = dynamic_cast( xDescriptor.get() );
 if (!pImp)
 throw RuntimeException("Failed to get ScDataPilotDescriptor", 
static_cast(this));
 
@@ -973,20 +973,6 @@ Reference< XDataPilotField > SAL_CALL 
ScDataPilotDescriptorBase::getDataLayoutFi
 return nullptr;
 }
 
-// XUnoTunnel
-
-sal_Int64 SAL_CALL ScDataPilotDescriptorBase::getSomething(
-const Sequence& rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
-const Sequence& ScDataPilotDescriptorBase::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theScDataPilotDescriptorBaseUnoTunnelId;
-return theScDataPilotDescriptorBaseUnoTunnelId.getSeq();
-}
-
 ScDataPilotTableObj::ScDataPilotTableObj(ScDocShell& rDocSh, SCTAB nT, 
OUString aN) :
 ScDataPilotDescriptorBase( rDocSh ),
 nTab( nT ),


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

2023-01-17 Thread Armin Le Grand (Allotropia) (via logerrit)
 drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx |   41 
 1 file changed, 33 insertions(+), 8 deletions(-)

New commits:
commit 6c8b6fa6c6d4a1a20d8ebaf36b16c1d20cf109e0
Author: Armin Le Grand (Allotropia) 
AuthorDate: Tue Jan 17 12:13:26 2023 +0100
Commit: Armin Le Grand 
CommitDate: Tue Jan 17 14:53:40 2023 +

SDPR: use correct Viewport for sub renderer

Change-Id: Ia10731fbe44c812120ed6594959ddee909568187
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145666
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
index e93e1375bc07..21a441783ca6 100644
--- a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
@@ -575,6 +575,20 @@ public:
 
 if (hasRenderTarget())
 {
+// set Viewort if none was given. We have a fixed pixel target, s 
we know the
+// exact Viewport to work on
+if (getViewInformation2D().getViewport().isEmpty())
+{
+drawinglayer::geometry::ViewInformation2D 
aViewInformation(getViewInformation2D());
+basegfx::B2DRange aViewport(0.0, 0.0, nWidth, nHeight);
+basegfx::B2DHomMatrix 
aInvViewTransform(aViewInformation.getViewTransformation());
+
+aInvViewTransform.invert();
+aViewport.transform(aInvViewTransform);
+aViewInformation.setViewport(aViewport);
+updateViewInformation(aViewInformation);
+}
+
 // clear as render preparation
 getRenderTarget()->BeginDraw();
 getRenderTarget()->Clear(D2D1::ColorF(0.0f, 0.0f, 0.0f, 0.0f));
@@ -936,14 +950,25 @@ sal::systools::COMReference 
D2DPixelProcessor2D::implCreateAlpha_Di
 // locally and Clear() it (see class def above).
 // That way it is not necessary to patch/relocate all the local variables 
(safer)
 // and the renderer has no real overhead itself
-const basegfx::B2DHomMatrix 
aEmbedTransform(basegfx::utils::createTranslateB2DHomMatrix(
--rVisibleRange.getMinX(), -rVisibleRange.getMinY()));
-geometry::ViewInformation2D aViewInformation2D(getViewInformation2D());
-aViewInformation2D.setViewTransformation(aEmbedTransform
- * 
getViewInformation2D().getViewTransformation());
-D2DBitmapPixelProcessor2D aSubContentRenderer(
-aViewInformation2D, ceil(rVisibleRange.getWidth()), 
ceil(rVisibleRange.getHeight()),
-getRenderTarget());
+geometry::ViewInformation2D 
aAdaptedViewInformation2D(getViewInformation2D());
+const double fTargetWidth(ceil(rVisibleRange.getWidth()));
+const double fTargetHeight(ceil(rVisibleRange.getHeight()));
+
+{
+// create adapted ViewTransform, needs to be offset in discrete 
coordinates,
+// so multiply from left
+basegfx::B2DHomMatrix 
aAdapted(basegfx::utils::createTranslateB2DHomMatrix(
+   -rVisibleRange.getMinX(), 
-rVisibleRange.getMinY())
+   * 
getViewInformation2D().getViewTransformation());
+aAdaptedViewInformation2D.setViewTransformation(aAdapted);
+
+// reset Viewport (world coordinates), so the helper renderer will 
create it's
+// own based on it's given internal discrete size
+aAdaptedViewInformation2D.setViewport(basegfx::B2DRange());
+}
+
+D2DBitmapPixelProcessor2D aSubContentRenderer(aAdaptedViewInformation2D, 
fTargetWidth,
+  fTargetHeight, 
getRenderTarget());
 
 if (!aSubContentRenderer.valid())
 {


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

2023-01-17 Thread Caolán McNamara (via logerrit)
 include/svtools/scrolladaptor.hxx|1 +
 sc/source/ui/inc/tabview.hxx |1 +
 sc/source/ui/view/tabview.cxx|   11 +++
 svtools/source/control/scrolladaptor.cxx |5 +
 4 files changed, 18 insertions(+)

New commits:
commit 873a695b64269a6b92766f65930786314351e83f
Author: Caolán McNamara 
AuthorDate: Tue Jan 17 09:23:08 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 17 15:12:35 2023 +

tdf#153049 UpdateScrollBars on mouse release

which is what the old code effectively did

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

diff --git a/include/svtools/scrolladaptor.hxx 
b/include/svtools/scrolladaptor.hxx
index d321091ac4de..cdc507078cf8 100644
--- a/include/svtools/scrolladaptor.hxx
+++ b/include/svtools/scrolladaptor.hxx
@@ -54,6 +54,7 @@ public:
 virtual tools::Long GetThumbPos() const override;
 
 void SetScrollHdl(const Link& rLink);
+void SetMouseReleaseHdl(const Link& rLink);
 
 // what is it
 bool IsHoriScroll() const { return m_bHori; }
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 7fdb0cc3c2c2..ca3918aae325 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -226,6 +226,7 @@ private:
 DECL_LINK(HScrollRightHdl, weld::Scrollbar&, void );
 DECL_LINK(VScrollTopHdl, weld::Scrollbar&, void );
 DECL_LINK(VScrollBottomHdl, weld::Scrollbar&, void );
+DECL_LINK(EndScrollHdl, const MouseEvent&, bool);
 void ScrollHdl(ScrollAdaptor* rScrollBar);
 
 DECL_LINK(SplitHdl, Splitter*, void);
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 4248fdd08526..607e5ddc60d2 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -228,6 +228,7 @@ void ScTabView::InitScrollBar(ScrollAdaptor& rScrollBar, 
tools::Long nMaxVal, co
 rScrollBar.SetVisibleSize( 10 );// is reset by Resize
 
 rScrollBar.SetScrollHdl(rLink);
+rScrollBar.SetMouseReleaseHdl(LINK(this, ScTabView, EndScrollHdl));
 
 rScrollBar.EnableRTL( aViewData.GetDocument().IsLayoutRTL( 
aViewData.GetTabNo() ) );
 }
@@ -1054,6 +1055,16 @@ IMPL_LINK_NOARG(ScTabView, VScrollBottomHdl, 
weld::Scrollbar&, void)
 ScrollHdl(aVScrollBottom.get());
 }
 
+IMPL_LINK_NOARG(ScTabView, EndScrollHdl, const MouseEvent&, bool)
+{
+if (bDragging)
+{
+UpdateScrollBars();
+bDragging = false;
+}
+return false;
+}
+
 void ScTabView::ScrollHdl(ScrollAdaptor* pScroll)
 {
 bool bHoriz = ( pScroll == aHScrollLeft.get() || pScroll == 
aHScrollRight.get() );
diff --git a/svtools/source/control/scrolladaptor.cxx 
b/svtools/source/control/scrolladaptor.cxx
index 14480f0c7d2d..64799a15e96d 100644
--- a/svtools/source/control/scrolladaptor.cxx
+++ b/svtools/source/control/scrolladaptor.cxx
@@ -106,6 +106,11 @@ void ScrollAdaptor::SetScrollHdl(const 
Link& rLink)
 m_xScrollBar->connect_adjustment_changed(rLink);
 }
 
+void ScrollAdaptor::SetMouseReleaseHdl(const Link& 
rLink)
+{
+m_xScrollBar->connect_mouse_release(rLink);
+}
+
 tools::Long ScrollAdaptor::DoScroll(tools::Long nNewPos)
 {
 const auto nOrig = m_xScrollBar->adjustment_get_value();


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

2023-01-17 Thread Noel Grandin (via logerrit)
 forms/source/xforms/submission.cxx |7 ---
 forms/source/xforms/submission.hxx |9 -
 sd/source/ui/inc/ViewTabBar.hxx|   10 +-
 sd/source/ui/view/ViewTabBar.cxx   |   13 -
 4 files changed, 1 insertion(+), 38 deletions(-)

New commits:
commit 6e0d5afa233484e36e323e8466829ec573d11cbd
Author: Noel Grandin 
AuthorDate: Mon Jan 16 16:11:49 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 16:10:07 2023 +

XUnoTUnnel->dynamic_cast in sd::ViewTabBar

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

diff --git a/sd/source/ui/inc/ViewTabBar.hxx b/sd/source/ui/inc/ViewTabBar.hxx
index d483f2b057d0..61670cc1432b 100644
--- a/sd/source/ui/inc/ViewTabBar.hxx
+++ b/sd/source/ui/inc/ViewTabBar.hxx
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -62,8 +61,7 @@ private:
 typedef comphelper::WeakComponentImplHelper <
 css::drawing::framework::XToolBar,
 css::drawing::framework::XTabBar,
-css::drawing::framework::XConfigurationChangeListener,
-css::lang::XUnoTunnel
+css::drawing::framework::XConfigurationChangeListener
 > ViewTabBarInterfaceBase;
 
 /** Tab control for switching between views in the center pane.
@@ -123,12 +121,6 @@ public:
 
 virtual sal_Bool SAL_CALL isAnchorOnly() override;
 
-//- XUnoTunnel 
-
-static const css::uno::Sequence& getUnoTunnelId();
-
-virtual sal_Int64 SAL_CALL getSomething (const 
css::uno::Sequence& rId) override;
-
 /** The returned value is calculated as the difference between the
 total height of the control and the height of its first tab page.
 This can be considered a hack.
diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx
index 6e9f23e3b674..09925e32d37b 100644
--- a/sd/source/ui/view/ViewTabBar.cxx
+++ b/sd/source/ui/view/ViewTabBar.cxx
@@ -265,19 +265,6 @@ sal_Bool SAL_CALL ViewTabBar::isAnchorOnly()
 return false;
 }
 
-//- XUnoTunnel 
-
-const Sequence& ViewTabBar::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theViewTabBarUnoTunnelId;
-return theViewTabBarUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL ViewTabBar::getSomething (const Sequence& rId)
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 bool ViewTabBar::ActivatePage(size_t nIndex)
 {
 try
commit fc41f4d58c7c0e60025c1b43127ef1b3c87fa1ac
Author: Noel Grandin 
AuthorDate: Sat Jan 14 12:41:58 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 16:10:02 2023 +

XUnoTunnel->dynamic_cast in Submission

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

diff --git a/forms/source/xforms/submission.cxx 
b/forms/source/xforms/submission.cxx
index 7a27305760e3..fde73057b4e4 100644
--- a/forms/source/xforms/submission.cxx
+++ b/forms/source/xforms/submission.cxx
@@ -384,13 +384,6 @@ void SAL_CALL Submission::setName( const OUString& sID )
 }
 
 
-sal_Int64 SAL_CALL Submission::getSomething(
-const Sequence& aId )
-{
-return comphelper::getSomethingImpl(aId, this);
-}
-
-
 static OUString lcl_message( std::u16string_view rID, std::u16string_view 
rText )
 {
 OUString aMessage = OUString::Concat("XForms submission '") + rID + "' 
failed" + rText + ".";
diff --git a/forms/source/xforms/submission.hxx 
b/forms/source/xforms/submission.hxx
index 31c5b9af07b9..8dbfb2b3f1aa 100644
--- a/forms/source/xforms/submission.hxx
+++ b/forms/source/xforms/submission.hxx
@@ -21,7 +21,6 @@
 
 #include 
 #include "propertysetbase.hxx"
-#include 
 #include 
 #include 
 #include 
@@ -52,7 +51,6 @@ namespace xforms
  */
 typedef cppu::ImplInheritanceHelper<
 PropertySetBase,
-css::lang::XUnoTunnel,
 css::xforms::XSubmission
 > Submission_t;
 
@@ -194,13 +192,6 @@ public:
 virtual void SAL_CALL setName( const OUString& ) override;
 
 
-// XUnoTunnel
-
-
-virtual sal_Int64 SAL_CALL getSomething(
-const css::uno::Sequence& ) override;
-
-
 // XSubmission
 
 


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

2023-01-17 Thread Noel Grandin (via logerrit)
 sfx2/inc/unoctitm.hxx |7 +--
 sfx2/source/control/bindings.cxx  |   11 +++
 sfx2/source/control/sfxstatuslistener.cxx |3 +--
 sfx2/source/control/statcach.cxx  |3 +--
 sfx2/source/control/unoctitm.cxx  |   14 --
 sfx2/source/statbar/stbitem.cxx   |3 +--
 sfx2/source/toolbox/tbxitem.cxx   |3 +--
 7 files changed, 8 insertions(+), 36 deletions(-)

New commits:
commit 3fdfee3268aeae5c9a06527c0f973d258c2188c6
Author: Noel Grandin 
AuthorDate: Tue Jan 17 09:48:10 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 16:10:45 2023 +

XUnoTunnel->dynamic_cast in SfxOfficeDispatch

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

diff --git a/sfx2/inc/unoctitm.hxx b/sfx2/inc/unoctitm.hxx
index 812dbce7077d..d23b8c9fd714 100644
--- a/sfx2/inc/unoctitm.hxx
+++ b/sfx2/inc/unoctitm.hxx
@@ -20,7 +20,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -67,7 +66,7 @@ public:
 
 class SfxSlotServer;
 class SfxDispatchController_Impl;
-class SfxOfficeDispatch final : public 
cppu::ImplInheritanceHelper
+class SfxOfficeDispatch final : public 
cppu::ImplInheritanceHelper
 {
 friend class SfxDispatchController_Impl;
 std::unique_ptr  pImpl;
@@ -89,10 +88,6 @@ public:
 virtual void   SAL_CALL addStatusListener( const css::uno::Reference< 
css::frame::XStatusListener > & xControl,
const css::util::URL& aURL) 
override;
 
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override ;
-static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
-
 static bool IsMasterUnoCommand( const css::util::URL& aURL );
 static OUString GetMasterUnoCommand( const css::util::URL& aURL );
 
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 4ea06231562a..51d6b36d237f 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1529,7 +1529,7 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, 
std::unique_ptr(xDisp))
+if (!dynamic_cast(xDisp.get()))
 {
 bool bDeleteCache = false;
 if ( !pCache )
@@ -1648,15 +1648,10 @@ sal_uInt16 SfxBindings::QuerySlotId( const util::URL& 
aURL )
 if (!xDispatch.is())
 return 0;
 
-css::uno::Reference xTunnel(xDispatch, 
css::uno::UNO_QUERY);
-if (!xTunnel.is())
+SfxOfficeDispatch* pDispatch = 
dynamic_cast(xDispatch.get());
+if (!pDispatch)
 return 0;
 
-sal_Int64 nHandle = 
xTunnel->getSomething(SfxOfficeDispatch::getUnoTunnelId());
-if (!nHandle)
-return 0;
-
-SfxOfficeDispatch* pDispatch = 
reinterpret_cast(sal::static_int_cast(nHandle));
 return pDispatch->GetId();
 }
 
diff --git a/sfx2/source/control/sfxstatuslistener.cxx 
b/sfx2/source/control/sfxstatuslistener.cxx
index 5ee3d471f21a..7cc4e8dd688b 100644
--- a/sfx2/source/control/sfxstatuslistener.cxx
+++ b/sfx2/source/control/sfxstatuslistener.cxx
@@ -142,8 +142,7 @@ void SAL_CALL SfxStatusListener::statusChanged( const 
FeatureStateEvent& rEvent)
 SfxViewFrame* pViewFrame = nullptr;
 if ( m_xDispatch.is() )
 {
-Reference< XUnoTunnel > xTunnel( m_xDispatch, UNO_QUERY );
-if (auto pDisp = 
comphelper::getFromUnoTunnel(xTunnel))
+if (auto pDisp = dynamic_cast(m_xDispatch.get()))
 pViewFrame = pDisp->GetDispatcher_Impl()->GetFrame();
 }
 
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
index 3360ebbabfdf..ee20d38c5d81 100644
--- a/sfx2/source/control/statcach.cxx
+++ b/sfx2/source/control/statcach.cxx
@@ -263,8 +263,7 @@ const SfxSlotServer* SfxStateCache::GetSlotServer( 
SfxDispatcher &rDispat , cons
 if ( xDisp.is() )
 {
 // test the dispatch object if it is just a wrapper for a 
SfxDispatcher
-css::uno::Reference< css::lang::XUnoTunnel > xTunnel( xDisp, 
css::uno::UNO_QUERY );
-if (auto pDisp = 
comphelper::getFromUnoTunnel(xTunnel))
+if (auto pDisp = dynamic_cast(xDisp.get()))
 {
 // The intercepting object is an SFX component
 // If this dispatch object does not use the wanted 
dispatcher or the AppDispatcher, it's treated like any other UNO component
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 20934ecf8f56..bcee2360e268 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -173,12 +173,6 @@ void SAL_CALL SfxStatusDispatcher::removeStatusListener( 
const css::uno::Referen
 }
 
 
-// XUnoTunnel
-sal_Int64 SAL_CALL SfxOfficeDispatch

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

2023-01-17 Thread Noel Grandin (via logerrit)
 sfx2/source/control/thumbnailviewacc.cxx |   20 +---
 sfx2/source/control/thumbnailviewacc.hxx |8 +---
 2 files changed, 2 insertions(+), 26 deletions(-)

New commits:
commit 23e6c378b6d3045d295ad665ae32de65f7f8a47f
Author: Noel Grandin 
AuthorDate: Tue Jan 17 09:42:16 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 16:10:23 2023 +

XUnoTunnel->dynamic_cast in ThumbnailViewAcc

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

diff --git a/sfx2/source/control/thumbnailviewacc.cxx 
b/sfx2/source/control/thumbnailviewacc.cxx
index adc6b30f454f..70b898e9dacb 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -44,23 +44,10 @@ ThumbnailViewAcc::~ThumbnailViewAcc()
 {
 }
 
-const uno::Sequence< sal_Int8 >& ThumbnailViewAcc::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theSfxValueSetAccUnoTunnelId;
-return theSfxValueSetAccUnoTunnelId.getSeq();
-}
-
 ThumbnailViewAcc* ThumbnailViewAcc::getImplementation( const uno::Reference< 
uno::XInterface >& rxData )
 noexcept
 {
-try
-{
-return comphelper::getFromUnoTunnel(rxData);
-}
-catch(const css::uno::Exception&)
-{
-return nullptr;
-}
+return dynamic_cast(rxData.get());
 }
 
 uno::Reference< accessibility::XAccessibleContext > SAL_CALL 
ThumbnailViewAcc::getAccessibleContext()
@@ -450,11 +437,6 @@ void SAL_CALL ThumbnailViewAcc::deselectAccessibleChild( 
sal_Int64 nChildIndex)
 //FIXME TODO;
 }
 
-sal_Int64 SAL_CALL ThumbnailViewAcc::getSomething( const uno::Sequence< 
sal_Int8 >& rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 void ThumbnailViewAcc::disposing(std::unique_lock& rGuard)
 {
 ::std::vector > 
aListenerListCopy;
diff --git a/sfx2/source/control/thumbnailviewacc.hxx 
b/sfx2/source/control/thumbnailviewacc.hxx
index 11f5cf4fa3b6..9a6abfb6bd09 100644
--- a/sfx2/source/control/thumbnailviewacc.hxx
+++ b/sfx2/source/control/thumbnailviewacc.hxx
@@ -23,7 +23,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -40,8 +39,7 @@ typedef comphelper::WeakComponentImplHelper<
 css::accessibility::XAccessibleEventBroadcaster,
 css::accessibility::XAccessibleContext,
 css::accessibility::XAccessibleComponent,
-css::accessibility::XAccessibleSelection,
-css::lang::XUnoTunnel >
+css::accessibility::XAccessibleSelection >
 ValueSetAccComponentBase;
 
 class ThumbnailViewAcc :
@@ -110,10 +108,6 @@ public:
 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL 
getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
 virtual void SAL_CALL deselectAccessibleChild( sal_Int64 
nSelectedChildIndex ) override;
 
-// XUnoTunnel
-static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& rId ) override;
-
 private:
 ::std::vector< css::uno::Reference<
 css::accessibility::XAccessibleEventListener > >   mxEventListeners;


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

2023-01-17 Thread Stephan Bergmann (via logerrit)
 vcl/osx/salframeview.mm |1 -
 1 file changed, 1 deletion(-)

New commits:
commit ea70cf3ca06a5b101d51ca1f4d4a106747a884ae
Author: Stephan Bergmann 
AuthorDate: Tue Jan 17 15:47:10 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 17 16:14:15 2023 +

loplugin:casttovoid ("unnecessary cast to void")

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index b14d87eb7a37..98765c761969 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -333,7 +333,6 @@ static AquaSalFrame* getMouseContainerFrame()
 
 -(void)windowDidResize: (NSNotification*)pNotification
 {
-(void)pNotification;
 SolarMutexGuard aGuard;
 
 if ( mbInWindowDidResize )


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

2023-01-17 Thread Jean-Pierre Ledure (via logerrit)
 wizards/source/sfdocuments/SF_Calc.xba |   35 -
 1 file changed, 18 insertions(+), 17 deletions(-)

New commits:
commit c7ac513a8217179c5fae774363e8b0b1f41cea5c
Author: Jean-Pierre Ledure 
AuthorDate: Mon Jan 16 16:25:22 2023 +0100
Commit: Jean-Pierre Ledure 
CommitDate: Tue Jan 17 16:17:45 2023 +

ScriptForge - (SF_Calc) fix CompactUp/CompactLeft methods

When
  - WholeRow/WholeColumn = False
  - no row or column matches the FilterFormula
the cells below or at the right were erroneously
shifted down or right.

Future behaviour:
- when nothing to compact,
   the initial range is left unchanged
   the return value = the initial range
- when all rows/columns are impacted,
   the initial range is cleared
   the return value = zero-length string
- otherwise
   the initial range is compacted
   the return value is the compacted range
In either case, the surrounding cells are unchanged.

Change-Id: I27288878dcadeb4ded297b7bb1e6897947ed5e56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145622
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure 

diff --git a/wizards/source/sfdocuments/SF_Calc.xba 
b/wizards/source/sfdocuments/SF_Calc.xba
index 806f30bd7cad..391321f361d8 100644
--- a/wizards/source/sfdocuments/SF_Calc.xba
+++ b/wizards/source/sfdocuments/SF_Calc.xba
@@ -673,16 +673,17 @@ Try:
Next i

'  Compute the final range position
-   If lCountDeleted < .Width Then sCompact = Offset(Range, 0, 
0, 0, .Width - lCountDeleted)
-
-   '  Push to the right the cells that migrated leftwards 
irrelevantly
-   If Not WholeColumn Then
-   If Len(sCompact) > 0 Then
+   If lCountDeleted > 0 Then
+   sCompact = Offset(Range, 0, 0, 0, .Width - 
lCountDeleted)
+   '  Push to the right the cells that migrated 
leftwards irrelevantly
+   If Not WholeColumn Then
sShiftRange = Offset(sCompact, 0, .Width - 
lCountDeleted, , lCountDeleted)
-   Else
-   sShiftRange = .RangeName
+   ShiftRight(sShiftRange, WholeColumn := False)
End If
-   ShiftRight(sShiftRange, WholeColumn := False)
+   '  Conventionally, if all columns are deleted, the 
returned range is the zero-length string
+   If .Width = lCountDeleted Then sCompact = ""
+   Else'  Initial range is left unchanged
+   sCompact = .RangeName
End If
 
End With
@@ -724,7 +725,6 @@ Public Function CompactUp(Optional ByVal Range As Variant _
 ''' '  The rows having a "X" 
in column G are completely suppressed
 
 Dim sCompact As String '  Return value
-Dim oCompact As Object '  Return value as an _Address type
 Dim lCountDeleted As Long  '  Count the deleted rows
 Dim vCompactRanges As Variant  '  Array of ranges to be compacted based 
on the formula
 Dim oSourceAddress As Object   '  Alias of Range as _Address
@@ -768,16 +768,17 @@ Try:
Next i

'  Compute the final range position
-   If lCountDeleted < .Height Then sCompact = Offset(Range, 0, 
0, .Height - lCountDeleted, 0)
-
-   '  Push downwards the cells that migrated upwards 
irrelevantly
-   If Not WholeRow Then
-   If Len(sCompact) > 0 Then
+   If lCountDeleted > 0 Then
+   sCompact = Offset(Range, 0, 0, .Height - lCountDeleted, 
0)
+   '  Push downwards the cells that migrated upwards 
irrelevantly
+   If Not WholeRow Then
sShiftRange = Offset(sCompact, .Height - 
lCountDeleted, 0, lCountDeleted)
-   Else
-   sShiftRange = .RangeName
+   ShiftDown(sShiftRange, WholeRow := False)
End If
-   ShiftDown(sShiftRange, WholeRow := False)
+   '  Conventionally, if all rows are deleted, the 
returned range is the zero-length string
+   If .Height = lCountDeleted Then sCompact = ""
+   Else'  Initial range is left unchanged
+   sCompact = .RangeName
End If
 
End With


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

2023-01-17 Thread Caolán McNamara (via logerrit)
 cui/source/tabpages/numfmt.cxx |   24 +++-
 1 file changed, 19 insertions(+), 5 deletions(-)

New commits:
commit bbf1d7faca7912016855b51a10c93a064675e213
Author: Caolán McNamara 
AuthorDate: Tue Jan 17 12:15:22 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 17 17:12:18 2023 +

tdf#152637 format cells example text black on dark background

with application colors, scheme: LibreOffice Dark enabled

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

diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index ea52910f9fd1..e6e669de6422 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -111,9 +111,19 @@ void SvxNumberPreview::NotifyChange( const OUString& 
rPrevStr,
 mnPos = -1;
 }
 }
-svtools::ColorConfig aColorConfig;
-Color aWindowTextColor( aColorConfig.GetColorValue( svtools::FONTCOLOR 
).nColor );
-aPrevCol = pColor ? *pColor : aWindowTextColor;
+if (pColor)
+aPrevCol = *pColor;
+else
+{
+svtools::ColorConfig aColorConfig;
+Color aFgColor = aColorConfig.GetColorValue(svtools::FONTCOLOR, 
false).nColor;
+if (aFgColor == COL_AUTO)
+{
+Color aBgColor = 
aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor;
+aFgColor = aBgColor.IsDark() ? COL_WHITE : COL_BLACK;
+}
+aPrevCol = aFgColor;
+}
 Invalidate();
 }
 
@@ -133,8 +143,12 @@ void SvxNumberPreview::Paint(vcl::RenderContext& 
rRenderContext, const ::tools::
 rRenderContext.Push(vcl::PushFlags::ALL);
 
 svtools::ColorConfig aColorConfig;
-
rRenderContext.SetTextColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor);
-
rRenderContext.SetBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
+Color aBgColor = aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor;
+Color aFgColor = aColorConfig.GetColorValue(svtools::FONTCOLOR, 
false).nColor;
+if (aFgColor == COL_AUTO)
+aFgColor = aBgColor.IsDark() ? COL_WHITE : COL_BLACK;
+rRenderContext.SetBackground(aBgColor);
+rRenderContext.SetTextColor(aFgColor);
 rRenderContext.Erase();
 
 vcl::Font aDrawFont = rRenderContext.GetFont();


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

2023-01-17 Thread Fred Kruse (via logerrit)
 offapi/com/sun/star/style/ParagraphProperties.idl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 924005b06732d6d7aea2437a9edf2550878f9324
Author: Fred Kruse 
AuthorDate: Tue Jan 17 16:07:25 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 17 17:36:14 2023 +

ParagraphProperties.idl: SortedTextId: Changed 7.5 -> 7.6

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

diff --git a/offapi/com/sun/star/style/ParagraphProperties.idl 
b/offapi/com/sun/star/style/ParagraphProperties.idl
index a7d6c059bd8a..49fa8d50d4d6 100644
--- a/offapi/com/sun/star/style/ParagraphProperties.idl
+++ b/offapi/com/sun/star/style/ParagraphProperties.idl
@@ -425,7 +425,7 @@ published service ParagraphProperties
 other paragraphs of the same text, i.e. a paragraph with lower
 identifier is there before the other ones with greater values.
 This property depends on implementation details and is considered 
experimental.
-@since LibreOffice 7.5
+@since LibreOffice 7.6
  */
 [optional, property, readonly] long SortedTextId;
 };


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

2023-01-17 Thread Noel Grandin (via logerrit)
 sfx2/source/control/thumbnailviewacc.cxx |   20 +---
 sfx2/source/control/thumbnailviewacc.hxx |7 +--
 2 files changed, 2 insertions(+), 25 deletions(-)

New commits:
commit 74600e794903daf0e9be5ba20df1680c715f63c9
Author: Noel Grandin 
AuthorDate: Tue Jan 17 09:40:54 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 18:17:57 2023 +

XUnoTunnel->dynamic_cast in ThumbnailViewItemAcc

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

diff --git a/sfx2/source/control/thumbnailviewacc.cxx 
b/sfx2/source/control/thumbnailviewacc.cxx
index 70b898e9dacb..f157b155cddd 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -539,23 +539,10 @@ void ThumbnailViewAcc::FireAccessibleEvent( short 
nEventId, const uno::Any& rOld
 }
 }
 
-const uno::Sequence< sal_Int8 >& ThumbnailViewItemAcc::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theValueItemAccUnoTunnelId;
-return theValueItemAccUnoTunnelId.getSeq();
-}
-
 ThumbnailViewItemAcc* ThumbnailViewItemAcc::getImplementation( const 
uno::Reference< uno::XInterface >& rxData )
 noexcept
 {
-try
-{
-return comphelper::getFromUnoTunnel(rxData);
-}
-catch(const css::uno::Exception&)
-{
-return nullptr;
-}
+return dynamic_cast(rxData.get());
 }
 
 void ThumbnailViewAcc::GetFocus()
@@ -862,9 +849,4 @@ sal_Int32 SAL_CALL ThumbnailViewItemAcc::getBackground(  )
 return 
static_cast(Application::GetSettings().GetStyleSettings().GetWindowColor());
 }
 
-sal_Int64 SAL_CALL ThumbnailViewItemAcc::getSomething( const uno::Sequence< 
sal_Int8 >& rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/thumbnailviewacc.hxx 
b/sfx2/source/control/thumbnailviewacc.hxx
index 9a6abfb6bd09..1fcf9d3ac9a6 100644
--- a/sfx2/source/control/thumbnailviewacc.hxx
+++ b/sfx2/source/control/thumbnailviewacc.hxx
@@ -147,8 +147,7 @@ private:
 class ThumbnailViewItemAcc : public ::cppu::WeakImplHelper< 
css::accessibility::XAccessible,
  
css::accessibility::XAccessibleEventBroadcaster,
  
css::accessibility::XAccessibleContext,
- 
css::accessibility::XAccessibleComponent,
- css::lang::XUnoTunnel >
+ 
css::accessibility::XAccessibleComponent>
 {
 private:
 
@@ -198,10 +197,6 @@ public:
 virtual void SAL_CALL grabFocus(  ) override;
 virtual sal_Int32 SAL_CALL getForeground(  ) override;
 virtual sal_Int32 SAL_CALL getBackground(  ) override;
-
-// XUnoTunnel
-static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& rId ) override;
 };
 
 #endif // INCLUDED_SFX2_SOURCE_CONTROL_THUMBNAILVIEWACC_HXX


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

2023-01-17 Thread Andrea Gelmini (via logerrit)
 framework/source/fwe/helper/titlehelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c4341c95a2be2e0210d5f8f15d4dd80d9077c4af
Author: Andrea Gelmini 
AuthorDate: Tue Jan 17 14:37:36 2023 +0100
Commit: Julien Nabet 
CommitDate: Tue Jan 17 18:59:38 2023 +

Fix typo

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

diff --git a/framework/source/fwe/helper/titlehelper.cxx 
b/framework/source/fwe/helper/titlehelper.cxx
index 51025f71e4a5..31981d403b4f 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -105,7 +105,7 @@ OUString SAL_CALL TitleHelper::getTitle()
 if (!m_sTitle.isEmpty())
 return m_sTitle;
 
-// Title seems to be unused till now ... do bootstraping
+// Title seems to be unused till now ... do bootstrapping
 impl_updateTitle (true);
 
 return m_sTitle;


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

2023-01-17 Thread Noel Grandin (via logerrit)
 package/inc/ZipPackageEntry.hxx   |4 -
 package/inc/ZipPackageFolder.hxx  |9 --
 package/inc/ZipPackageStream.hxx  |5 -
 package/source/xstor/owriteablestream.cxx |5 -
 package/source/xstor/owriteablestream.hxx |1 
 package/source/xstor/xstorage.cxx |   30 -
 package/source/zipapi/ZipFile.cxx |1 
 package/source/zippackage/ZipPackage.cxx  |   44 ++
 package/source/zippackage/ZipPackageEntry.cxx |2 
 package/source/zippackage/ZipPackageFolder.cxx|   24 ++-
 package/source/zippackage/ZipPackageFolderEnumeration.cxx |3 
 package/source/zippackage/ZipPackageStream.cxx|   27 ++--
 12 files changed, 54 insertions(+), 101 deletions(-)

New commits:
commit a04bf69bccfbc266643b418ef57030a42bbb5c05
Author: Noel Grandin 
AuthorDate: Mon Jan 16 10:36:59 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 19:09:51 2023 +

XUnoTunnel->dynamic_cast in ZipPackageEntry

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

diff --git a/package/inc/ZipPackageEntry.hxx b/package/inc/ZipPackageEntry.hxx
index 2617e6275628..27ad017aa859 100644
--- a/package/inc/ZipPackageEntry.hxx
+++ b/package/inc/ZipPackageEntry.hxx
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include "ZipEntry.hxx"
@@ -39,7 +38,6 @@ class ZipPackageEntry : public cppu::WeakImplHelper
 <
 css::container::XNamed,
 css::container::XChild,
-css::lang::XUnoTunnel,
 css::beans::XPropertySet,
 css::lang::XServiceInfo
 >
@@ -82,8 +80,6 @@ public:
 // XChild
 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent(  ) 
override;
 virtual void SAL_CALL setParent( const css::uno::Reference< 
css::uno::XInterface >& Parent ) override;
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override = 0;
 // XPropertySet
 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL 
getPropertySetInfo(  ) override;
 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, 
const css::uno::Any& aValue ) override = 0;
diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx
index 82582293158f..cfdcd99d1694 100644
--- a/package/inc/ZipPackageFolder.hxx
+++ b/package/inc/ZipPackageFolder.hxx
@@ -23,9 +23,9 @@
 #include 
 #include 
 #include 
-#include 
 #include "ZipPackageEntry.hxx"
 #include 
+#include 
 
 #include 
 #include 
@@ -38,7 +38,7 @@ class ZipPackageStream;
 
 struct ZipContentInfo
 {
-css::uno::Reference < css::lang::XUnoTunnel > xTunnel;
+rtl::Reference < ZipPackageEntry > xPackageEntry;
 bool bFolder;
 union
 {
@@ -91,8 +91,6 @@ public:
 
 ZipContentInfo& doGetByName( const OUString& aName );
 
-static const css::uno::Sequence < sal_Int8 > & getUnoTunnelId();
-
 void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; }
 void setRemoveOnInsertMode_Impl( bool bRemove ) { mbAllowRemoveOnInsert = 
bRemove; }
 
@@ -136,9 +134,6 @@ public:
 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, 
const css::uno::Any& aValue ) override;
 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& 
PropertyName ) override;
 
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-
 // XServiceInfo
 virtual OUString SAL_CALL getImplementationName(  ) override;
 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) 
override;
diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx
index aa150717474d..194ff729adbe 100644
--- a/package/inc/ZipPackageStream.hxx
+++ b/package/inc/ZipPackageStream.hxx
@@ -137,8 +137,6 @@ public:
 void setZipEntryOnLoading( const ZipEntry &rInEntry);
 void successfullyWritten( ZipEntry const *pEntry );
 
-static const css::uno::Sequence < sal_Int8 > & getUnoTunnelId();
-
 // XActiveDataSink
 virtual void SAL_CALL setInputStream( const css::uno::Reference< 
css::io::XInputStream >& aStream ) override;
 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL 
getInputStream(  ) override;
@@ -152,9 +150,6 @@ public:
 const css::uno::Reference< css::io::XInputStream >& 
aStream ) override;
 virtual css::uno::Reference< css::io::XInputStream > SAL_CALL 
getPlainRawStream() override;
 
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-
 // XPropertySet
 virtual void SAL_CALL setPropertyValue( cons

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

2023-01-17 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/docvw/HeaderFooterWin.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit cd0ea49d95fcb3af5b7408c9bbea553480a12f92
Author: Caolán McNamara 
AuthorDate: Tue Jan 17 10:25:54 2023 +
Commit: Xisco Fauli 
CommitDate: Tue Jan 17 20:35:45 2023 +

Resolves: tdf#153059 after ChangeHeaderOrFooter the control can be disposed

If the cursor is still on page one then when a header, via a control on
another page, is added it jumps back to that page, so the widget on the
now hidden page is removed, but the click handler hasn't completed so
the follow up action to change it from a "plus" button to a dropdown
menubutton was on a disposed widget.

Change-Id: I981126412a0ee6a667d77fb97a3db2f2b0a0363c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145585
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx 
b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 07ce07197846..6c184c6fecff 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -549,8 +549,13 @@ IMPL_LINK_NOARG(SwHeaderFooterWin, ClickHdl, 
weld::Button&, void)
 
 const SwPageFrame* pPageFrame = 
SwFrameMenuButtonBase::GetPageFrame(m_pFrame);
 const OUString& rStyleName = pPageFrame->GetPageDesc()->GetName();
-rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
-
+{
+VclPtr xThis(this);
+rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
+//tdf#153059 after ChangeHeaderOrFooter is it possible that "this" is 
disposed
+if (xThis->isDisposed())
+return;
+}
 m_xPushButton->hide();
 m_xMenuButton->show();
 PaintButton();


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

2023-01-17 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/docvw/HeaderFooterWin.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit a64d8610fdbe56df67df03e6fadfff9ab7a0c441
Author: Caolán McNamara 
AuthorDate: Tue Jan 17 10:25:54 2023 +
Commit: Xisco Fauli 
CommitDate: Tue Jan 17 20:35:39 2023 +

Resolves: tdf#153059 after ChangeHeaderOrFooter the control can be disposed

If the cursor is still on page one then when a header, via a control on
another page, is added it jumps back to that page, so the widget on the
now hidden page is removed, but the click handler hasn't completed so
the follow up action to change it from a "plus" button to a dropdown
menubutton was on a disposed widget.

Change-Id: I981126412a0ee6a667d77fb97a3db2f2b0a0363c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145584
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx 
b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 0e79e1481012..539a310b08aa 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -549,8 +549,13 @@ IMPL_LINK_NOARG(SwHeaderFooterWin, ClickHdl, 
weld::Button&, void)
 
 const SwPageFrame* pPageFrame = 
SwFrameMenuButtonBase::GetPageFrame(m_pFrame);
 const OUString& rStyleName = pPageFrame->GetPageDesc()->GetName();
-rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
-
+{
+VclPtr xThis(this);
+rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
+//tdf#153059 after ChangeHeaderOrFooter is it possible that "this" is 
disposed
+if (xThis->isDisposed())
+return;
+}
 m_xPushButton->hide();
 m_xMenuButton->show();
 PaintButton();


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

2023-01-17 Thread Caolán McNamara (via logerrit)
 sw/source/uibase/docvw/HeaderFooterWin.cxx |9 -
 vcl/unx/gtk3/gtkframe.cxx  |   46 +
 2 files changed, 53 insertions(+), 2 deletions(-)

New commits:
commit b5480ea6c55ff550390ac8d146a2996f7234712e
Author: Caolán McNamara 
AuthorDate: Tue Jan 17 16:56:57 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 17 21:04:52 2023 +

gtk4: some basis for experimenting on a11y support

4.10 makes GtkAccessible public

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

diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 864e8934c7ad..d8c48891e757 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -832,6 +832,48 @@ void GtkSalFrame::resizeWindow( tools::Long nWidth, 
tools::Long nHeight )
 window_resize(nWidth, nHeight);
 }
 
+#if GTK_CHECK_VERSION(4,9,0)
+
+#define LO_TYPE_DRAWING_AREA (lo_drawing_area_get_type())
+#define LO_DRAWING_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), 
LO_TYPE_DRAWING_AREA, LODrawingArea))
+#define LO_IS_DRAWING_AREA(obj)  (G_TYPE_CHECK_INSTANCE_TYPE((obj), 
LO_TYPE_DRAWING_AREA))
+
+struct LODrawingArea
+{
+GtkDrawingArea parent_instance;
+};
+
+struct LODrawingAreaClass
+{
+GtkDrawingAreaClass parent_class;
+};
+
+static void lo_drawing_area_accessible_init(GtkAccessibleInterface *iface)
+{
+// doesn't actually do anything useful yet, just forward back to base impl 
for now
+GtkAccessibleInterface *parent_iface = 
static_cast(g_type_interface_peek_parent(iface));
+iface->get_at_context = parent_iface->get_at_context;
+iface->get_platform_state = parent_iface->get_platform_state;
+}
+
+G_DEFINE_TYPE_WITH_CODE(LODrawingArea, lo_drawing_area, GTK_TYPE_DRAWING_AREA,
+G_IMPLEMENT_INTERFACE(GTK_TYPE_ACCESSIBLE, 
lo_drawing_area_accessible_init))
+
+static void lo_drawing_area_class_init(LODrawingAreaClass* /*klass*/)
+{
+}
+
+static void lo_drawing_area_init(LODrawingArea* /*area*/)
+{
+}
+
+GtkWidget* lo_drawing_area_new()
+{
+return GTK_WIDGET(g_object_new(LO_TYPE_DRAWING_AREA, nullptr));
+}
+
+#endif
+
 #if !GTK_CHECK_VERSION(4,0,0)
 // tdf#124694 GtkFixed takes the max size of all its children as its
 // preferred size, causing it to not clip its child, but grow instead.
@@ -960,7 +1002,11 @@ void GtkSalFrame::InitCommon()
 #else
 m_pOverlay = GTK_OVERLAY(gtk_overlay_new());
 m_pFixedContainer = GTK_FIXED(gtk_fixed_new());
+#if GTK_CHECK_VERSION(4,9,0)
+m_pDrawingArea = GTK_DRAWING_AREA(lo_drawing_area_new());
+#else
 m_pDrawingArea = GTK_DRAWING_AREA(gtk_drawing_area_new());
+#endif
 #endif
 gtk_widget_set_can_focus(GTK_WIDGET(m_pFixedContainer), true);
 gtk_widget_set_size_request(GTK_WIDGET(m_pFixedContainer), 1, 1);
commit a21258c86e7fd1c64b11216a809f430627a06476
Author: Caolán McNamara 
AuthorDate: Tue Jan 17 10:25:54 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 17 21:04:39 2023 +

Resolves: tdf#153059 after ChangeHeaderOrFooter the control can be disposed

If the cursor is still on page one then when a header, via a control on
another page, is added it jumps back to that page, so the widget on the
now hidden page is removed, but the click handler hasn't completed so
the follow up action to change it from a "plus" button to a dropdown
menubutton was on a disposed widget.

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

diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx 
b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 0e79e1481012..539a310b08aa 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -549,8 +549,13 @@ IMPL_LINK_NOARG(SwHeaderFooterWin, ClickHdl, 
weld::Button&, void)
 
 const SwPageFrame* pPageFrame = 
SwFrameMenuButtonBase::GetPageFrame(m_pFrame);
 const OUString& rStyleName = pPageFrame->GetPageDesc()->GetName();
-rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
-
+{
+VclPtr xThis(this);
+rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
+//tdf#153059 after ChangeHeaderOrFooter is it possible that "this" is 
disposed
+if (xThis->isDisposed())
+return;
+}
 m_xPushButton->hide();
 m_xMenuButton->show();
 PaintButton();


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

2023-01-17 Thread Noel Grandin (via logerrit)
 include/svl/zforlist.hxx   |6 +-
 sc/qa/uitest/calc_tests/formatCells.py |8 
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit db28a0cc2e11e1319509e13172fadf4b54d50ecf
Author: Noel Grandin 
AuthorDate: Mon Jan 16 13:43:13 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 21:06:59 2023 +

tdf#153006 ordering of date/time formats in report builder

regression from
commit 17d2247a66b6a9e3105b0a8b8e6d6b5bea5e3ed4
Author: Noel Grandin 
Date:   Fri Aug 13 19:03:23 2021 +0200
formatter maps can use unordered_map

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

diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 0020d8fde6a3..4159ce0fbebc 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 namespace com::sun::star::i18n { struct Currency; }
@@ -279,7 +280,10 @@ enum NfEvalDateFormat
 };
 
 
-typedef std::unordered_map SvNumberFormatTable;
+/// This table is std::map because it needs to preserve insertion order,
+/// because the formats are roughly ordered from most to least common, and some
+/// parts of the UI want to show them in that order.
+typedef std::map SvNumberFormatTable;
 typedef std::unordered_map SvNumberFormatterIndexTable;
 typedef std::unordered_map< sal_uInt32, sal_uInt32> SvNumberFormatterMergeMap;
 
diff --git a/sc/qa/uitest/calc_tests/formatCells.py 
b/sc/qa/uitest/calc_tests/formatCells.py
index 2d9f369c3b59..16fb19c8cc18 100644
--- a/sc/qa/uitest/calc_tests/formatCells.py
+++ b/sc/qa/uitest/calc_tests/formatCells.py
@@ -420,22 +420,22 @@ class formatCell(UITestCase):
 
 # NatNum12 number formats
 
-entry = formatlb.getChild("6")
+entry = formatlb.getChild("11")
 self.assertEqual(get_state_as_dict(entry)["Text"], "ONE 
HUNDRED")
 entry.executeAction("SELECT", tuple())
 self.assertEqual(get_state_as_dict(xformatted)["Text"], 
"[NatNum12 upper cardinal]0")
 
-entry = formatlb.getChild("7")
+entry = formatlb.getChild("10")
 self.assertEqual(get_state_as_dict(entry)["Text"], "One 
Hundred")
 entry.executeAction("SELECT", tuple())
 self.assertEqual(get_state_as_dict(xformatted)["Text"], 
"[NatNum12 title cardinal]0")
 
-entry = formatlb.getChild("8")
+entry = formatlb.getChild("9")
 self.assertEqual(get_state_as_dict(entry)["Text"], "One 
hundred")
 entry.executeAction("SELECT", tuple())
 self.assertEqual(get_state_as_dict(xformatted)["Text"], 
"[NatNum12 capitalize cardinal]0")
 
-entry = formatlb.getChild("9")
+entry = formatlb.getChild("8")
 self.assertEqual(get_state_as_dict(entry)["Text"], "one 
hundred")
 entry.executeAction("SELECT", tuple())
 self.assertEqual(get_state_as_dict(xformatted)["Text"], 
"[NatNum12 cardinal]0")


Upgrading mdds and orcus coming soon

2023-01-17 Thread Kohei Yoshida

Hi there,

I'll be working on upgrading the mdds and orcus libraries to versions 
2.1.0 and 0.18.0 respectively.  Not sure how long the process will take, 
but hopefully it will be finished with a week.


Kohei


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

2023-01-17 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/data/conditional-text.fodt |2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx|7 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 98550980e414ca6d611e6c3779eed2e5e66f5641
Author: Justin Luth 
AuthorDate: Tue Jan 17 14:26:52 2023 -0500
Commit: Justin Luth 
CommitDate: Tue Jan 17 22:18:42 2023 +

tdf#114537 docx export: export conditional text in quotes

DOCX is very much dependent on the true and false text
being in quotes. Likely any inside quotes need to be escaped,
but I haven't looked at that yet.

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

diff --git a/sw/qa/extras/ooxmlexport/data/conditional-text.fodt 
b/sw/qa/extras/ooxmlexport/data/conditional-text.fodt
index 296c1c4ecc4d..244fdf84b6e1 100644
--- a/sw/qa/extras/ooxmlexport/data/conditional-text.fodt
+++ b/sw/qa/extras/ooxmlexport/data/conditional-text.fodt
@@ -2,7 +2,7 @@
 http://openoffice.org/2004/writer"; 
office:mimetype="application/vnd.oasis.opendocument.text">
  
   
-   True
+   True
   
  
 
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0a95e6c44cd6..b8a7dee024ec 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -8737,7 +8737,7 @@ void DocxAttributeOutput::HiddenField(const SwField& 
rField)
 OUString aTrueFalse = rField.GetPar2();
 sal_Int32 nPos = aTrueFalse.indexOf('|');
 OUString aTrue;
-std::u16string_view aFalse;
+OUString aFalse;
 if (nPos == -1)
 {
 aTrue = aTrueFalse;
@@ -8747,6 +8747,11 @@ void DocxAttributeOutput::HiddenField(const SwField& 
rField)
 aTrue = aTrueFalse.subView(0, nPos);
 aFalse = aTrueFalse.subView(nPos + 1);
 }
+if (aTrue.getLength() > 1 && aTrue.startsWith("\"") && 
aTrue.endsWith("\""))
+aTrue = aTrue.copy(1, aTrue.getLength() - 2);
+if (aFalse.getLength() > 1 && aFalse.startsWith("\"") && 
aFalse.endsWith("\""))
+aFalse = aFalse.copy(1, aFalse.getLength() - 2);
+
 OUString aCmd = FieldString(ww::eIF) + aCond + " \"" + aTrue + "\" \"" 
+ aFalse + "\"";
 m_rExport.OutputField(&rField, ww::eIF, aCmd);
 return;


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

2023-01-17 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit ef558d0aab44421ad5cd8362724ff1410af1b480
Author: Patrick Luby 
AuthorDate: Tue Jan 17 16:26:00 2023 -0500
Commit: Patrick Luby 
CommitDate: Tue Jan 17 22:21:04 2023 +

Related: tdf#42437 Skip special press-and-hold handling for action keys

Pressing and holding action keys such as arrow keys must not be handled
like pressing and holding a character key as it will insert unexpected
text.

Change-Id: I6beaff265e6cae30337b025791692ff67b760ff8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145689
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 98765c761969..b36cd23721ea 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1115,7 +1115,11 @@ static AquaSalFrame* getMouseContainerFrame()
 // Handle repeat key events by explicitly inserting the text if
 // -[NSResponder interpretKeyEvents:] does not insert or mark any
 // text. Note: do not do this step if there is uncommitted text.
-if ( !mpLastMarkedText && mpLastEvent && [mpLastEvent type] == 
NSEventTypeKeyDown && [mpLastEvent isARepeat] )
+// Related: tdf#42437 Skip special press-and-hold handling for 
action keys
+// Pressing and holding action keys such as arrow keys must not be
+// handled like pressing and holding a character key as it will
+// insert unexpected text.
+if ( !mbKeyHandled && !mpLastMarkedText && mpLastEvent && 
[mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent isARepeat] )
 {
 NSString *pChars = [mpLastEvent characters];
 [self insertText:pChars replacementRange:NSMakeRange( 0, 
[pChars length] )];
@@ -1264,9 +1268,13 @@ static AquaSalFrame* getMouseContainerFrame()
 mpFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
 
 }
-mbKeyHandled = true;
 [self unmarkText];
 }
+
+// Mark event as handled even if the frame isn't valid like is done in
+// [self setMarkedText:selectedRange:replacementRange:] and
+// [self doCommandBySelector:]
+mbKeyHandled = true;
 }
 
 -(void)insertTab: (id)aSender


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - vcl/osx

2023-01-17 Thread Patrick Luby (via logerrit)
 vcl/osx/salframeview.mm |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 55965358a39120e078820c67a6a5adfa3caec382
Author: Patrick Luby 
AuthorDate: Tue Jan 17 16:26:00 2023 -0500
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Jan 18 00:13:38 2023 +

Related: tdf#42437 Skip special press-and-hold handling for action keys

Pressing and holding action keys such as arrow keys must not be handled
like pressing and holding a character key as it will insert unexpected
text.

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

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 355fc84a76b4..09643b5c307d 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1028,7 +1028,11 @@ static AquaSalFrame* getMouseContainerFrame()
 // Handle repeat key events by explicitly inserting the text if
 // -[NSResponder interpretKeyEvents:] does not insert or mark any
 // text. Note: do not do this step if there is uncommitted text.
-if ( !mpLastMarkedText && mpLastEvent && [mpLastEvent type] == 
NSEventTypeKeyDown && [mpLastEvent isARepeat] )
+// Related: tdf#42437 Skip special press-and-hold handling for 
action keys
+// Pressing and holding action keys such as arrow keys must not be
+// handled like pressing and holding a character key as it will
+// insert unexpected text.
+if ( !mbKeyHandled && !mpLastMarkedText && mpLastEvent && 
[mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent isARepeat] )
 {
 NSString *pChars = [mpLastEvent characters];
 [self insertText:pChars replacementRange:NSMakeRange( 0, 
[pChars length] )];
@@ -1177,9 +1181,13 @@ static AquaSalFrame* getMouseContainerFrame()
 mpFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
 
 }
-mbKeyHandled = true;
 [self unmarkText];
 }
+
+// Mark event as handled even if the frame isn't valid like is done in
+// [self setMarkedText:selectedRange:replacementRange:] and
+// [self doCommandBySelector:]
+mbKeyHandled = true;
 }
 
 -(void)insertTab: (id)aSender


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

2023-01-17 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/data/conditional-text.fodt |2 +-
 sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx   |2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx|4 +++-
 3 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 29f23c0e71437303982a094040373b509afc7010
Author: Justin Luth 
AuthorDate: Tue Jan 17 15:05:25 2023 -0500
Commit: Justin Luth 
CommitDate: Wed Jan 18 03:32:40 2023 +

tdf#114537 docx export: export conditional text with " as '

I couldn't find any way  in MS Word to escape a double-quote
that is inside of a conditonal text result.
So just "emulate" that with a single-quote,
which is a common substitute at least in the English world.

Hmm, Google says that { QUOTE 34 } would do the trick,
but it didn't work for me in Word 2010.

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

diff --git a/sw/qa/extras/ooxmlexport/data/conditional-text.fodt 
b/sw/qa/extras/ooxmlexport/data/conditional-text.fodt
index 244fdf84b6e1..2486d0f6aa89 100644
--- a/sw/qa/extras/ooxmlexport/data/conditional-text.fodt
+++ b/sw/qa/extras/ooxmlexport/data/conditional-text.fodt
@@ -2,7 +2,7 @@
 http://openoffice.org/2004/writer"; 
office:mimetype="application/vnd.oasis.opendocument.text">
  
   
-   True
+   True
   
  
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 96ba5e5a83e1..87d0878b6c0c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -809,7 +809,7 @@ CPPUNIT_TEST_FIXTURE(Test, testConditionalText)
 loadAndReload("conditional-text.fodt");
 // Load a document which has a conditional text field in it.
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
-std::u16string_view aExpected(u" IF 1 < 2 \"True\" \"False\"");
+std::u16string_view aExpected(u" IF 1 < 2 \"True\" \"- 'False' -\"");
 
 // Without the accompanying fix in place, this test would have failed with:
 // - Expression: xmlXPathNodeSetGetLength(pXmlNodes) > 0
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index b8a7dee024ec..fd4794593f1f 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -8752,7 +8752,9 @@ void DocxAttributeOutput::HiddenField(const SwField& 
rField)
 if (aFalse.getLength() > 1 && aFalse.startsWith("\"") && 
aFalse.endsWith("\""))
 aFalse = aFalse.copy(1, aFalse.getLength() - 2);
 
-OUString aCmd = FieldString(ww::eIF) + aCond + " \"" + aTrue + "\" \"" 
+ aFalse + "\"";
+// Substitute a single quote for an illegal double quote if one exists
+OUString aCmd = FieldString(ww::eIF) + aCond + " \"" + 
aTrue.replaceAll("\"", "'")
++ "\" \"" + aFalse.replaceAll("\"", "'") + "\"";
 m_rExport.OutputField(&rField, ww::eIF, aCmd);
 return;
 }


New Defects reported by Coverity Scan for LibreOffice

2023-01-17 Thread scan-admin
Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found 
with Coverity Scan.

1 new defect(s) introduced to LibreOffice found with Coverity Scan.
6 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent 
build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)


** CID 1519129:(NEGATIVE_RETURNS)



*** CID 1519129:(NEGATIVE_RETURNS)
/xmloff/source/transform/EventOASISTContext.cxx: 275 in 
XMLEventOASISTransformerContext::StartElement(const 
com::sun::star::uno::Reference &)()
269 
270 sal_Int16 idx = pMutableAttrList->GetIndexByName(
271 GetTransformer().GetNamespaceMap().GetQNameByKey(
272 XML_NAMESPACE_SCRIPT,
273 GetXMLToken( XML_LANGUAGE ) ) );
274 
>>> CID 1519129:(NEGATIVE_RETURNS)
>>> "idx" is passed to a parameter that cannot be negative.
275 pMutableAttrList->SetValueByIndex( idx,
276 "StarBasic" );
277 
278 OUString aLocQName(
279 GetTransformer().GetNamespaceMap().GetQNameByKey(
280 XML_NAMESPACE_SCRIPT,
/xmloff/source/transform/EventOASISTContext.cxx: 223 in 
XMLEventOASISTransformerContext::StartElement(const 
com::sun::star::uno::Reference &)()
217 
218 sal_Int16 idx = 
pMutableAttrList->GetIndexByName(
219 
GetTransformer().GetNamespaceMap().GetQNameByKey(
220 XML_NAMESPACE_SCRIPT,
221 GetXMLToken( XML_LANGUAGE ) ) );
222 
>>> CID 1519129:(NEGATIVE_RETURNS)
>>> "idx" is passed to a parameter that cannot be negative.
223 pMutableAttrList->SetValueByIndex( idx,
224 "StarBasic" );
225 
226 OUString aLocQName(
227 
GetTransformer().GetNamespaceMap().GetQNameByKey(
228 XML_NAMESPACE_SCRIPT,



To view the defects in Coverity Scan visit, 
https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DLI7b_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJiLJzrNcBbFlWIFl92TP4shgwEzj7y7oCs-2Bmw6YlgitkKC7ruPq4qx5F75vaSqGxXnd4Mx0NwIeMn-2B4r-2FrTE6ESlduWhXfsVFmx-2FCAspOhxPdP4wTFEakf6JGvkHNVSfHR2eD842oQJYhc59rnid75MaE51tzjOrs2Rg518zt5YDA-3D



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

2023-01-17 Thread Noel Grandin (via logerrit)
 forms/source/xforms/model.cxx|2 +-
 forms/source/xforms/model_helper.hxx |6 +++---
 forms/source/xforms/submission.cxx   |7 ---
 forms/source/xforms/submission.hxx   |3 ---
 4 files changed, 4 insertions(+), 14 deletions(-)

New commits:
commit 7195e2740eb1c71f5bbc4322b3535d56b39e2817
Author: Noel Grandin 
AuthorDate: Tue Jan 17 23:04:42 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 18 05:01:26 2023 +

cleanup commit for Submission

The following commit missed some stuff:
commit fc41f4d58c7c0e60025c1b43127ef1b3c87fa1ac
Author: Noel Grandin 
Date:   Sat Jan 14 12:41:58 2023 +0200
XUnoTunnel->dynamic_cast in Submission

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

diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx
index e347c9219ac6..0bab14a61cc8 100644
--- a/forms/source/xforms/model.cxx
+++ b/forms/source/xforms/model.cxx
@@ -427,7 +427,7 @@ void SAL_CALL Model::submitWithInteraction(
 if( mxSubmissions->hasItem( sID ) )
 {
 Submission* pSubmission =
-comphelper::getFromUnoTunnel( mxSubmissions->getItem( 
sID ) );
+dynamic_cast( mxSubmissions->getItem( sID ).get() );
 OSL_ENSURE( pSubmission != nullptr, "no submission?" );
 OSL_ENSURE( pSubmission->getModelImpl() == this,
 "wrong model" );
diff --git a/forms/source/xforms/model_helper.hxx 
b/forms/source/xforms/model_helper.hxx
index fbb563a1300b..0ec03591bc0a 100644
--- a/forms/source/xforms/model_helper.hxx
+++ b/forms/source/xforms/model_helper.hxx
@@ -84,20 +84,20 @@ public:
 
 virtual bool isValid( const T& t ) const override
 {
-return comphelper::getFromUnoTunnel( t ) != nullptr;
+return dynamic_cast( t.get() ) != nullptr;
 }
 
 protected:
 virtual void _insert( const T& t ) override
 {
-auto pSubmission = comphelper::getFromUnoTunnel( t );
+auto pSubmission = dynamic_cast( t.get() );
 OSL_ENSURE( pSubmission != nullptr, "invalid item?" );
 pSubmission->setModel( mpModel );
 }
 
 virtual void _remove( const T& t ) override
 {
-auto pSubmission = comphelper::getFromUnoTunnel( t );
+auto pSubmission = dynamic_cast( t.get() );
 OSL_ENSURE( pSubmission != nullptr, "invalid item?" );
 pSubmission->setModel( nullptr );
 }
diff --git a/forms/source/xforms/submission.cxx 
b/forms/source/xforms/submission.cxx
index fde73057b4e4..9cb97988d97e 100644
--- a/forms/source/xforms/submission.cxx
+++ b/forms/source/xforms/submission.cxx
@@ -254,13 +254,6 @@ bool Submission::doSubmit( const Reference< 
XInteractionHandler >& xHandler )
 return ( aResult == CSubmission::SUCCESS );
 }
 
-Sequence Submission::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit aImplementationId;
-return aImplementationId.getSeq();
-}
-
-
 void Submission::liveCheck()
 {
 bool bValid = mxModel.is();
diff --git a/forms/source/xforms/submission.hxx 
b/forms/source/xforms/submission.hxx
index 8dbfb2b3f1aa..b8f7fb11d87e 100644
--- a/forms/source/xforms/submission.hxx
+++ b/forms/source/xforms/submission.hxx
@@ -152,9 +152,6 @@ public:
  * @returns if submission was successful */
 bool doSubmit( const css::uno::Reference< css::task::XInteractionHandler 
>& aHandler );
 
-// helpers for UNO tunnel
-static css::uno::Sequence getUnoTunnelId();
-
 private:
 
 /// check whether object is live, and throw suitable exception if not


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

2023-01-17 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/rtfexport/rtfexport2.cxx |   37 +++---
 1 file changed, 21 insertions(+), 16 deletions(-)

New commits:
commit 02f286271d4b44d995f8f2f8f30fbc10ed764b49
Author: Miklos Vajna 
AuthorDate: Tue Jan 17 20:46:52 2023 +0100
Commit: Miklos Vajna 
CommitDate: Wed Jan 18 07:11:22 2023 +

CppunitTest_sw_rtfexport2: make testFdo48023() more self-contained

Avoid magic in preTest() based on the bugdoc name.

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

diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx 
b/sw/qa/extras/rtfexport/rtfexport2.cxx
index e840a0d2ad4f..b2a8bca644db 100644
--- a/sw/qa/extras/rtfexport/rtfexport2.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport2.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -44,16 +45,7 @@ public:
 virtual std::unique_ptr preTest(const char* filename) override
 {
 m_aSavedSettings = Application::GetSettings();
-if (filename == std::string_view("fdo48023.rtf"))
-{
-std::unique_ptr pResetter(
-new Resetter([this]() { 
Application::SetSettings(this->m_aSavedSettings); }));
-AllSettings aSettings(m_aSavedSettings);
-aSettings.SetLanguageTag(LanguageTag("ru"));
-Application::SetSettings(aSettings);
-return pResetter;
-}
-else if (filename == std::string_view("fdo44211.rtf"))
+if (filename == std::string_view("fdo44211.rtf"))
 {
 std::unique_ptr pResetter(
 new Resetter([this]() { 
Application::SetSettings(this->m_aSavedSettings); }));
@@ -314,14 +306,27 @@ DECLARE_RTFEXPORT_TEST(testFdo48356, "fdo48356.rtf")
 CPPUNIT_ASSERT_EQUAL(1, i);
 }
 
-DECLARE_RTFEXPORT_TEST(testFdo48023, "fdo48023.rtf")
+CPPUNIT_TEST_FIXTURE(Test, testFdo48023)
 {
-uno::Reference xTextRange = getRun(getParagraph(1), 1);
+auto verify = [this]() {
+uno::Reference xTextRange = getRun(getParagraph(1), 
1);
 
-// Implicit encoding detection based on locale was missing
-CPPUNIT_ASSERT_EQUAL(
-
OUString(u"\u041F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0438\u0441\u0442"),
-xTextRange->getString());
+// Implicit encoding detection based on locale was missing
+CPPUNIT_ASSERT_EQUAL(
+
OUString(u"\u041F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0438\u0441\u0442"),
+xTextRange->getString());
+};
+
+AllSettings aSavedSettings = Application::GetSettings();
+AllSettings aSettings(aSavedSettings);
+aSettings.SetLanguageTag(LanguageTag("ru"));
+Application::SetSettings(aSettings);
+comphelper::ScopeGuard g([&aSavedSettings] { 
Application::SetSettings(aSavedSettings); });
+
+createSwDoc("fdo48023.rtf");
+verify();
+reload(mpFilter, "fdo48023.rtf");
+verify();
 }
 
 DECLARE_RTFEXPORT_TEST(testFdo48876, "fdo48876.rtf")


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

2023-01-17 Thread Stephan Bergmann (via logerrit)
 drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx  |2 +-
 include/drawinglayer/processor2d/SDPRProcessor2dTools.hxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit b63afb3c74d4285a7d46917354eafc0087a73f8f
Author: Stephan Bergmann 
AuthorDate: Wed Jan 18 07:54:00 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Jan 18 07:45:51 2023 +

Fix typo

...which happened to go largely unnoticed (the would-be additional 
overload, as
seen when including drawinglayer/processor2d/SDPRProcessor2dTools.hxx first
thing in drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx, was just
never defined nor used), but caused

> drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx(140,6): error: 
externally available entity 'prepareBitmapForDirectRender' is not previously 
declared in an included file (if it is only used in this translation unit, make 
it static; otherwise, provide a declaration of it in an included file) 
[loplugin:external]
> bool prepareBitmapForDirectRender(
> ~^

with clang-cl

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

diff --git a/drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx 
b/drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx
index 01abd9ff9af1..981e52dc55c4 100644
--- a/drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx
+++ b/drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx
@@ -139,7 +139,7 @@ void takeCareOfOffsetXY(
 
 bool prepareBitmapForDirectRender(
 const drawinglayer::primitive2d::FillGraphicPrimitive2D& 
rFillGraphicPrimitive2D,
-const geometry::ViewInformation2D& rViewInformation2D, BitmapEx& rTarget,
+const drawinglayer::geometry::ViewInformation2D& rViewInformation2D, 
BitmapEx& rTarget,
 basegfx::B2DRange& rFillUnitRange, double fBigDiscreteArea)
 {
 const attribute::FillGraphicAttribute& rFillGraphicAttribute(
diff --git a/include/drawinglayer/processor2d/SDPRProcessor2dTools.hxx 
b/include/drawinglayer/processor2d/SDPRProcessor2dTools.hxx
index 4b8b6c6c4347..e7bdbceffcd2 100644
--- a/include/drawinglayer/processor2d/SDPRProcessor2dTools.hxx
+++ b/include/drawinglayer/processor2d/SDPRProcessor2dTools.hxx
@@ -26,7 +26,7 @@ namespace drawinglayer::primitive2d
 class FillGraphicPrimitive2D;
 }
 
-namespace geometry
+namespace drawinglayer::geometry
 {
 class ViewInformation2D;
 }
@@ -82,7 +82,7 @@ namespace drawinglayer::processor2d
 */
 bool prepareBitmapForDirectRender(
 const drawinglayer::primitive2d::FillGraphicPrimitive2D& 
rFillGraphicPrimitive2D,
-const geometry::ViewInformation2D& rViewInformation2D, BitmapEx& rTarget,
+const drawinglayer::geometry::ViewInformation2D& rViewInformation2D, 
BitmapEx& rTarget,
 basegfx::B2DRange& rFillUnitRange, double fBigDiscreteArea = 300.0 * 
300.0);
 
 /** helper to react/process if OffsetX/OffsetY of the FillGraphicAttribute is 
used.