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

2023-02-03 Thread Miklos Vajna (via logerrit)
 sw/source/core/inc/flyfrm.hxx|2 +-
 sw/source/core/inc/flyfrms.hxx   |4 ++--
 sw/source/core/layout/fly.cxx|7 +--
 sw/source/core/layout/flycnt.cxx |6 +++---
 sw/source/core/layout/flylay.cxx |4 ++--
 5 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 8855813f8147f430348a32703b89dfb7b0793fee
Author: Miklos Vajna 
AuthorDate: Fri Feb 3 08:17:57 2023 +0100
Commit: Miklos Vajna 
CommitDate: Fri Feb 3 08:12:41 2023 +

sw: avoid unwanted initial content in split/follow fly frames

If the fly on the first gets split, SwFrame::GetNextFlyLeaf() will
create a follow fly frame. Don't fill this one with content, we'll
instead want to move some of the content of the master here. (Which is
not yet working.)

InsertCnt() is called *really* early, so we can't check if this frame
has a master -- just pass a bool around instead.

This fixes the unwanted first paragraph in the follow fly frame at
least. (The one that fits the master already.)

Towards an initial layout for multi-page fly frames.

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

diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 1931054b0ce0..cc6d969401bf 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -147,7 +147,7 @@ protected:
 
 Size CalcRel( const SwFormatFrameSize &rSz ) const;
 
-SwFlyFrame( SwFlyFrameFormat*, SwFrame*, SwFrame *pAnchor );
+SwFlyFrame( SwFlyFrameFormat*, SwFrame*, SwFrame *pAnchor, bool bFollow = 
false );
 
 virtual void DestroyImpl() override;
 virtual ~SwFlyFrame() override;
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index 01ac3872dcd6..61a40d8a8f8c 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -71,7 +71,7 @@ protected:
 friend class SwFlyNotify;
 virtual void NotifyBackground( SwPageFrame *pPage,
const SwRect& rRect, PrepareHint eHint) 
override;
-SwFlyFreeFrame( SwFlyFrameFormat*, SwFrame*, SwFrame *pAnchor );
+SwFlyFreeFrame( SwFlyFrameFormat*, SwFrame*, SwFrame *pAnchor, bool 
bFollow = false );
 
 virtual void DestroyImpl() override;
 virtual ~SwFlyFreeFrame() override;
@@ -177,7 +177,7 @@ class SwFlyAtContentFrame final: public SwFlyFreeFrame, 
public SwFlowFrame
 public:
 // #i28701#
 
-SwFlyAtContentFrame( SwFlyFrameFormat*, SwFrame*, SwFrame *pAnchor );
+SwFlyAtContentFrame( SwFlyFrameFormat*, SwFrame*, SwFrame *pAnchor, bool 
bFollow = false );
 SwFlyAtContentFrame(SwFlyAtContentFrame& rPrecede);
 
 void SetAbsPos( const Point &rNew );
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 91188af711c9..e256a0b9e0ac 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -81,7 +81,7 @@ using namespace ::com::sun::star;
 
 static SwTwips lcl_CalcAutoWidth( const SwLayoutFrame& rFrame );
 
-SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame 
*pAnch ) :
+SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame 
*pAnch, bool bFollow ) :
 SwLayoutFrame( pFormat, pSib ),
  // #i26791#
 m_pPrevLink( nullptr ),
@@ -171,7 +171,10 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, 
SwFrame* pSib, SwFrame *pAnch
 
 Chain( pAnch );
 
-InsertCnt();
+if (!bFollow)
+{
+InsertCnt();
+}
 
 // Put it somewhere outside so that out document is not formatted 
unnecessarily often
 SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index c2fd6bc28666..427ac5b9c37b 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -74,8 +74,8 @@ SwTwips lcl_GetTopForObjPos(const SwContentFrame* pCnt, const 
bool bVert, const
 
 }
 
-SwFlyAtContentFrame::SwFlyAtContentFrame( SwFlyFrameFormat *pFormat, SwFrame* 
pSib, SwFrame *pAnch ) :
-SwFlyFreeFrame( pFormat, pSib, pAnch ),
+SwFlyAtContentFrame::SwFlyAtContentFrame( SwFlyFrameFormat *pFormat, SwFrame* 
pSib, SwFrame *pAnch, bool bFollow ) :
+SwFlyFreeFrame( pFormat, pSib, pAnch, bFollow ),
 SwFlowFrame(static_cast(*this))
 {
 m_bAtCnt = true;
@@ -84,7 +84,7 @@ SwFlyAtContentFrame::SwFlyAtContentFrame( SwFlyFrameFormat 
*pFormat, SwFrame* pS
 
 SwFlyAtContentFrame::SwFlyAtContentFrame(SwFlyAtContentFrame& rPrecede)
 : SwFlyAtContentFrame(rPrecede.GetFormat(), 
const_cast(rPrecede.GetAnchorFrame()),
-  const_cast(rPrecede.GetAnchorFrame()))
+  const_cast(rPrecede.GetAnchorFrame()), 
/*bFollow=*/true)
 {
 SetFollow(rPrecede.GetFollow());
 rPrecede.SetFollow(this);
diff --git a/sw/source/core/layou

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

2023-02-03 Thread Andreas Heinisch (via logerrit)
 framework/source/uielement/recentfilesmenucontroller.cxx   |   53 -
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |7 +
 2 files changed, 57 insertions(+), 3 deletions(-)

New commits:
commit 6836776fa295293c114c267bca38d18603993a54
Author: Andreas Heinisch 
AuthorDate: Wed Feb 1 15:09:28 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Fri Feb 3 09:46:01 2023 +

tdf#56696 - Sort recent document list according to current LibO module

Change-Id: I246dc9538e011b8981bea04963995559d2b43cc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146456
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx 
b/framework/source/uielement/recentfilesmenucontroller.cxx
index fe7de1c3d907..ef95d300058b 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -20,6 +20,8 @@
 #include 
 #include 
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -34,6 +36,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace css;
 using namespace com::sun::star::uno;
 using namespace com::sun::star::lang;
@@ -42,6 +46,7 @@ using namespace com::sun::star::beans;
 using namespace com::sun::star::util;
 
 #define MAX_MENU_ITEMS  99
+#define MAX_MENU_ITEMS_PER_MODULE  5
 
 namespace {
 
@@ -154,12 +159,50 @@ void RecentFilesMenuController::fillPopupMenu( Reference< 
css::awt::XPopupMenu >
 int nPickListMenuItems = std::min( aHistoryList.size(), 
MAX_MENU_ITEMS );
 m_aRecentFilesItems.clear();
 
+// tdf#56696 - retrieve expert configuration option if the recent document
+// list should show only files that can be handled by the current module
+const bool bShowCurrentModuleOnly
+= officecfg::Office::Common::History::ShowCurrentModuleOnly::get();
+
+size_t nItemPosModule = 0;
 if (( nPickListMenuItems > 0 ) && !m_bDisabled )
 {
-for ( int i = 0; i < nPickListMenuItems; i++ )
+size_t nItemPos = 0;
+if (m_aModuleName != "com.sun.star.frame.StartModule")
+{
+::comphelper::MimeConfigurationHelper aConfigHelper(
+comphelper::getProcessComponentContext());
+// Show the first MAX_MENU_ITEMS_PER_MODULE items of the current 
module
+// on top of the recent document list.
+for (int i = 0; i < nPickListMenuItems; i++)
+{
+const SvtHistoryOptions::HistoryItem& rPickListEntry = 
aHistoryList[i];
+const std::pair 
aPickListEntry(rPickListEntry.sURL,
+   
rPickListEntry.isReadOnly);
+if ((nItemPosModule < MAX_MENU_ITEMS_PER_MODULE || 
bShowCurrentModuleOnly)
+&& 
aConfigHelper.GetDocServiceNameFromFilter(rPickListEntry.sFilter)
+   == m_aModuleName)
+{
+m_aRecentFilesItems.insert(m_aRecentFilesItems.begin() + 
nItemPosModule,
+   aPickListEntry);
+nItemPos++;
+nItemPosModule++;
+}
+else if (!bShowCurrentModuleOnly)
+{
+m_aRecentFilesItems.insert(m_aRecentFilesItems.begin() + 
nItemPos,
+   aPickListEntry);
+nItemPos++;
+}
+}
+}
+else
 {
-const SvtHistoryOptions::HistoryItem& rPickListEntry = 
aHistoryList[i];
-m_aRecentFilesItems.emplace_back(rPickListEntry.sURL, 
rPickListEntry.isReadOnly);
+for (int i = 0; i < nPickListMenuItems; i++)
+{
+const SvtHistoryOptions::HistoryItem& rPickListEntry = 
aHistoryList[i];
+m_aRecentFilesItems.emplace_back(rPickListEntry.sURL, 
rPickListEntry.isReadOnly);
+}
 }
 }
 
@@ -220,6 +263,10 @@ void RecentFilesMenuController::fillPopupMenu( Reference< 
css::awt::XPopupMenu >
 
 rPopupMenu->setTipHelpText(sal_uInt16(i + 1), aTipHelpText);
 rPopupMenu->setCommand(sal_uInt16(i + 1), aURLString);
+
+// Show a separator after the MAX_MENU_ITEMS_PER_MODULE recent 
document items
+if (nItemPosModule > 0 && i == nItemPosModule - 1)
+rPopupMenu->insertSeparator(-1);
 }
 
 rPopupMenu->insertSeparator(-1);
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index f333657151f5..ced635fa4200 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2233,6 +2233,13 @@
 
 true
   
+  
+
+  The entry specifies if the recent document list should sho

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

2023-02-03 Thread Xisco Fauli (via logerrit)
 vcl/source/control/PriorityMergedHBox.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 1f8d118dd0ea63a73592a712efb364c343c71082
Author: Xisco Fauli 
AuthorDate: Thu Feb 2 16:35:28 2023 +0100
Commit: Xisco Fauli 
CommitDate: Fri Feb 3 09:48:45 2023 +

tdf#153078: Revert "tdf#141684 fix disappearance of icons in Groupedbar and 
Groupedbar compact UI"

This reverts commit 801e6272dc299d4468ec094ce11b66494eb5018b.

Revert it for now, until a better solution for tdf#141684
is found

Change-Id: I6c9fd7fb12149b67fe572d64cf00e6a3ec98611f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146504
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit bcf9e47791d5b3e1d6a75c73f3b8c9940abda8eb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146518
Reviewed-by: Xisco Fauli 

diff --git a/vcl/source/control/PriorityMergedHBox.cxx 
b/vcl/source/control/PriorityMergedHBox.cxx
index c5e21c7c002c..75a26daa52c1 100644
--- a/vcl/source/control/PriorityMergedHBox.cxx
+++ b/vcl/source/control/PriorityMergedHBox.cxx
@@ -27,7 +27,6 @@
 
 #define DUMMY_WIDTH 50
 #define BUTTON_WIDTH 30
-#define TEMP_WIDTH 200
 
 /*
 * PriorityMergedHBox is a VclHBox which hides its own children if there is no 
sufficient space.
@@ -58,9 +57,6 @@ void PriorityMergedHBox::Resize()
 }
 
 tools::Long nWidth = GetSizePixel().Width();
-if (nWidth <= 1 || nWidth == TEMP_WIDTH || nWidth == TEMP_WIDTH + 6)
-return VclHBox::Resize();
-
 tools::Long nCurrentWidth = VclHBox::calculateRequisition().getWidth() + 
BUTTON_WIDTH;
 
 // Hide lower priority controls
@@ -159,7 +155,7 @@ Size PriorityMergedHBox::calculateRequisition() const
 accumulateMaxes(aChildSize, aSize);
 }
 
-setPrimaryDimension(aSize, TEMP_WIDTH);
+setPrimaryDimension(aSize, 200);
 return finalizeMaxes(aSize, nVisibleChildren);
 }
 


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

2023-02-03 Thread Regina Henschel (via logerrit)
 oox/qa/unit/data/tdf153258_VML_import_WordArt_detection.docx |binary
 oox/qa/unit/vml.cxx  |   18 +++
 oox/source/vml/vmlshape.cxx  |7 ++--
 3 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 39eb3d9ab448722851d8ffca1061d3cefcb32d0e
Author: Regina Henschel 
AuthorDate: Thu Feb 2 15:22:52 2023 +0100
Commit: Xisco Fauli 
CommitDate: Fri Feb 3 10:02:38 2023 +

tdf#153258 VML import improve WordArt detection

There exists WordArt types whose internal name do not start with
'fontwork', e.g. mso_sptTextDeflateInflateDeflate has 'mso-spt167'.
The fix uses the MSO_SPT enum directly.

Change-Id: Idb32b3ef9957bef5d948e1d86507d71fef006e91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146503
Tested-by: Jenkins
Reviewed-by: Regina Henschel 
(cherry picked from commit 2598f40521c6a8dee6d59ca41c3e58e65a98b17f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146517
Reviewed-by: Xisco Fauli 

diff --git a/oox/qa/unit/data/tdf153258_VML_import_WordArt_detection.docx 
b/oox/qa/unit/data/tdf153258_VML_import_WordArt_detection.docx
new file mode 100644
index ..15944490e9ed
Binary files /dev/null and 
b/oox/qa/unit/data/tdf153258_VML_import_WordArt_detection.docx differ
diff --git a/oox/qa/unit/vml.cxx b/oox/qa/unit/vml.cxx
index be99a281af04..c46475efe418 100644
--- a/oox/qa/unit/vml.cxx
+++ b/oox/qa/unit/vml.cxx
@@ -224,6 +224,24 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, 
testWriterFontworkTrimTrue)
 CPPUNIT_ASSERT_DOUBLES_EQUAL(4999, aSize.Height, 2);
 }
 
+CPPUNIT_TEST_FIXTURE(OoxVmlTest, testVMLDetectWordArtOnImport)
+{
+// The document contains a WordArt shape with type other than 
"fontwork-foo". Error was that
+// WordArt was not detected and thus shrinking shape to text content was 
not prevented.
+loadFromURL(u"tdf153258_VML_import_WordArt_detection.docx");
+
+uno::Reference xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xShape(xDrawPageSupplier->getDrawPage()->getByIndex(0),
+   uno::UNO_QUERY);
+
+// Make sure the shape width and height is not changed.
+awt::Size aSize = xShape->getSize();
+// Without the fix the test would have failed with expected 7514 actual 
1453.
+CPPUNIT_ASSERT_DOUBLES_EQUAL(7514, aSize.Width, 2);
+// Without the fix the test would have failed with expected 4540 actual 
309.
+CPPUNIT_ASSERT_DOUBLES_EQUAL(4540, aSize.Height, 2);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index abbf4fd7f9d6..bdbea0c86fc4 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -63,7 +63,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -716,10 +716,11 @@ Reference< XShape > SimpleShape::implConvertAndInsert( 
const Reference< XShapes
 SdrObject* pShape = SdrObject::getSdrObjectFromXShape(xShape);
 if( pShape && getShapeType() >= 0 )
 {
-OUString aShapeType = EnhancedCustomShapeTypeNames::Get( static_cast< 
MSO_SPT >(getShapeType()) );
 //The resize autoshape to fit text attr of FontWork/Word-Art should 
always be false
 //for the fallback geometry.
-if(aShapeType.startsWith("fontwork"))
+sal_Int32 nType = getShapeType();
+if((mso_sptTextSimple <= nType && nType <= mso_sptTextOnRing)
+|| (mso_sptTextPlainText <= nType && nType <= mso_sptTextCanDown))
 {
 pShape->SetMergedItem(makeSdrTextAutoGrowHeightItem(false));
 pShape->SetMergedItem(makeSdrTextAutoGrowWidthItem(false));


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

2023-02-03 Thread Xisco Fauli (via logerrit)
 sw/qa/uitest/writer_tests6/edit_file_properties_before_saving.py |   40 
+-
 1 file changed, 21 insertions(+), 19 deletions(-)

New commits:
commit 5fa860f26c0b02e68a7840f1a74471b6ec98
Author: Xisco Fauli 
AuthorDate: Wed Feb 1 14:24:04 2023 +0100
Commit: Michael Stahl 
CommitDate: Fri Feb 3 10:07:20 2023 +

sw: restructure tests a bit

Follow-up to 3ac5bfec2f73c55e99c4410f7559db86b875a269
"uitest: Always change doc info setting back to false"
it seems it fails sometimes when using .uno:CloseDoc
Seen in 
https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/132728/consoleFull#-45932801048ce9c26-9d0a-43a8-83d8-c44f54920d59

Change-Id: I384e40a31735738c622277ccdbdb75babb185d85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146448
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146457
Tested-by: Jenkins
(cherry picked from commit 06fc2f919bfa22d976aadbb89b05fedf8fa3da7a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146412
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/uitest/writer_tests6/edit_file_properties_before_saving.py 
b/sw/qa/uitest/writer_tests6/edit_file_properties_before_saving.py
index 0df0dc504dde..d8d30d0aff74 100644
--- a/sw/qa/uitest/writer_tests6/edit_file_properties_before_saving.py
+++ b/sw/qa/uitest/writer_tests6/edit_file_properties_before_saving.py
@@ -35,10 +35,10 @@ class edit_file_properties_before_saving(UITestCase):
 with TemporaryDirectory() as tempdir:
 xFilePath = os.path.join(tempdir, "tdf117895-temp.odt")
 
-with self.ui_test.create_doc_in_start_center("writer"):
+try:
+self.change_doc_info_setting("true")
 
-try:
-self.change_doc_info_setting("true")
+with self.ui_test.create_doc_in_start_center("writer"):
 
 # Save Copy as
 with 
self.ui_test.execute_dialog_through_command('.uno:SaveAs', close_button="") as 
xDialog:
@@ -52,25 +52,26 @@ class edit_file_properties_before_saving(UITestCase):
 xReadOnly = xPropertiesDialog.getChild("readonly")
 xReadOnly.executeAction("CLICK", tuple())
 self.assertEqual("true", 
get_state_as_dict(xReadOnly)['Selected'])
-finally:
-# Put this setting back to false, otherwise it might 
affect other tests
-self.change_doc_info_setting("false")
 
-self.ui_test.wait_until_file_is_available(xFilePath)
+self.ui_test.wait_until_file_is_available(xFilePath)
 
-with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as 
doc2:
-# Without the fix in place, this test would have failed here
-self.assertTrue(doc2.isReadonly())
+with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as 
doc2:
+# Without the fix in place, this test would have failed 
here
+self.assertTrue(doc2.isReadonly())
+
+finally:
+# Put this setting back to false, otherwise it might affect 
other tests
+self.change_doc_info_setting("false")
 
 def test_tdf119206(self):
 
 with TemporaryDirectory() as tempdir:
 xFilePath = os.path.join(tempdir, "tdf119206-temp.odt")
 
-with self.ui_test.create_doc_in_start_center("writer"):
+try:
+self.change_doc_info_setting("true")
 
-try:
-self.change_doc_info_setting("true")
+with self.ui_test.create_doc_in_start_center("writer"):
 
 xWriterDoc = self.xUITest.getTopFocusWindow()
 xWriterEdit = xWriterDoc.getChild("writer_edit")
@@ -92,13 +93,14 @@ class edit_file_properties_before_saving(UITestCase):
 xReadOnly = 
xPropertiesDialog.getChild("readonly")
 xReadOnly.executeAction("CLICK", tuple())
 self.assertEqual("true", 
get_state_as_dict(xReadOnly)['Selected'])
-finally:
-# Put this setting back to false, otherwise it might 
affect other tests
-self.change_doc_info_setting("false")
 
-self.ui_test.wait_until_file_is_available(xFilePath)
+self.ui_test.wait_until_file_is_available(xFilePath)
+
+with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as 
doc2:
+self.assertTrue(doc2.isReadonly())
 
-with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as 
doc2:
-self.assertTrue(doc2.isReadonly())
+finally:
+# Put this setting back to false, otherwise it might affect 
ot

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

2023-02-03 Thread László Németh (via logerrit)
 ucb/source/ucp/webdav-curl/CurlSession.cxx  |   24 
 ucb/source/ucp/webdav-curl/DAVException.hxx |1 +
 2 files changed, 25 insertions(+)

New commits:
commit 0d0f4411934dead0765930693072fe9582f50be9
Author: László Németh 
AuthorDate: Wed Jan 25 12:08:14 2023 +0100
Commit: Michael Stahl 
CommitDate: Fri Feb 3 10:11:42 2023 +

tdf#152493 ucb WebDAV: fix upload using HTTP 1.0 fallback

Fix broken libcurl upload to Vibe 4.0.6 WebDAV server
using HTTP 1.0 fallback.

Regression from commit 023ebf17898db4bca63129f079fd90b5cf76c1a9
"ucb: remove --with-webdav=neon" (Neon had no such upload
problem).

HTTP 1.0 fallback found by Pál Zoltán Kochis.
Fallback for CURLE_UNSUPPORTED_PROTOCOL
suggested by Michael Stahl. Thanks for their and
Attila Bakos' help.

Michael Stahl's comment: "'HTTP/0.9' in the [curl] error
message is very misleading: it simply means that a header
was expected but there was no header, so what is received
is interpreted as body.

Note: the HTTP/1.0 works because it does not use the
'Expect: 100-continue' so there should be no intermediate
100 Continue response from the server at all - instead
libcurl directly sends the XML document for the PROPFIND
and the server sends the response, and the problem does
not occur."

Co-authored-by: Michael Stahl 

Change-Id: I8bd79154de14b6425e0324f4d8f6e64512c08264
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146067
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 30ca48f4dc0e65a3798e6b21574bc80f6d4953fa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146315
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 8e64608bfc8b..86eb265f55c6 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -955,6 +955,8 @@ auto CurlProcessor::ProcessRequestImpl(
  "curl_easy_perform failed: " << GetErrorString(rc, 
rSession.m_ErrorBuffer));
 switch (rc)
 {
+case CURLE_UNSUPPORTED_PROTOCOL:
+throw DAVException(DAVException::DAV_UNSUPPORTED);
 case CURLE_COULDNT_RESOLVE_PROXY:
 throw DAVException(
 DAVException::DAV_HTTP_LOOKUP,
@@ -1241,6 +1243,7 @@ auto CurlProcessor::ProcessRequest(
 }
 }
 bool isRetry(false);
+bool isFallbackHTTP10(false);
 int nAuthRequests(0);
 int nAuthRequestsProxy(0);
 
@@ -1464,6 +1467,27 @@ auto CurlProcessor::ProcessRequest(
 }
 }
 }
+else if (rException.getError() == DAVException::DAV_UNSUPPORTED)
+{
+// tdf#152493 libcurl can't handle "Transfer-Encoding: chunked"
+// in HTTP/1.1 100 Continue response.
+// workaround: if HTTP/1.1 didn't work, try HTTP/1.0
+// (but fallback only once - to prevent infinite loop)
+if (isFallbackHTTP10)
+{
+throw DAVException(DAVException::DAV_HTTP_ERROR);
+}
+isFallbackHTTP10 = true;
+// note: this is not reset - future requests to this URI use 
it!
+auto rc = curl_easy_setopt(rSession.m_pCurl.get(), 
CURLOPT_HTTP_VERSION,
+   CURL_HTTP_VERSION_1_0);
+if (rc != CURLE_OK)
+{
+throw DAVException(DAVException::DAV_HTTP_ERROR);
+}
+SAL_INFO("ucb.ucp.webdav.curl", "attempting fallback to 
HTTP/1.0");
+isRetry = true;
+}
 if (!isRetry)
 {
 throw; // everything else: re-throw
diff --git a/ucb/source/ucp/webdav-curl/DAVException.hxx 
b/ucb/source/ucp/webdav-curl/DAVException.hxx
index 84dba895485c..759e43f25f8e 100644
--- a/ucb/source/ucp/webdav-curl/DAVException.hxx
+++ b/ucb/source/ucp/webdav-curl/DAVException.hxx
@@ -130,6 +130,7 @@ class DAVException : public std::exception
 DAV_SESSION_CREATE, // session creation error,
 // mData = server[:port]
 DAV_INVALID_ARG,// invalid argument
+DAV_UNSUPPORTED,// internal to CurlSession
 
 DAV_LOCK_EXPIRED,   // DAV lock expired
 


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

2023-02-03 Thread László Németh (via logerrit)
 ucb/source/ucp/webdav-curl/CurlSession.cxx  |   24 
 ucb/source/ucp/webdav-curl/DAVException.hxx |1 +
 2 files changed, 25 insertions(+)

New commits:
commit 7dc3d1b88f368d40552531c1fed67826fb9d
Author: László Németh 
AuthorDate: Wed Jan 25 12:08:14 2023 +0100
Commit: Michael Stahl 
CommitDate: Fri Feb 3 10:11:49 2023 +

tdf#152493 ucb WebDAV: fix upload using HTTP 1.0 fallback

Fix broken libcurl upload to Vibe 4.0.6 WebDAV server
using HTTP 1.0 fallback.

Regression from commit 023ebf17898db4bca63129f079fd90b5cf76c1a9
"ucb: remove --with-webdav=neon" (Neon had no such upload
problem).

HTTP 1.0 fallback found by Pál Zoltán Kochis.
Fallback for CURLE_UNSUPPORTED_PROTOCOL
suggested by Michael Stahl. Thanks for their and
Attila Bakos' help.

Michael Stahl's comment: "'HTTP/0.9' in the [curl] error
message is very misleading: it simply means that a header
was expected but there was no header, so what is received
is interpreted as body.

Note: the HTTP/1.0 works because it does not use the
'Expect: 100-continue' so there should be no intermediate
100 Continue response from the server at all - instead
libcurl directly sends the XML document for the PROPFIND
and the server sends the response, and the problem does
not occur."

Co-authored-by: Michael Stahl 

Change-Id: I8bd79154de14b6425e0324f4d8f6e64512c08264
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146067
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit 30ca48f4dc0e65a3798e6b21574bc80f6d4953fa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146316
Reviewed-by: Michael Stahl 

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 9b66ff0d0f9b..f05797b7628a 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -952,6 +952,8 @@ auto CurlProcessor::ProcessRequestImpl(
  "curl_easy_perform failed: " << GetErrorString(rc, 
rSession.m_ErrorBuffer));
 switch (rc)
 {
+case CURLE_UNSUPPORTED_PROTOCOL:
+throw DAVException(DAVException::DAV_UNSUPPORTED);
 case CURLE_COULDNT_RESOLVE_PROXY:
 throw DAVException(
 DAVException::DAV_HTTP_LOOKUP,
@@ -1239,6 +1241,7 @@ auto CurlProcessor::ProcessRequest(
 }
 }
 bool isRetry(false);
+bool isFallbackHTTP10(false);
 int nAuthRequests(0);
 int nAuthRequestsProxy(0);
 
@@ -1462,6 +1465,27 @@ auto CurlProcessor::ProcessRequest(
 }
 }
 }
+else if (rException.getError() == DAVException::DAV_UNSUPPORTED)
+{
+// tdf#152493 libcurl can't handle "Transfer-Encoding: chunked"
+// in HTTP/1.1 100 Continue response.
+// workaround: if HTTP/1.1 didn't work, try HTTP/1.0
+// (but fallback only once - to prevent infinite loop)
+if (isFallbackHTTP10)
+{
+throw DAVException(DAVException::DAV_HTTP_ERROR);
+}
+isFallbackHTTP10 = true;
+// note: this is not reset - future requests to this URI use 
it!
+auto rc = curl_easy_setopt(rSession.m_pCurl.get(), 
CURLOPT_HTTP_VERSION,
+   CURL_HTTP_VERSION_1_0);
+if (rc != CURLE_OK)
+{
+throw DAVException(DAVException::DAV_HTTP_ERROR);
+}
+SAL_INFO("ucb.ucp.webdav.curl", "attempting fallback to 
HTTP/1.0");
+isRetry = true;
+}
 if (!isRetry)
 {
 throw; // everything else: re-throw
diff --git a/ucb/source/ucp/webdav-curl/DAVException.hxx 
b/ucb/source/ucp/webdav-curl/DAVException.hxx
index 537b5a82fa2b..24f8349d3a31 100644
--- a/ucb/source/ucp/webdav-curl/DAVException.hxx
+++ b/ucb/source/ucp/webdav-curl/DAVException.hxx
@@ -129,6 +129,7 @@ class DAVException : public std::exception
 DAV_SESSION_CREATE, // session creation error,
 // mData = server[:port]
 DAV_INVALID_ARG,// invalid argument
+DAV_UNSUPPORTED,// internal to CurlSession
 
 DAV_LOCK_EXPIRED,   // DAV lock expired
 


[Libreoffice-commits] core.git: static/README.wasm.md

2023-02-03 Thread Andrea Gelmini (via logerrit)
 static/README.wasm.md |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d4b3b96359c3fcbe2307149edee799b34837
Author: Andrea Gelmini 
AuthorDate: Fri Feb 3 11:46:18 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Feb 3 10:53:31 2023 +

Fix typo

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

diff --git a/static/README.wasm.md b/static/README.wasm.md
index 042417051de3..ac00e83135de 100644
--- a/static/README.wasm.md
+++ b/static/README.wasm.md
@@ -3,7 +3,7 @@
 This module provides support for building LibreOffice as WASM, with the 
Emscripten toolchain.
 
 You can build LibreOffice core for WASM for two separate purposes:
-Either to produce a WASM binary of LibreOffice as suchn, using Qt5 as
+Either to produce a WASM binary of LibreOffice as such, using Qt5 as
 the GUI, or just compiling the LibreOffice code to WASM libraries
 without any UI for use in other software that has the UI, like
 Collabora Online.


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

2023-02-03 Thread Andrea Gelmini (via logerrit)
 vcl/unx/generic/printer/printerinfomanager.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1f29c8ae9943668f8890459301373a0f183ea264
Author: Andrea Gelmini 
AuthorDate: Fri Feb 3 11:46:24 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Feb 3 10:54:06 2023 +

Fix typo

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

diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx 
b/vcl/unx/generic/printer/printerinfomanager.cxx
index ef140ad429b7..a2d99ccf0e59 100644
--- a/vcl/unx/generic/printer/printerinfomanager.cxx
+++ b/vcl/unx/generic/printer/printerinfomanager.cxx
@@ -775,7 +775,7 @@ static void lpgetSysQueueTokenHandler(
 o_rQueues.back().m_aComment = OStringToOUString(aComment, 
aEncoding);
 continue;
 }
-// look for "location" attribute, inser as location
+// look for "location" attribute, insert as location
 nPos = line.indexOf( aLocStr, 0 );
 if( nPos != -1 )
 {


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

2023-02-03 Thread Julien Nabet (via logerrit)
 sw/source/core/unocore/unosrch.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 52ebc632b3cfa122dcb178cf28d8dbc7c7c57007
Author: Julien Nabet 
AuthorDate: Wed Feb 1 12:10:13 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Feb 3 10:55:12 2023 +

Related tdf#153272: add some missing properties in SwSearchProperties

RES_PARATR_ORPHANS
RES_PARATR_WIDOWS

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

diff --git a/sw/source/core/unocore/unosrch.cxx 
b/sw/source/core/unocore/unosrch.cxx
index 4f716230de8d..b9ee20b02c33 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -144,7 +144,9 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, 
bool bIsValueSearch)
 pCharReliefItem,
 pCharRotate,
 pCharScaleWidth,
-pParaVertAlign;
+pParaVertAlign,
+pParaOrphans,
+pParaWidows;
 
 auto funcClone = [&rSet](sal_uInt16 nWID, std::unique_ptr & 
rpPoolItem)
 {
@@ -314,6 +316,12 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& 
rSet, bool bIsValueSearch)
 case RES_PARATR_VERTALIGN:
 pTempItem = funcClone(nWID, pParaVertAlign);
 break;
+case RES_PARATR_ORPHANS:
+pTempItem = funcClone(nWID, pParaOrphans);
+break;
+case RES_PARATR_WIDOWS:
+pTempItem = funcClone(nWID, pParaWidows);
+break;
 }
 if(pTempItem)
 {


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

2023-02-03 Thread Henry Castro (via logerrit)
 desktop/source/lib/init.cxx |  129 +++-
 1 file changed, 127 insertions(+), 2 deletions(-)

New commits:
commit f74031d4eaeb289f062f77209da10d464c09c2a6
Author: Henry Castro 
AuthorDate: Wed Jan 11 16:14:57 2023 -0400
Commit: Henry Castro 
CommitDate: Fri Feb 3 12:32:24 2023 +

lok: add function getDocLanguages

If the spell checker is disabled to use a remote
spelling feature, the getLanguages function is obsolete.

In order to not break stable functions, introduce the
getDocLanguages for the remote spelling feature.

Signed-off-by: Henry Castro 
Change-Id: Ic210f31eddd3208b29d073ff35ba4fa2d98ea772
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145363
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
(cherry picked from commit bb0c63cc73998a0f67ae4c3e59acea3827a6e11c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146399
Tested-by: Jenkins

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 71c53f2d097a..d19d2717ffaa 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -77,6 +77,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -102,6 +103,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -5384,6 +5386,119 @@ static void 
doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, in
 pDoc->setGraphicSelection(nType, nX, nY);
 }
 
+static void getDocLanguages(LibreOfficeKitDocument* pThis, 
uno::Sequence& rSeq)
+{
+SfxViewFrame* pViewFrame = SfxViewFrame::Current();
+if (!pViewFrame)
+return;
+
+SfxDispatcher* pDispatcher = pViewFrame->GetBindings().GetDispatcher();
+if (!pDispatcher)
+return;
+
+css::uno::Any aLangStatus;
+pDispatcher->QueryState(SID_LANGUAGE_STATUS, aLangStatus);
+
+Sequence aSeqLang;
+if (!(aLangStatus >>= aSeqLang))
+return;
+
+// (aSeqLang[0] == "Current Language",  aSeqLang[1] == "Script Type",
+//  aSeqLang[2] == "Keyboard Language", aSeqLang[3] == "Guess Text Lang")
+if (aSeqLang.getLength() != 4)
+return;
+
+LanguageType nLangType;
+std::set aLangItems;
+SvtScriptType eScriptType = 
static_cast(aSeqLang[1].toInt32());
+
+if (!aSeqLang[0].isEmpty())
+{
+nLangType = SvtLanguageTable::GetLanguageType(aSeqLang[0]);
+if (nLangType != LANGUAGE_DONTKNOW)
+{
+aLangItems.insert(nLangType);
+}
+}
+
+const AllSettings& rAllSettings = Application::GetSettings();
+nLangType = rAllSettings.GetLanguageTag().getLanguageType();
+if (nLangType != LANGUAGE_DONTKNOW &&
+(eScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType)))
+{
+aLangItems.insert(nLangType);
+}
+
+nLangType = rAllSettings.GetUILanguageTag().getLanguageType();
+if (nLangType != LANGUAGE_DONTKNOW &&
+(eScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType)))
+{
+aLangItems.insert(nLangType);
+}
+
+if (!aSeqLang[2].isEmpty())
+{
+nLangType = SvtLanguageTable::GetLanguageType(aSeqLang[2]);
+if (nLangType != LANGUAGE_DONTKNOW &&
+(eScriptType & 
SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType)))
+{
+aLangItems.insert(nLangType);
+}
+}
+
+if (!aSeqLang[3].isEmpty())
+{
+Reference xLangGuesser;
+try
+{
+xLangGuesser = linguistic2::LanguageGuessing::create(xContext);
+}
+catch(...)
+{
+}
+
+if (xLangGuesser.is())
+{
+lang::Locale aLocale = 
xLangGuesser->guessPrimaryLanguage(aSeqLang[3], 0,
+  
aSeqLang[3].getLength());
+nLangType = LanguageTag(aLocale).makeFallback().getLanguageType();
+if (nLangType != LANGUAGE_DONTKNOW &&
+(eScriptType & 
SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType)))
+{
+aLangItems.insert(nLangType);
+}
+}
+}
+
+LibLODocument_Impl* pDocument = static_cast(pThis);
+Reference 
xDocumentLanguages(pDocument->mxComponent, UNO_QUERY);
+if (xDocumentLanguages.is())
+{
+const Sequence 
aLocales(xDocumentLanguages->getDocumentLanguages(
+  
static_cast(eScriptType), 64));
+
+for (const lang::Locale& aLocale : aLocales)
+{
+nLangType = SvtLanguageTable::GetLanguageType(aLocale.Language);
+if (nLangType != LANGUAGE_DONTKNOW &&
+(eScriptType & 
SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType)))
+{
+aLangItems.insert(nLangType);
+}
+}
+}
+
+int nLocale = 0;
+Sequence aLocales(aLangItems.size());
+auto 

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

2023-02-03 Thread Henry Castro (via logerrit)
 desktop/source/lib/init.cxx |   45 
 1 file changed, 29 insertions(+), 16 deletions(-)

New commits:
commit 967c56f7d4c46240a37b2d4dd0a2f577b621f75d
Author: Henry Castro 
AuthorDate: Tue Jan 17 11:02:13 2023 -0400
Commit: Henry Castro 
CommitDate: Fri Feb 3 12:32:50 2023 +

lok: fix query language status

The Calc and Impress return language status
as a SfxStringItem, but Writer is a SfxListStringItem.

Signed-off-by: Henry Castro 
Change-Id: I88f77288e422a8f80473f0e33257078cfaa704b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145675
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146479
Tested-by: Jenkins

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d19d2717ffaa..0e9e2c203fff 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5399,22 +5399,34 @@ static void getDocLanguages(LibreOfficeKitDocument* 
pThis, uno::SequenceQueryState(SID_LANGUAGE_STATUS, aLangStatus);
 
-Sequence aSeqLang;
-if (!(aLangStatus >>= aSeqLang))
-return;
+OUString sCurrent;
+OUString sKeyboard;
+OUString sGuessText;
+SvtScriptType eScriptType = SvtScriptType::LATIN | SvtScriptType::ASIAN
+| SvtScriptType::COMPLEX;
 
-// (aSeqLang[0] == "Current Language",  aSeqLang[1] == "Script Type",
-//  aSeqLang[2] == "Keyboard Language", aSeqLang[3] == "Guess Text Lang")
-if (aSeqLang.getLength() != 4)
-return;
+Sequence aSeqLang;
+if (aLangStatus >>= aSeqLang)
+{
+if (aSeqLang.getLength() == 4)
+{
+sCurrent = aSeqLang[0];
+eScriptType = static_cast(aSeqLang[1].toInt32());
+sKeyboard = aSeqLang[1];
+sGuessText = aSeqLang[2];
+}
+}
+else
+{
+aLangStatus >>= sCurrent;
+}
 
 LanguageType nLangType;
 std::set aLangItems;
-SvtScriptType eScriptType = 
static_cast(aSeqLang[1].toInt32());
 
-if (!aSeqLang[0].isEmpty())
+if (!sCurrent.isEmpty())
 {
-nLangType = SvtLanguageTable::GetLanguageType(aSeqLang[0]);
+nLangType = SvtLanguageTable::GetLanguageType(sCurrent);
 if (nLangType != LANGUAGE_DONTKNOW)
 {
 aLangItems.insert(nLangType);
@@ -5436,9 +5448,9 @@ static void getDocLanguages(LibreOfficeKitDocument* 
pThis, uno::Sequence xLangGuesser;
 try
@@ -5459,9 +5471,10 @@ static void getDocLanguages(LibreOfficeKitDocument* 
pThis, uno::SequenceguessPrimaryLanguage(aSeqLang[3], 0,
-  
aSeqLang[3].getLength());
-nLangType = LanguageTag(aLocale).makeFallback().getLanguageType();
+lang::Locale aLocale = 
xLangGuesser->guessPrimaryLanguage(sGuessText, 0,
+  
sGuessText.getLength());
+LanguageTag aLanguageTag(aLocale);
+nLangType = aLanguageTag.getLanguageType(false);
 if (nLangType != LANGUAGE_DONTKNOW &&
 (eScriptType & 
SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType)))
 {


[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 6 commits - basctl/source basegfx/CppunitTest_basegfx.mk basegfx/test chart2/source cui/source editeng/source filter/source include

2023-02-03 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit a4ed24650ac0998536f72f9aecd2b1590b175587
Author: Tomaž Vajngerl 
AuthorDate: Wed Nov 23 11:00:13 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Feb 3 22:56:36 2023 +0900

svx: convert SdrTextObj rotate and move to use gfx::Length

Change-Id: I82f10f82db8ac9d5653f4902276ee58fc18c52d6

diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 1055e5dbe3bb..9ccc69709abf 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -40,6 +40,35 @@
 
 using namespace com::sun::star;
 
+namespace
+{
+gfx::Tuple2DL rotatePoint(gfx::Tuple2DL const& rPoint, gfx::Tuple2DL const& 
rReference, double sinAngle, double cosAngle)
+{
+gfx::Length dx = rPoint.getX() - rReference.getX();
+gfx::Length dy = rPoint.getY() - rReference.getY();
+
+auto x = rReference.getX() + gfx::Length::emu(basegfx::fround(dx.raw() * 
cosAngle + dy.raw() * sinAngle));
+auto y = rReference.getY() + gfx::Length::emu(basegfx::fround(dy.raw() * 
cosAngle - dx.raw() * sinAngle));
+
+return gfx::Tuple2DL(x, y);
+}
+
+gfx::Tuple2DL toTuple(Point const& rPointHmm)
+{
+auto x = gfx::Length::hmm(rPointHmm.X());
+auto y = gfx::Length::hmm(rPointHmm.Y());
+return {x, y};
+}
+
+gfx::Size2DL toSize2D(Size const& rSizeHmm)
+{
+auto x = gfx::Length::hmm(rSizeHmm.Width());
+auto y = gfx::Length::hmm(rSizeHmm.Height());
+return {x, y};
+}
+
+} // end anonymous ns
+
 void SdrTextObj::NbcSetSnapRect(const tools::Rectangle& rRect)
 {
 if (maGeo.nRotationAngle || maGeo.nShearAngle)
@@ -92,7 +121,9 @@ Degree100 SdrTextObj::GetShearAngle(bool /*bVertical*/) const
 
 void SdrTextObj::NbcMove(const Size& rSize)
 {
-moveRectangle(rSize.Width(), rSize.Height());
+gfx::Size2DL aSize2D = toSize2D(rSize);
+maRectangle.shift(aSize2D.getWidth(), aSize2D.getHeight());
+
 moveOutRectangle(rSize.Width(), rSize.Height());
 maSnapRect.Move(rSize);
 SetBoundAndSnapRectsDirty(true);
@@ -183,27 +214,37 @@ void SdrTextObj::NbcResize(const Point& rRef, const 
Fraction& xFact, const Fract
 SetBoundAndSnapRectsDirty();
 }
 
-void SdrTextObj::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, 
double cs)
+void SdrTextObj::NbcRotate(const Point& rRef, Degree100 nAngle, double 
sinAngle, double cosAngle)
 {
+auto aReference = toTuple(rRef);
+
 SetGlueReallyAbsolute(true);
-tools::Long dx = getRectangle().Right() - getRectangle().Left();
-tools::Long dy = getRectangle().Bottom() - getRectangle().Top();
-Point aPoint1(getRectangle().TopLeft());
-RotatePoint(aPoint1, rRef, sn, cs);
-Point aPoint2(aPoint1.X() + dx, aPoint1.Y() + dy);
-tools::Rectangle aRectangle(aPoint1, aPoint2);
-setRectangle(aRectangle);
+auto const& rRange = maRectangle.getRange();
+
+auto nWidth = rRange.getWidth();
+auto nHeight = rRange.getHeight();
+
+gfx::Tuple2DL aPoint1(rRange.getMinX(), rRange.getMinY());
+aPoint1 = rotatePoint(aPoint1, aReference, sinAngle, cosAngle);
 
-if (maGeo.nRotationAngle==0_deg100) {
-maGeo.nRotationAngle=NormAngle36000(nAngle);
-maGeo.mfSinRotationAngle=sn;
-maGeo.mfCosRotationAngle=cs;
-} else {
-maGeo.nRotationAngle=NormAngle36000(maGeo.nRotationAngle+nAngle);
+gfx::Tuple2DL aPoint2(aPoint1.getX() + nWidth, aPoint1.getY() + nHeight);
+
+gfx::Range2DL aRange{aPoint1, aPoint2};
+maRectangle.setRange(aRange);
+
+if (maGeo.nRotationAngle == 0_deg100)
+{
+maGeo.nRotationAngle = NormAngle36000(nAngle);
+maGeo.mfSinRotationAngle = sinAngle;
+maGeo.mfCosRotationAngle = cosAngle;
+}
+else
+{
+maGeo.nRotationAngle = NormAngle36000(maGeo.nRotationAngle + nAngle);
 maGeo.RecalcSinCos();
 }
 SetBoundAndSnapRectsDirty();
-NbcRotateGluePoints(rRef,nAngle,sn,cs);
+NbcRotateGluePoints(rRef, nAngle, sinAngle, cosAngle);
 SetGlueReallyAbsolute(false);
 }
 
commit 6c72be9da7b6b8cd14c93918b57c326458e7f3e0
Author: Tomaž Vajngerl 
AuthorDate: Tue Nov 22 13:33:30 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Feb 3 22:56:36 2023 +0900

svx: use RectangleWrapper for maRectangle on SdrTextObj

This is needed so we can now transition to use gfx::Length and
gfx::Range2DL to define the object position and size.

Change-Id: Ie683a869ba061f53d437bd1dfbe72fe454011730

diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index a1cccb0804a4..035dd493ca89 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -165,32 +166,17 @@ protected:
 // The "aRect" is also the rect of RectObj and CircObj.
 // When mbTextFrame=true the text will be formatted into this rect
 // When mbTextFrame=false the text will be centered around its middle
-tools::Rectangle maRectangle;
+  

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

2023-02-03 Thread Stephan Bergmann (via logerrit)
 vcl/win/window/salframe.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5e0748d5bc12f789f9228d514294f8dcb0484b09
Author: Stephan Bergmann 
AuthorDate: Fri Feb 3 15:25:33 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Feb 3 15:37:32 2023 +

Avoid clang-cl -Werror,-Wparentheses

(assuming 9274d41bd72c5310491d81c6d8d938e44ed9d223 "tdf#148085 get a more
readable hyperlink color under windows dark mode" didn't introduce a = vs. 
==
typo)

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

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index f15a4f23e693..8c43b8448d93 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -2683,7 +2683,8 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
 aStyleSettings.SetInactiveTabColor( ImplWinColorToSal( color ) );
 CloseThemeData(hTheme);
 
-if (hTheme = OpenThemeData(mhWnd, L"Textstyle"))
+hTheme = OpenThemeData(mhWnd, L"Textstyle");
+if (hTheme)
 {
 GetThemeColor(hTheme, TEXT_HYPERLINKTEXT, TS_HYPERLINK_NORMAL, 
TMT_TEXTCOLOR, &color);
 aStyleSettings.SetLinkColor(ImplWinColorToSal(color));


[Libreoffice-commits] core.git: compilerplugins/clang

2023-02-03 Thread Stephan Bergmann (via logerrit)
 compilerplugins/clang/sfxpoolitem.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 17cf2c278d9545dd6c9a9f132e52eae0ae482279
Author: Stephan Bergmann 
AuthorDate: Fri Feb 3 15:28:14 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Feb 3 15:38:03 2023 +

Fix misuse of TagDecl::hasDefinition

...that started to cause false

> In file included from svl/source/items/itemiter.cxx:20:
> include/svl/itemiter.hxx:25:1: error: SfxPoolItem subclass SfxPoolItem 
declares new fields, but does not override operator== [loplugin:sfxpoolitem]
> class SfxPoolItem;
> ^

etc. now as a side effect of


"[C++20] Fix a crash with modules."

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

diff --git a/compilerplugins/clang/sfxpoolitem.cxx 
b/compilerplugins/clang/sfxpoolitem.cxx
index 801689f0f3de..79ef64dd243e 100644
--- a/compilerplugins/clang/sfxpoolitem.cxx
+++ b/compilerplugins/clang/sfxpoolitem.cxx
@@ -93,7 +93,7 @@ bool SfxPoolItem::VisitCXXRecordDecl(const CXXRecordDecl* 
decl)
 if (ignoreLocation(decl)) {
return true;
 }
-if (!decl->hasDefinition()) {
+if (!decl->isThisDeclarationADefinition()) {
return true;
 }
 // check if this class is derived from Window


Sebastian Andrzej Siewior license statement

2023-02-03 Thread Sebastian Andrzej Siewior
All of my past & future contributions to LibreOffice may be
licensed under the MPLv2/LGPLv3+ dual license.

Sebastian


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

2023-02-03 Thread Laurent Balland (via logerrit)
 include/svl/zformat.hxx |3 +
 svl/source/numbers/zforlist.cxx |   85 +---
 svl/source/numbers/zformat.cxx  |   20 +
 3 files changed, 77 insertions(+), 31 deletions(-)

New commits:
commit ac24b5992402c07eb71e99094d4be4ba667800ef
Author: Laurent Balland 
AuthorDate: Mon Jan 2 18:39:35 2023 +0100
Commit: Eike Rathke 
CommitDate: Fri Feb 3 16:05:58 2023 +

tdf#152722 Number Format: keep NatNum modifiers

When modifying number format with UI (decimal places, negative in red...) 
NatNum modifiers must be preserved
Implement an helper to get NatNum string
As NatNum12 already inserts currency unit, do not treat it

Change-Id: I38be1da08a44d75ef663eaf50fccb3820ff9ed5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144963
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 8ba7657a9653f8ae5d1b865356d11138df7b2093)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146406

diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 43f6ad9775f4..ea08234e93a2 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -459,6 +459,9 @@ public:
 void GetNatNumXml(
 css::i18n::NativeNumberXmlAttributes2& rAttr,
 sal_uInt16 nNumFor ) const;
+/** Return empty string if no NatNum modifier or unvalid nNumFor
+otherwhise return "[NatNum1]" or "[NatNum12 ...]" */
+OUString GetNatNumModifierString( sal_uInt16 nNumFor = 0 ) const;
 
 /** Switches to the first non-"gregorian" calendar, but only if the current
 calendar is "gregorian"; original calendar name and date/time returned,
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index cee75fc9265e..ca8b6524b9e2 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -3231,6 +3231,15 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 
nIndex,
 sString.append(GetNumDecimalSep());
 padToLength(sString, sString.getLength() + nPrecision, '0');
 }
+
+// Native Number
+const OUString sPosNatNumModifier = pFormat ? 
pFormat->GetNatNumModifierString( 0 ) : "";
+const OUString sNegNatNumModifier = pFormat ?
+// if a negative format already exists, use its NatNum modifier
+// else use NatNum modifier of positive format
+( pFormat->GetNumForString( 1, 0 )  ? 
pFormat->GetNatNumModifierString( 1 ) : sPosNatNumModifier )
+: "";
+
 if (eType == SvNumFormatType::PERCENT)
 {
 sString.append( pFormat->GetPercentString() );
@@ -3254,50 +3263,62 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 
nIndex,
 OUString aCurr;
 const NfCurrencyEntry* pEntry;
 bool bBank;
-if ( GetNewCurrencySymbolString( nIndex, aCurr, &pEntry, &bBank ) )
+bool isPosNatNum12 = sPosNatNumModifier.startsWith( "[NatNum12" );
+bool isNegNatNum12 = sNegNatNumModifier.startsWith( "[NatNum12" );
+if ( !isPosNatNum12 || !isNegNatNum12 )
 {
-if ( pEntry )
+if ( GetNewCurrencySymbolString( nIndex, aCurr, &pEntry, &bBank ) )
 {
-sal_uInt16 nPosiForm = 
NfCurrencyEntry::GetEffectivePositiveFormat(
-xLocaleData->getCurrPositiveFormat(),
-pEntry->GetPositiveFormat(), bBank );
-sal_uInt16 nNegaForm = 
NfCurrencyEntry::GetEffectiveNegativeFormat(
-xLocaleData->getCurrNegativeFormat(),
-pEntry->GetNegativeFormat(), bBank );
-pEntry->CompletePositiveFormatString( sString, bBank, 
nPosiForm );
-pEntry->CompleteNegativeFormatString( sNegStr, bBank, 
nNegaForm );
+if ( pEntry )
+{
+sal_uInt16 nPosiForm = 
NfCurrencyEntry::GetEffectivePositiveFormat(
+xLocaleData->getCurrPositiveFormat(),
+pEntry->GetPositiveFormat(), bBank );
+sal_uInt16 nNegaForm = 
NfCurrencyEntry::GetEffectiveNegativeFormat(
+xLocaleData->getCurrNegativeFormat(),
+pEntry->GetNegativeFormat(), bBank );
+if ( !isPosNatNum12 )
+pEntry->CompletePositiveFormatString( sString, bBank, 
nPosiForm );
+if ( !isNegNatNum12 )
+pEntry->CompleteNegativeFormatString( sNegStr, bBank, 
nNegaForm );
+}
+else
+{   // assume currency abbreviation (AKA banking symbol), not 
symbol
+sal_uInt16 nPosiForm = 
NfCurrencyEntry::GetEffectivePositiveFormat(
+xLocaleData->getCurrPositiveFormat(),
+xLocaleData->getCurrPositiveFormat(), true );
+sal_uInt16 nNegaForm = 
NfCurrencyEntry::GetEffective

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

2023-02-03 Thread Mike Kaganski (via logerrit)
 sw/source/core/text/txtfrm.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 274587f634e57b59b34f352409453b394064cadd
Author: Mike Kaganski 
AuthorDate: Fri Feb 3 17:21:19 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri Feb 3 16:21:48 2023 +

Avoid UB

as seen in https://ci.libreoffice.org/job/lo_ubsan/2671/ after commit
333183d9a72d1e2b7ae65145092efec5e357ad14 ("tdf#153304: Add undo entries
and set modified in SwXFrame::setProperty*", 2023-02-02):

  [_RUN_] testImagePropsCreateUndoAndModifyDoc::TestBody
  warn:sal.file:4195:4195:sal/osl/unx/file_misc.cxx:401: Invalid directory 
URL
  warn:basic:4195:4195:basic/source/uno/namecont.cxx:953: Cannot access 
extensions!
  warn:sal.file:4195:4195:sal/osl/unx/file_misc.cxx:401: Invalid directory 
URL
  warn:basic:4195:4195:basic/source/uno/namecont.cxx:953: Cannot access 
extensions!
  warn:legacy.osl:4195:4195:sw/source/core/text/porfly.cxx:198: CalcFlyPos: 
Not Found!
  warn:legacy.osl:4195:4195:sw/source/core/text/txtfrm.cxx:3092: Prepare: 
Why me?
  /include/o3tl/strong_int.hxx:143:40: runtime error: signed integer 
overflow: 2147483647 + 1 cannot be represented in type 'int'
  #0 0x7f79b14fee7a in o3tl::strong_int 
o3tl::operator+(o3tl::strong_int const&, o3tl::strong_int const&) 
/include/o3tl/strong_int.hxx:143:40
  #1 0x7f79b553f7a5 in SwTextFrame::IsIdxInside(o3tl::strong_int, o3tl::strong_int) const 
/sw/source/core/text/txtfrm.cxx:1665:71
  #2 0x7f79b559be6a in SwTextFrame::InvalidateRange(SwCharRange const&, 
long) /sw/source/core/text/txtfrm.cxx:1689:10
  #3 0x7f79b5566a79 in SwTextFrame::Prepare(PrepareHint, void const*, 
bool) /sw/source/core/text/txtfrm.cxx:3093:17
  #4 0x7f79b438c1b5 in SwFlyInContentFrame::SwClientNotify(SwModify 
const&, SfxHint const&) /sw/source/core/layout/flyincnt.cxx:137:28
  #5 0x7f79b17c06e2 in SwModify::CallSwClientNotify(SfxHint const&) 
const /sw/source/core/attr/calbck.cxx:322:18
  #6 0x7f79b17c09e5 in 
sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const 
/sw/source/core/attr/calbck.cxx:327:15
  #7 0x7f79b17be1ef in SwModify::SwClientNotify(SwModify const&, 
SfxHint const&) /sw/source/core/attr/calbck.cxx:313:5
  #8 0x7f79b1801e06 in SwFormat::SwClientNotify(SwModify const&, 
SfxHint const&) /sw/source/core/attr/format.cxx:314:19
  #9 0x7f79b414fa7c in SwFrameFormat::SwClientNotify(SwModify const&, 
SfxHint const&) /sw/source/core/layout/atrfrm.cxx:2713:15
  #10 0x7f79b17c0f13 in sw::ClientNotifyAttrChg(SwModify&, SwAttrSet 
const&, SwAttrSet&, SwAttrSet&) /sw/source/core/attr/calbck.cxx:336:13
  #11 0x7f79b18090b5 in SwFormat::SetFormatAttr(SfxPoolItem const&) 
/sw/source/core/attr/format.cxx:520:13
  #12 0x7f79b23c2e54 in SwDoc::SetFlyFrameAnchor(SwFrameFormat&, 
SfxItemSet&, bool) /sw/source/core/doc/docfly.cxx:326:13
  #13 0x7f79b23cac22 in lcl_SetFlyFrameAttr(SwDoc&, signed char 
(SwDoc::*)(SwFrameFormat&, SfxItemSet&, bool), SwFrameFormat&, SfxItemSet&) 
/sw/source/core/doc/docfly.cxx:451:17
  #14 0x7f79b23ca43d in SwDoc::SetFlyFrameAttr(SwFrameFormat&, 
SfxItemSet&) /sw/source/core/doc/docfly.cxx:560:23
  #15 0x7f79b64818d2 in SwXFrame::setPropertyValue(rtl::OUString 
const&, com::sun::star::uno::Any const&) 
/sw/source/core/unocore/unoframe.cxx:1921:36
  #16 0x7f79d562de12 in 
testImagePropsCreateUndoAndModifyDoc::TestBody() 
/sw/qa/core/undo/undo.cxx:136:13
  ...

See 
https://gerrit.libreoffice.org/c/core/+/146484/7#message-8ce5de47f17cc701fc58b932e80b1de8469053bf
Hope it makes sense.

Change-Id: Id5c86ed4c093993557a24e00b3288ccdfa4de2ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146542
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 86cfe6555431..aa371cd3df63 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1657,6 +1657,8 @@ TextFrameIndex SwTextFrame::FindBrk(std::u16string_view 
aText,
 
 bool SwTextFrame::IsIdxInside(TextFrameIndex const nPos, TextFrameIndex const 
nLen) const
 {
+if (nPos == TextFrameIndex(COMPLETE_STRING)) // the "not found" range
+return false;
 // Silence over-eager warning emitted at least by GCC trunk towards 6:
 #if defined __GNUC__ && !defined __clang__
 #pragma GCC diagnostic push


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

2023-02-03 Thread Colomban Wendling (via logerrit)
 include/test/a11y/AccessibilityTools.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit fb42b73d50eb3856a96c8c6f269e37d9da2181f2
Author: Colomban Wendling 
AuthorDate: Thu Feb 2 11:08:37 2023 +0100
Commit: Noel Grandin 
CommitDate: Fri Feb 3 17:11:12 2023 +

test/a11y: Remove declaration for undefined method

getStateName() has been removed and superseded by
debugAccessibleStateSet() in 8d8e6c84e512c1a8b33aac75965b84481d1a1d13
but its declaration was still there.

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

diff --git a/include/test/a11y/AccessibilityTools.hxx 
b/include/test/a11y/AccessibilityTools.hxx
index 65116a2d19d4..88276bac700d 100644
--- a/include/test/a11y/AccessibilityTools.hxx
+++ b/include/test/a11y/AccessibilityTools.hxx
@@ -78,7 +78,6 @@ public:
 }
 
 static OUString getRoleName(const sal_Int16 role);
-static OUString getStateName(const sal_Int16 state);
 static OUString getEventIdName(const sal_Int16 event_id);
 static OUString getRelationTypeName(const sal_Int16 rel_type);
 


[Libreoffice-commits] core.git: cui/source include/svl include/svx sc/source svl/source svx/source

2023-02-03 Thread Laurent Balland (via logerrit)
 cui/source/tabpages/numfmt.cxx |3 +-
 include/svl/numformat.hxx  |3 ++
 include/svx/numfmtsh.hxx   |   27 -
 sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx |   26 +++-
 sc/source/ui/view/formatsh.cxx |3 ++
 svl/source/numbers/zforlist.cxx|7 +
 svx/source/items/numfmtsh.cxx  |7 +
 7 files changed, 58 insertions(+), 18 deletions(-)

New commits:
commit bbd487dc26c7e37982f64f6e6159c65ac77a89f1
Author: Laurent Balland 
AuthorDate: Sat Jan 14 15:48:12 2023 +0100
Commit: Eike Rathke 
CommitDate: Fri Feb 3 17:57:01 2023 +

tdf#153023 Disable Thousand separator for NatNum12

Add some helper to get NatNum12 state
Modify both Number format dialog and Sidebar
Transform CAT_ defines in enum

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

diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index e6e669de6422..63f9d5ce91f7 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -942,7 +942,8 @@ void SvxNumberFormatTabPage::UpdateOptions_Impl( bool 
bCheckCatChange /*= sal_Fa
 m_xBtnNegRed->set_active( bNegRed );
 if ( nCategory != CAT_SCIENTIFIC )
 {
-m_xBtnThousand->set_sensitive( nCategory != CAT_TIME );
+m_xBtnThousand->set_sensitive( nCategory != CAT_TIME
+&& !pNumFmtShell->IsNatNum12( 
theFormat ) );
 m_xBtnThousand->set_active( bThousand && nCategory != CAT_TIME 
);
 }
 break;
diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx
index 6ff04837b0bb..0a374f3c3301 100644
--- a/include/svl/numformat.hxx
+++ b/include/svl/numformat.hxx
@@ -238,6 +238,9 @@ public:
 /// Whether format index nFIndex is of type text or not
 bool IsTextFormat(sal_uInt32 nFIndex) const;
 
+/// Whether format index nFIndex has NatNum12 modifier
+bool IsNatNum12(sal_uInt32 nFIndex) const;
+
 /// Get additional info of a format index, e.g. for dialog box
 void GetFormatSpecialInfo(sal_uInt32 nFormat, bool& bThousand, bool& IsRed,
   sal_uInt16& nPrecision, sal_uInt16& nLeadingCnt);
diff --git a/include/svx/numfmtsh.hxx b/include/svx/numfmtsh.hxx
index 360a067e06c9..db593eb8b77d 100644
--- a/include/svx/numfmtsh.hxx
+++ b/include/svx/numfmtsh.hxx
@@ -38,17 +38,20 @@ enum class SvxNumberValueType
 };
 
 // sort order of the category ListBox entries in the TabPage
-#define CAT_ALL 0
-#define CAT_USERDEFINED 1
-#define CAT_NUMBER  2
-#define CAT_PERCENT 3
-#define CAT_CURRENCY4
-#define CAT_DATE5
-#define CAT_TIME6
-#define CAT_SCIENTIFIC  7
-#define CAT_FRACTION8
-#define CAT_BOOLEAN 9
-#define CAT_TEXT10
+enum SvxNumberFormatCategory
+{
+CAT_ALL = 0,
+CAT_USERDEFINED,
+CAT_NUMBER,
+CAT_PERCENT,
+CAT_CURRENCY,
+CAT_DATE,
+CAT_TIME,
+CAT_SCIENTIFIC,
+CAT_FRACTION,
+CAT_BOOLEAN,
+CAT_TEXT
+};
 
 #define SELPOS_NONE -1
 
@@ -130,6 +133,8 @@ public:
 
 sal_uInt16  GetFormatIntegerDigits( std::u16string_view  rFormat ) 
const;
 
+boolIsNatNum12( std::u16string_view rFormat ) const;
+
 voidMakePreviewString( const OUString& rFormatStr,
OUString&   rPreviewStr,
const Color*& rpFontColor );
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx 
b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index c9910cc1db82..b2530df9838f 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -185,12 +186,17 @@ void NumberFormatPropertyPanel::NotifyItemUpdate(
 sal_uInt16 nVal = pItem->GetValue();
 mnCategorySelected = nVal;
 mxLbCategory->set_active(nVal);
-if (nVal < 8 &&  // General, Number, Percent, Currency, Time, 
Scientific, Fraction
-nVal != 4 )  // not Date
+// There is an offset between category list enum and listbox 
in side panel
+SvxNumberFormatCategory nCategory = static_cast< 
SvxNumberFormatCategory >( nVal + 1 );
+if (nCategory <= CAT_FRACTION &&  // General, Number, Percent, 
Currency, Time, Scientific, Fraction
+nCategory != CAT_DATE )   // not Date
 {
-bool bIsScientific ( nVal == 

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

2023-02-03 Thread Aron Budea (via logerrit)
 vcl/source/window/window2.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 22297965a0b8c94ad7f2173f22f91ee00ad4698e
Author: Aron Budea 
AuthorDate: Thu Feb 2 00:08:41 2023 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 3 21:55:10 2023 +0100

vcl: fix online crash in vcl::Window::IsTracking()

Crashreport signature:

program/libmergedlo.so
vcl::Window::IsTracking() const
vcl/source/window/window2.cxx:340
program/libmergedlo.so
(anonymous namespace)::LOKPostAsyncEvent(void*, void*)
sfx2/source/view/lokhelper.cxx:812
program/libmergedlo.so
LokChartHelper::postMouseEvent(int, int, int, int, int, int, 
double, double)
include/rtl/ref.hxx:128
program/libmergedlo.so
SfxLokHelper::testInPlaceComponentMouseEventHit(SfxViewShell*, int, 
int, int, int, int, int, double, double, bool)
sfx2/source/view/lokhelper.cxx:980
/program/libswlo.so
SwXTextDocument::postMouseEvent(int, int, int, int, int, int)
sw/source/uibase/uno/unotxdoc.cxx:3663
program/libmergedlo.so
doc_postMouseEvent
desktop/source/lib/init.cxx:4831

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

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 87db8e470e21..180edf5cf961 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -341,9 +341,15 @@ bool Window::IsTracking() const
 {
 if (!mpWindowImpl)
 return false;
-return (mpWindowImpl->mbUseFrameData ?
-mpWindowImpl->mpFrameData->mpTrackWin == this :
-ImplGetSVData()->mpWinData->mpTrackWin == this);
+if (mpWindowImpl->mbUseFrameData && mpWindowImpl->mpFrameData)
+{
+return mpWindowImpl->mpFrameData->mpTrackWin == this;
+}
+if (!mpWindowImpl->mbUseFrameData && ImplGetSVData()->mpWinData)
+{
+return ImplGetSVData()->mpWinData->mpTrackWin == this;
+}
+return false;
 }
 
 void Window::StartAutoScroll( StartAutoScrollFlags nFlags )
commit 3239018539d0e2a5f120ef214013417cff79a572
Author: Noel Grandin 
AuthorDate: Fri Jan 27 08:50:04 2023 +0200
Commit: Andras Timar 
CommitDate: Fri Feb 3 21:55:10 2023 +0100

fix online crash in WIndow::IsTracking

/opt/collaboraoffice/program/libmergedlo.so
  vcl::Window::IsTracking() const
  
/home/collabora/jenkins/workspace/build_core_co-22.05_for_online_snapshot/vcl/source/window/window2.cxx:340
/opt/collaboraoffice/program/libmergedlo.so
  (anonymous namespace)::LOKPostAsyncEvent(void*, void*)
  
/home/collabora/jenkins/workspace/build_core_co-22.05_for_online_snapshot/sfx2/source/view/lokhelper.cxx:812
/opt/collaboraoffice/program/libmergedlo.so
  LokChartHelper::postMouseEvent(int, int, int, int, int, int, double, 
double)
  
/home/collabora/jenkins/workspace/build_core_co-22.05_for_online_snapshot/include/rtl/ref.hxx:128

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

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 978dc0b6ecf8..87db8e470e21 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -339,6 +339,8 @@ void Window::EndTracking( TrackingEventFlags nFlags )
 
 bool Window::IsTracking() const
 {
+if (!mpWindowImpl)
+return false;
 return (mpWindowImpl->mbUseFrameData ?
 mpWindowImpl->mpFrameData->mpTrackWin == this :
 ImplGetSVData()->mpWinData->mpTrackWin == this);


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

2023-02-03 Thread Aron Budea (via logerrit)
 sfx2/source/view/lokhelper.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ede43e54ed7f89a20906ae84d9447eeb3412bc7f
Author: Aron Budea 
AuthorDate: Thu Jan 26 03:31:24 2023 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 3 21:55:40 2023 +0100

sfx2: fix crash in SfxLokHelper::notifyAllViews(...)

Crashreport signature:

program/libmergedlo.so
SfxLokHelper::notifyAllViews(int, rtl::OString const&)
sfx2/source/view/lokhelper.cxx:682
program/libmergedlo.so
SfxClipboardChangeListener::ChangedContents()
include/rtl/string.hxx:413
program/libmergedlo.so
SfxClipboardChangeListener::LinkStubAsyncExecuteHdl_Impl(void*, 
void*)
include/rtl/ref.hxx:128
program/libmergedlo.so
ImplWindowFrameProc(vcl::Window*, SalEvent, void const*)
include/rtl/ref.hxx:128
program/libmergedlo.so
SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent)

Change-Id: Ibf70f42292d67a3d6cc68f579ee02f671da85acb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146150
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit dc17158c99c8a15fbca57a9a0b0ea7178dcc5a34)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146400
Tested-by: Jenkins
Reviewed-by: Aron Budea 

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 53c2abace8b5..29f64adbb74b 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -676,6 +676,8 @@ void SfxLokHelper::notifyAllViews(int nType, const OString& 
rPayload)
 
 const auto payload = rPayload.getStr();
 const SfxViewShell* const pCurrentViewShell = SfxViewShell::Current();
+if (!pCurrentViewShell)
+return;
 SfxViewShell* pViewShell = SfxViewShell::GetFirst();
 while (pViewShell)
 {


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

2023-02-03 Thread Caolán McNamara (via logerrit)
 cui/uiconfig/ui/langtoolconfigpage.ui|  148 +++
 cui/uiconfig/ui/optdeeplpage.ui  |   82 +
 sd/uiconfig/simpress/ui/pmsummarypage.ui |1 
 sw/uiconfig/swriter/ui/numberinput.ui|1 
 4 files changed, 120 insertions(+), 112 deletions(-)

New commits:
commit cdd3af2364ebe9f8d2a23266a62be2597022f255
Author: Caolán McNamara 
AuthorDate: Thu Feb 2 11:54:27 2023 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Feb 3 21:14:48 2023 +

resave with latest glade

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

diff --git a/cui/uiconfig/ui/langtoolconfigpage.ui 
b/cui/uiconfig/ui/langtoolconfigpage.ui
index 38aa184c2469..8be8c1c2359a 100644
--- a/cui/uiconfig/ui/langtoolconfigpage.ui
+++ b/cui/uiconfig/ui/langtoolconfigpage.ui
@@ -1,202 +1,204 @@
 
-
+
 
   
   
 True
-False
-6
+False
+6
 12
 
   
 True
-False
-0
-none
+False
+0
+none
 
+  
   
 True
-False
+False
 True
 True
 
   
 True
-False
+False
 start
-6
-4
+6
+4
 If you enable this, the data will be 
sent to an external server.
 True
   
   
-0
-0
+0
+0
   
 
 
   
 Please read the privacy policy
 True
-True
-True
+True
+True
 start
 start
 none
 https://languagetool.org/legal/privacy
   
   
-0
-1
+0
+1
   
 
 
   
 Enable LanguageTool
 True
-True
-False
+True
+False
 start
-6
-9
-True
+6
+9
+True
   
   
-0
-2
+0
+2
   
 
 
   
-False
-10
-0
-none
+False
+10
+0
+none
 
+  
   
 True
-False
-5
-12
+False
+5
+12
 
   
 True
-False
+False
 start
 Base URL:
-True
-baseurl
+True
+baseurl
   
   
-0
-0
+0
+0
   
 
 
   
 True
-True
-True
+True
 True
+True
   
   
-1
-0
+1
+0
   
 
 
   
 True
-False
+False
 start
 Username:
-True
-username
+True
+username
   
   
-0
-2
+0
+2
   
 
 
   
 True
-False
+False
 start
 API key:
-True
-apikey
+True
+apikey
   
   
-0
-4
+   

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

2023-02-03 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/shells/translatehelper.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit a6b3eb3fbcccdc4873f10c946313f12712b3b231
Author: Szymon Kłos 
AuthorDate: Wed Nov 30 17:53:34 2022 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 3 21:59:42 2023 +0100

deepl: don't introduce new bullets

Used HTML should be free from new line characters and also 
marks so we don't generate new lines.

Change-Id: I02b8f9a9af9f93e8d90a7f4a22ea02c8e1f47651
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143507
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144948
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/shells/translatehelper.cxx 
b/sw/source/uibase/shells/translatehelper.cxx
index 8933d22db27f..507c2812a675 100644
--- a/sw/source/uibase/shells/translatehelper.cxx
+++ b/sw/source/uibase/shells/translatehelper.cxx
@@ -45,7 +45,7 @@ OString ExportPaMToHTML(SwPaM* pCursor, bool bReplacePTag)
 SolarMutexGuard gMutex;
 OString aResult;
 WriterRef xWrt;
-GetHTMLWriter(u"NoLineLimit,SkipHeaderFooter", OUString(), xWrt);
+GetHTMLWriter(u"NoLineLimit,SkipHeaderFooter,NoPrettyPrint", OUString(), 
xWrt);
 if (pCursor != nullptr)
 {
 SvMemoryStream aMemoryStream;
@@ -63,6 +63,13 @@ OString ExportPaMToHTML(SwPaM* pCursor, bool bReplacePTag)
 aResult = aResult.replaceAll("", "");
 }
+
+// HTML has for that  and  also does new line
+aResult = aResult.replaceAll("", "");
+aResult = aResult.replaceAll("", "");
+aResult = aResult.replaceAll("", "");
+aResult = aResult.replaceAll("", "");
+aResult = aResult.replaceAll("\n", "").trim();
 return aResult;
 }
 return {};


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 5 commits - cui/inc cui/source cui/uiconfig sc/source vcl/jsdialog vcl/source

2023-02-03 Thread Szymon Kłos (via logerrit)
 cui/inc/widgettestdlg.hxx|4 
 cui/source/dialogs/widgettestdlg.cxx |   26 
 cui/uiconfig/ui/widgettestdialog.ui  |  200 +++
 sc/source/ui/view/gridwin4.cxx   |9 -
 vcl/jsdialog/jsdialogbuilder.cxx |3 
 vcl/source/treelist/svtabbx.cxx  |   17 ++
 6 files changed, 230 insertions(+), 29 deletions(-)

New commits:
commit c10d9d194aec6f9c038f22862d2a61028d27e80e
Author: Szymon Kłos 
AuthorDate: Tue Jan 10 10:56:18 2023 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 3 23:07:48 2023 +0100

lok: adjust paint rect for in-place editing

This allows to send correct cursor position (at the very end
of the cell) when typing numbers in LOK mode.

This fixes regression from:
commit  9257486636dfe95b73e5690462ba6e8408a12166
lok: sc: render expanded EditEngine when editing in-place

Change-Id: I1f6c7ce3de7a2ba7ccbd4f9f9becd49e352cf05e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145260
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145769
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 07265d4cf23e..5b41a6227b54 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1176,7 +1176,9 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 // Get top-left offset because of margin and 
indent.
 lcl_GetEditAreaTLOffset(nOffsetX, nOffsetY, 
ScAddress(nCol1, nRow1, nTab), mrViewData, rDoc);
 aEditRect.AdjustLeft(nOffsetX + 1);
+aEditRect.AdjustRight(1);
 aEditRect.AdjustTop(nOffsetY + 1);
+aEditRect.AdjustBottom(1);
 
 // EditView has an 'output area' which is used to 
clip the 'paint area' we provide below.
 // So they need to be in the same 
coordinates/units. This is tied to the mapmode of the gridwin
@@ -1308,13 +1310,6 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 // paint the editeng text
 if (bIsTiledRendering)
 {
-tools::Rectangle aEditRect(aBackground);
-tools::Long nOffsetX = 0, nOffsetY = 0;
-// Get top-left offset because of margin and indent.
-lcl_GetEditAreaTLOffset(nOffsetX, nOffsetY, ScAddress(nCol1, 
nRow1, mrViewData.GetTabNo()), mrViewData, rDoc);
-aEditRect.AdjustLeft(nOffsetX + 1);
-aEditRect.AdjustTop(nOffsetY + 1);
-
 // EditView has an 'output area' which is used to clip the paint 
area we provide below.
 // So they need to be in the same coordinates/units. This is tied 
to the mapmode of the gridwin
 // attached to the EditView, so we have to change its mapmode too 
(temporarily). We save the
commit e68742c703fb76bede14d8c93d1f21967bf2d770
Author: Szymon Kłos 
AuthorDate: Wed Jan 4 15:28:34 2023 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 3 23:06:49 2023 +0100

jsdialog: don't export collapsed/expanded icons when empty

Change-Id: Iec56c11fdba066f9b62b2d5d56ad011a821e4087
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145040
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145066
Tested-by: Jenkins

diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index f766cde70559..9ef0e145ed6d 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -75,9 +75,16 @@ static void lcl_DumpEntryAndSiblings(tools::JsonWriter& 
rJsonWriter,
 const SvLBoxContextBmp* pBmpItem = dynamic_cast(&rItem);
 if (pBmpItem)
 {
-auto aColumn = rJsonWriter.startStruct();
-rJsonWriter.put("collapsed", 
pBmpItem->GetBitmap1().GetStock());
-rJsonWriter.put("expanded", 
pBmpItem->GetBitmap2().GetStock());
+const OUString& rCollapsed = 
pBmpItem->GetBitmap1().GetStock();
+const OUString& rExpanded = 
pBmpItem->GetBitmap2().GetStock();
+if (!rCollapsed.trim().isEmpty() || 
!rExpanded.trim().isEmpty())
+{
+auto aColumn = rJsonWriter.startStruct();
+if (!rCollapsed.trim().isEmpty())
+rJsonWriter.put("collapsed", rCollapsed);
+if (!rExpanded.trim().isEmpty())
+rJsonWriter.put("expanded", rExpanded);
+}
 }
   

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

2023-02-03 Thread Gülşah Köse (via logerrit)
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 1aa01d562118a78a3e183e35a619b5fe1a9268cf
Author: Gülşah Köse 
AuthorDate: Thu Jan 19 18:10:11 2023 +0300
Commit: Andras Timar 
CommitDate: Fri Feb 3 23:29:39 2023 +0100

Hide fill Attribute widget if fill style is none

When Fill style is none we can not use fill attribute element. So It is
better to hide.

Change-Id: I88d5e49448040b3afa18fbf66377d254716e7415
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145817
Tested-by: Jenkins
Tested-by: Pedro Silva 
Reviewed-by: Pedro Silva 
Reviewed-by: Mike Kaganski 

diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 996026d1fa6c..220e3f04b829 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -876,8 +876,7 @@ void AreaPropertyPanelBase::updateFillStyle(bool bDisabled, 
bool bDefaultOrSet,
 default:
 case drawing::FillStyle_NONE:
 {
-mxLbFillAttr->set_active(-1);
-mxLbFillAttr->set_sensitive(false);
+mxLbFillAttr->hide();
 // "Use slide background" also uses FillStyle_NONE internally,
 // don't switch listbox in that case (will be handled by 
updateFillUseBackground)
 nPos = meLastXFS == USE_BACKGROUND ? USE_BACKGROUND : NONE;


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

2023-02-03 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx   |4 ++--
 sw/source/core/doc/textboxhelper.cxx |1 -
 sw/source/filter/ww8/docxattributeoutput.cxx |4 +++-
 writerfilter/qa/cppunittests/dmapper/SdtHelper.cxx   |2 +-
 writerfilter/qa/cppunittests/dmapper/data/sdt-run-rich-text.docx |binary
 5 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 69a2c20b65347341f85e1d24c9de84b3b7e53089
Author: Mike Kaganski 
AuthorDate: Tue Jan 31 11:57:38 2023 +0300
Commit: Andras Timar 
CommitDate: Fri Feb 3 23:30:52 2023 +0100

tdf#153289: remove problematic assertion

It is unclear what it should guarantee; but at least when ungrouping,
SwDoc::UnGroupSelection copy-constructs a shared pointer (increasing
the refcount), then a copy-constructed argument passed to
lcl_CollectTextBoxesForSubGroupObj increases it once again, and then
the assertion expectedly fails.

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

diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index f253502e56a6..98fc0512acfd 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -1795,7 +1795,6 @@ SwFrameFormat* SwTextBoxNode::GetTextBox(const SdrObject* 
pDrawObject) const
 if (size_t(pTextBoxes.use_count()) != pTextBoxes->GetTextBoxCount() + 
size_t(1))
 {
 SAL_WARN("sw.core", "SwTextBoxNode::GetTextBox(): RefCount and 
TexBox count mismatch!");
-assert(false);
 }
 }
 
commit 82a937df8142da69f652e47c183b5dff1f82bc35
Author: Justin Luth 
AuthorDate: Wed Jan 25 16:29:55 2023 -0500
Commit: Andras Timar 
CommitDate: Fri Feb 3 23:30:33 2023 +0100

tdf#151548 sw content controls: preserve tabIndex val="-1"

Either we have to read sal_uInt32
(which I can't figure out how to do)
or else we have to write it out as sal_Int32.

Microsoft isn't much help here because their documentation
does not give any example of a non-tabsltop,
and one errata document indicates that MS Word
simply ignores tabIndex altogether for Sdt (and ffData).

According to the documentation,
tabIndex is a CT_UnsignedDecimalNumber
which we do not have in our model.xml
so it was defined as being a CT_DecimalNumber
which works fine for reading something human sensible like -1.

However, in our exporting we were exporting a sal_uInt32
which creates large, all positive numbers
which were not being read on import.
Nothing I tried worked to read these large numbers.
Perhaps it is even illegal to do so in MS formats?

Since it doesn't seem to matter to MS Word,
and for a human it is easier to understand -1,
and it is easier to solve in export than import,
I'm taking the easy road.

Change-Id: I6b296703c9a37149d9e11f29901e6db32bd041b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146149
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index a04a7813f9c6..bfc09d934343 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -426,7 +426,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateContentControlExport)
 xContentControlProps->setPropertyValue("Alias", 
uno::Any(OUString("myalias")));
 xContentControlProps->setPropertyValue("Tag", uno::Any(OUString("mytag")));
 xContentControlProps->setPropertyValue("Id", 
uno::Any(static_cast(123)));
-xContentControlProps->setPropertyValue("TabIndex", 
uno::Any(sal_uInt32(2)));
+xContentControlProps->setPropertyValue("TabIndex", 
uno::Any(sal_uInt32(4294967295))); // -1
 xContentControlProps->setPropertyValue("Lock", 
uno::Any(OUString("sdtLocked")));
 
 xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true);
@@ -453,7 +453,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateContentControlExport)
 assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:alias", "val", "myalias");
 assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tag", "val", "mytag");
 assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:id", "val", "123");
-assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tabIndex", "val", "2");
+assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tabIndex", "val", "-1");
 assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:lock", "val", "sdtLocked");
 }
 
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 03b73dbaee84..b361e5b171a0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2441,8 +2441,10 @@ void DocxAttributeOutput::WriteContentControlStart()

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 14 commits - cui/uiconfig helpcontent2 include/svl oox/qa oox/source sc/source svl/source sw/source ucb/source vcl/qt5 vcl/source v

2023-02-03 Thread Laurent Balland (via logerrit)
 cui/uiconfig/ui/qrcodegen.ui |1 
 helpcontent2 |2 
 include/svl/zformat.hxx  |3 
 oox/qa/unit/data/tdf153258_VML_import_WordArt_detection.docx |binary
 oox/qa/unit/vml.cxx  |   18 
 oox/source/vml/vmlshape.cxx  |7 
 sc/source/ui/app/inputwin.cxx|9 
 sc/source/ui/inc/inputwin.hxx|2 
 svl/source/numbers/zforlist.cxx  |   85 -
 svl/source/numbers/zformat.cxx   |   20 
 sw/source/core/doc/docedt.cxx|4 
 sw/source/core/unocore/unosrch.cxx   |   18 
 sw/source/filter/ww8/docxattributeoutput.cxx |   17 
 sw/source/uibase/inc/conttree.hxx|5 
 sw/source/uibase/utlui/content.cxx   |  670 +--
 ucb/source/ucp/webdav-curl/CurlSession.cxx   |   24 
 ucb/source/ucp/webdav-curl/DAVException.hxx  |1 
 vcl/qt5/QtGraphics_Controls.cxx  |1 
 vcl/source/control/PriorityMergedHBox.cxx|6 
 vcl/unx/gtk3/gtkframe.cxx|   10 
 vcl/win/window/salframe.cxx  |4 
 21 files changed, 510 insertions(+), 397 deletions(-)

New commits:
commit ae928386ece4708236038f0d14f0870c4ef01bf6
Author: Laurent Balland 
AuthorDate: Mon Jan 2 18:39:35 2023 +0100
Commit: Andras Timar 
CommitDate: Fri Feb 3 23:33:12 2023 +0100

tdf#152722 Number Format: keep NatNum modifiers

When modifying number format with UI (decimal places, negative in red...) 
NatNum modifiers must be preserved
Implement an helper to get NatNum string
As NatNum12 already inserts currency unit, do not treat it

Change-Id: I38be1da08a44d75ef663eaf50fccb3820ff9ed5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144963
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 8ba7657a9653f8ae5d1b865356d11138df7b2093)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146406

diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 43f6ad9775f4..ea08234e93a2 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -459,6 +459,9 @@ public:
 void GetNatNumXml(
 css::i18n::NativeNumberXmlAttributes2& rAttr,
 sal_uInt16 nNumFor ) const;
+/** Return empty string if no NatNum modifier or unvalid nNumFor
+otherwhise return "[NatNum1]" or "[NatNum12 ...]" */
+OUString GetNatNumModifierString( sal_uInt16 nNumFor = 0 ) const;
 
 /** Switches to the first non-"gregorian" calendar, but only if the current
 calendar is "gregorian"; original calendar name and date/time returned,
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index cee75fc9265e..ca8b6524b9e2 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -3231,6 +3231,15 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 
nIndex,
 sString.append(GetNumDecimalSep());
 padToLength(sString, sString.getLength() + nPrecision, '0');
 }
+
+// Native Number
+const OUString sPosNatNumModifier = pFormat ? 
pFormat->GetNatNumModifierString( 0 ) : "";
+const OUString sNegNatNumModifier = pFormat ?
+// if a negative format already exists, use its NatNum modifier
+// else use NatNum modifier of positive format
+( pFormat->GetNumForString( 1, 0 )  ? 
pFormat->GetNatNumModifierString( 1 ) : sPosNatNumModifier )
+: "";
+
 if (eType == SvNumFormatType::PERCENT)
 {
 sString.append( pFormat->GetPercentString() );
@@ -3254,50 +3263,62 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 
nIndex,
 OUString aCurr;
 const NfCurrencyEntry* pEntry;
 bool bBank;
-if ( GetNewCurrencySymbolString( nIndex, aCurr, &pEntry, &bBank ) )
+bool isPosNatNum12 = sPosNatNumModifier.startsWith( "[NatNum12" );
+bool isNegNatNum12 = sNegNatNumModifier.startsWith( "[NatNum12" );
+if ( !isPosNatNum12 || !isNegNatNum12 )
 {
-if ( pEntry )
+if ( GetNewCurrencySymbolString( nIndex, aCurr, &pEntry, &bBank ) )
 {
-sal_uInt16 nPosiForm = 
NfCurrencyEntry::GetEffectivePositiveFormat(
-xLocaleData->getCurrPositiveFormat(),
-pEntry->GetPositiveFormat(), bBank );
-sal_uInt16 nNegaForm = 
NfCurrencyEntry::GetEffectiveNegativeFormat(
-xLocaleData->getCurrNegativeFormat(),
-pEntry->GetNegativeFormat(), bBank );
-pEntry->CompletePosi

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

2023-02-03 Thread Aron Budea (via logerrit)
 vcl/source/window/window2.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit d4c99f07ed4a795519797f56be29c24a242f4db2
Author: Aron Budea 
AuthorDate: Thu Feb 2 00:08:41 2023 +0100
Commit: Andras Timar 
CommitDate: Sat Feb 4 06:18:30 2023 +

vcl: fix online crash in vcl::Window::IsTracking()

Crashreport signature:

program/libmergedlo.so
vcl::Window::IsTracking() const
vcl/source/window/window2.cxx:340
program/libmergedlo.so
(anonymous namespace)::LOKPostAsyncEvent(void*, void*)
sfx2/source/view/lokhelper.cxx:812
program/libmergedlo.so
LokChartHelper::postMouseEvent(int, int, int, int, int, int, 
double, double)
include/rtl/ref.hxx:128
program/libmergedlo.so
SfxLokHelper::testInPlaceComponentMouseEventHit(SfxViewShell*, int, 
int, int, int, int, int, double, double, bool)
sfx2/source/view/lokhelper.cxx:980
/program/libswlo.so
SwXTextDocument::postMouseEvent(int, int, int, int, int, int)
sw/source/uibase/uno/unotxdoc.cxx:3663
program/libmergedlo.so
doc_postMouseEvent
desktop/source/lib/init.cxx:4831

Change-Id: Iab7d24a901e57dc8af3fb2c77fbea3b4fdad9fb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146483
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146549
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 87db8e470e21..180edf5cf961 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -341,9 +341,15 @@ bool Window::IsTracking() const
 {
 if (!mpWindowImpl)
 return false;
-return (mpWindowImpl->mbUseFrameData ?
-mpWindowImpl->mpFrameData->mpTrackWin == this :
-ImplGetSVData()->mpWinData->mpTrackWin == this);
+if (mpWindowImpl->mbUseFrameData && mpWindowImpl->mpFrameData)
+{
+return mpWindowImpl->mpFrameData->mpTrackWin == this;
+}
+if (!mpWindowImpl->mbUseFrameData && ImplGetSVData()->mpWinData)
+{
+return ImplGetSVData()->mpWinData->mpTrackWin == this;
+}
+return false;
 }
 
 void Window::StartAutoScroll( StartAutoScrollFlags nFlags )
commit cb44dab0784476a2be0708e801696f47486aa3a2
Author: Noel Grandin 
AuthorDate: Fri Jan 27 08:50:04 2023 +0200
Commit: Andras Timar 
CommitDate: Sat Feb 4 06:18:21 2023 +

fix online crash in WIndow::IsTracking

/opt/collaboraoffice/program/libmergedlo.so
  vcl::Window::IsTracking() const
  
/home/collabora/jenkins/workspace/build_core_co-22.05_for_online_snapshot/vcl/source/window/window2.cxx:340
/opt/collaboraoffice/program/libmergedlo.so
  (anonymous namespace)::LOKPostAsyncEvent(void*, void*)
  
/home/collabora/jenkins/workspace/build_core_co-22.05_for_online_snapshot/sfx2/source/view/lokhelper.cxx:812
/opt/collaboraoffice/program/libmergedlo.so
  LokChartHelper::postMouseEvent(int, int, int, int, int, int, double, 
double)
  
/home/collabora/jenkins/workspace/build_core_co-22.05_for_online_snapshot/include/rtl/ref.hxx:128

Change-Id: I204bac7d8f595054abe9b6e8e631c02b26e20361
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146231
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Noel Grandin 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146548
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 978dc0b6ecf8..87db8e470e21 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -339,6 +339,8 @@ void Window::EndTracking( TrackingEventFlags nFlags )
 
 bool Window::IsTracking() const
 {
+if (!mpWindowImpl)
+return false;
 return (mpWindowImpl->mbUseFrameData ?
 mpWindowImpl->mpFrameData->mpTrackWin == this :
 ImplGetSVData()->mpWinData->mpTrackWin == this);


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

2023-02-03 Thread Caolán McNamara (via logerrit)
 sc/source/ui/app/inputwin.cxx |   27 ---
 sc/source/ui/inc/inputwin.hxx |2 ++
 2 files changed, 22 insertions(+), 7 deletions(-)

New commits:
commit 462bbf692e41897552b4f4e1f9e4f033e5f76643
Author: Caolán McNamara 
AuthorDate: Fri Feb 3 16:18:35 2023 +
Commit: Caolán McNamara 
CommitDate: Sat Feb 4 07:38:17 2023 +

Resolves: tdf#153353 formula bar border area bg didn't change on theme 
change

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

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 7b9e208aec14..a9b5a54367b9 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -853,14 +853,8 @@ ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, 
ScTabViewShell* pViewSh)
 {
 InitControlBase(m_xContainer.get());
 
-const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
-
 SetPaintTransparent(false);
-SetBackground(rStyleSettings.GetFaceColor());
-
-// match to bg used in ScTextWnd::SetDrawingArea to the margin area is 
drawn with the
-// same desired bg
-mxBackground->set_background(rStyleSettings.GetWindowColor());
+SetBackgrounds();
 
 mxButtonUp->connect_clicked(LINK(this, ScInputBarGroup, ClickHdl));
 mxButtonDown->connect_clicked(LINK(this, ScInputBarGroup, ClickHdl));
@@ -881,6 +875,25 @@ ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, 
ScTabViewShell* pViewSh)
 mxButtonDown->show();
 }
 
+void ScInputBarGroup::SetBackgrounds()
+{
+const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
+SetBackground(rStyleSettings.GetFaceColor());
+// match to bg used in ScTextWnd::SetDrawingArea to the margin area is 
drawn with the
+// same desired bg
+mxBackground->set_background(rStyleSettings.GetWindowColor());
+}
+
+void ScInputBarGroup::DataChanged(const DataChangedEvent& rDCEvt)
+{
+InterimItemWindow::DataChanged(rDCEvt);
+if ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) && 
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE))
+{
+SetBackgrounds();
+Invalidate();
+}
+}
+
 Point ScInputBarGroup::GetCursorScreenPixelPos(bool bBelow)
 {
 return mxTextWndGroup->GetCursorScreenPixelPos(bBelow);
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index ac96062af137..e8e63855ffd6 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -252,6 +252,7 @@ public:
 virtual boolHasEditView() const override;
 Point   GetCursorScreenPixelPos(bool bBelowLine);
 virtual voidResize() override;
+virtual voidDataChanged(const DataChangedEvent& rDCEvt) 
override;
 virtual const OUString& GetTextString() const override;
 virtual voidStopEditEngine(bool bAll) override;
 virtual voidTextGrabFocus() override;
@@ -272,6 +273,7 @@ public:
 
 private:
 voidTriggerToolboxLayout();
+voidSetBackgrounds();
 
 std::unique_ptr mxBackground;
 std::unique_ptr mxTextWndGroup;