core.git: sd/inc sd/source

2024-03-11 Thread Baole Fang (via logerrit)
 sd/inc/strings.hrc|1 +
 sd/source/ui/framework/factories/BasicPaneFactory.cxx |3 ++-
 sd/source/ui/framework/factories/FullScreenPane.cxx   |   14 ++
 sd/source/ui/framework/factories/FullScreenPane.hxx   |9 +++--
 4 files changed, 20 insertions(+), 7 deletions(-)

New commits:
commit 1999e2b35c8106fa959f04bbd381ddb49d257a1d
Author: Baole Fang 
AuthorDate: Wed Mar 6 20:00:27 2024 -0500
Commit: Thorsten Behrens 
CommitDate: Mon Mar 11 22:55:44 2024 +0100

tdf#158152: Make presenter console to "Console: file"

Add a new parameter pDrawDocShell to FullScreenPane to extract filename.
A new string STR_FULLSCREEN_CONSOLE is added for presenter console.
Now, the presenter console's title becomes "Console: file".

Change-Id: Ic18d00044dde602dd92210600e3c5311b46500b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164515
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 2522768a6a7b..3ff7cac89795 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -155,6 +155,7 @@
 #define STR_EFFECTDLG_PROGRAM   
NC_("STR_EFFECTDLG_PROGRAM", "Program")
 #define STR_EFFECTDLG_MACRO 
NC_("STR_EFFECTDLG_MACRO", "Macro")
 #define STR_FULLSCREEN_SLIDESHOW
NC_("STR_FULLSCREEN_SLIDESHOW", "Presenting: %s")
+#define STR_FULLSCREEN_CONSOLE  
NC_("STR_FULLSCREEN_CONSOLE", "Console: %s")
 
 // To translators: this is the spinbutton in the slidesorter toolbar to set 
the number of slides to show per row
 #define STR_SLIDES  NNC_("STR_SLIDES", "%1 
slide", "%1 slides")
diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx 
b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index e112ac4c315a..4ce694a2e7df 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -345,7 +345,8 @@ Reference BasicPaneFactory::CreateFullScreenPane 
(
 new FullScreenPane(
 rxComponentContext,
 rxPaneId,
-mpViewShellBase->GetViewWindow()));
+mpViewShellBase->GetViewWindow(),
+mpViewShellBase->GetDocShell()));
 
 return xPane;
 }
diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx 
b/sd/source/ui/framework/factories/FullScreenPane.cxx
index 39da06144c09..202032b3d6f9 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -26,6 +26,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -36,7 +39,8 @@ namespace sd::framework {
 FullScreenPane::FullScreenPane (
 const Reference& rxComponentContext,
 const Reference& rxPaneId,
-const vcl::Window* pViewShellWindow)
+const vcl::Window* pViewShellWindow,
+const DrawDocShell* pDrawDocShell)
 : FrameWindowPane(rxPaneId,nullptr),
   mxComponentContext(rxComponentContext)
 {
@@ -76,10 +80,12 @@ FullScreenPane::FullScreenPane (
 
 // Set title and icon of the new window to those of the current window
 // of the view shell.
-if (pViewShellWindow != nullptr)
+if (pViewShellWindow != nullptr && pDrawDocShell != nullptr)
 {
-const SystemWindow* pSystemWindow = 
pViewShellWindow->GetSystemWindow();
-mpWorkWindow->SetText(pSystemWindow->GetText());
+SystemWindow* pSystemWindow = pViewShellWindow->GetSystemWindow();
+OUString Title(SdResId(STR_FULLSCREEN_CONSOLE));
+Title = Title.replaceFirst("%s", 
pDrawDocShell->GetTitle(SFX_TITLE_DETECT));
+mpWorkWindow->SetText(Title);
 mpWorkWindow->SetIcon(pSystemWindow->GetIcon());
 }
 
diff --git a/sd/source/ui/framework/factories/FullScreenPane.hxx 
b/sd/source/ui/framework/factories/FullScreenPane.hxx
index 138503d02f1a..fb5838d9eccd 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.hxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.hxx
@@ -27,6 +27,7 @@ class VclWindowEvent;
 
 namespace vcl { class Window; }
 namespace com::sun::star::uno { class XComponentContext; }
+namespace sd { class DrawDocShell; }
 
 namespace sd::framework {
 
@@ -43,13 +44,17 @@ public:
 @param rxPaneId
 The resource id of the new pane.
 @param pViewShellWindow
-The top-level parent of this window is used to obtain title and
+The top-level parent of this window is used to obtain
 icon for the new top-level window.
+@param pDrawDocShell
+The DrawDocShell parent of this window is used to obtain
+title for the new top-level window.
 */
 FullScreenPane (
 const css::uno::Reference& 
rxComponentContext,
 const 

core.git: Branch 'libreoffice-24-2-1' - sw/source

2024-02-21 Thread Baole Fang (via logerrit)
 sw/source/ui/fldui/flddok.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 613135cef0b6b2cc9d01d9a7126fb6707fd473f0
Author: Baole Fang 
AuthorDate: Wed Feb 14 20:00:48 2024 -0500
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Feb 21 09:41:30 2024 +0100

tdf#159678: Fix heading dropdown list

Change-Id: I65b6e6e5484f26b27e7851a6615550f527fcfb06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163416
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 694b9b6422ee27da13ad455174cde50b1a673ac7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163406
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit 9d48831793cdbf93975b71083fbcc9577c17fceb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163617
Reviewed-by: Xisco Fauli 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index 1a2857bedbdd..5cb38a38aca9 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -601,7 +601,7 @@ bool SwFieldDokPage::FillItemSet(SfxItemSet* )
 }
 
 case SwFieldTypesEnum::Chapter:
-aVal = OUString::number(m_xLevelED->get_active());
+aVal = m_xLevelED->get_active_text();
 break;
 
 default:


core.git: Branch 'libreoffice-24-2' - sw/source

2024-02-20 Thread Baole Fang (via logerrit)
 sw/source/ui/fldui/flddok.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9d48831793cdbf93975b71083fbcc9577c17fceb
Author: Baole Fang 
AuthorDate: Wed Feb 14 20:00:48 2024 -0500
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Feb 20 22:13:08 2024 +0100

tdf#159678: Fix heading dropdown list

Change-Id: I65b6e6e5484f26b27e7851a6615550f527fcfb06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163416
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 694b9b6422ee27da13ad455174cde50b1a673ac7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163406
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index 1a2857bedbdd..5cb38a38aca9 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -601,7 +601,7 @@ bool SwFieldDokPage::FillItemSet(SfxItemSet* )
 }
 
 case SwFieldTypesEnum::Chapter:
-aVal = OUString::number(m_xLevelED->get_active());
+aVal = m_xLevelED->get_active_text();
 break;
 
 default:


core.git: sw/source

2024-02-15 Thread Baole Fang (via logerrit)
 sw/source/ui/fldui/flddok.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 694b9b6422ee27da13ad455174cde50b1a673ac7
Author: Baole Fang 
AuthorDate: Wed Feb 14 20:00:48 2024 -0500
Commit: Mike Kaganski 
CommitDate: Fri Feb 16 05:13:02 2024 +0100

tdf#159678: Fix heading dropdown list

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

diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index 1a2857bedbdd..5cb38a38aca9 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -601,7 +601,7 @@ bool SwFieldDokPage::FillItemSet(SfxItemSet* )
 }
 
 case SwFieldTypesEnum::Chapter:
-aVal = OUString::number(m_xLevelED->get_active());
+aVal = m_xLevelED->get_active_text();
 break;
 
 default:


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

2023-10-24 Thread Baole Fang (via logerrit)
 sw/source/ui/fldui/flddok.cxx |   11 +++
 sw/source/ui/fldui/flddok.hxx |2 +-
 sw/uiconfig/swriter/ui/flddocumentpage.ui |   11 +--
 3 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 27fde46937ecb71e7ce738cba430119a79cea77f
Author: Baole Fang 
AuthorDate: Sat Oct 21 01:13:59 2023 -0400
Commit: Heiko Tietze 
CommitDate: Tue Oct 24 09:10:13 2023 +0200

tdf#154052: Change "Level" spinbox to combobox

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

diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index a195ed026ec0..1a2857bedbdd 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -42,7 +42,7 @@ SwFieldDokPage::SwFieldDokPage(weld::Container* pPage, 
weld::DialogController* p
 , m_xValueFT(m_xBuilder->weld_label("valueft"))
 , m_xValueED(m_xBuilder->weld_entry("value"))
 , m_xLevelFT(m_xBuilder->weld_label("levelft"))
-, m_xLevelED(m_xBuilder->weld_spin_button("level"))
+, m_xLevelED(m_xBuilder->weld_combo_box("level"))
 , m_xDateFT(m_xBuilder->weld_label("daysft"))
 , m_xTimeFT(m_xBuilder->weld_label("minutesft"))
 , m_xDateOffsetED(m_xBuilder->weld_spin_button("offset"))
@@ -65,7 +65,10 @@ SwFieldDokPage::SwFieldDokPage(weld::Container* pPage, 
weld::DialogController* p
 m_xFormatLB->connect_row_activated(LINK(this, SwFieldDokPage, 
TreeViewInsertHdl));
 m_xNumFormatLB->connect_row_activated(LINK(this, SwFieldDokPage, 
NumFormatHdl));
 
-m_xLevelED->set_max(MAXLEVEL);
+for (sal_uInt16 i = 1; i <= MAXLEVEL; i++)
+m_xLevelED->append_text(OUString::number(i));
+
+m_xLevelED->set_active(0);
 m_xDateOffsetED->set_range(INT_MIN, INT_MAX);
 //enable 'active' language selection
 m_xNumFormatLB->SetShowLanguageControl(true);
@@ -356,7 +359,7 @@ IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl, weld::TreeView&, 
void)
 case SwFieldTypesEnum::Chapter:
 m_xValueFT->set_label(SwResId(STR_LEVEL));
 if (IsFieldEdit())
-
m_xLevelED->set_text(OUString::number(static_cast(GetCurField())->GetLevel(GetWrtShell()->GetLayout())
 + 1));
+
m_xLevelED->set_active(static_cast(GetCurField())->GetLevel(GetWrtShell()->GetLayout()));
 bLevel = true;
 break;
 
@@ -598,7 +601,7 @@ bool SwFieldDokPage::FillItemSet(SfxItemSet* )
 }
 
 case SwFieldTypesEnum::Chapter:
-aVal = m_xLevelED->get_text();
+aVal = OUString::number(m_xLevelED->get_active());
 break;
 
 default:
diff --git a/sw/source/ui/fldui/flddok.hxx b/sw/source/ui/fldui/flddok.hxx
index b532b06f01f6..3192ecc0c6c2 100644
--- a/sw/source/ui/fldui/flddok.hxx
+++ b/sw/source/ui/fldui/flddok.hxx
@@ -35,7 +35,7 @@ class SwFieldDokPage : public SwFieldPage
 std::unique_ptr m_xValueFT;
 std::unique_ptr m_xValueED;
 std::unique_ptr m_xLevelFT;
-std::unique_ptr m_xLevelED;
+std::unique_ptr m_xLevelED;
 std::unique_ptr m_xDateFT;
 std::unique_ptr m_xTimeFT;
 std::unique_ptr m_xDateOffsetED;
diff --git a/sw/uiconfig/swriter/ui/flddocumentpage.ui 
b/sw/uiconfig/swriter/ui/flddocumentpage.ui
index 6849333aabd3..75fca470e644 100644
--- a/sw/uiconfig/swriter/ui/flddocumentpage.ui
+++ b/sw/uiconfig/swriter/ui/flddocumentpage.ui
@@ -2,13 +2,6 @@
 
 
   
-  
-1
-10
-1
-1
-10
-  
   
 100
 1
@@ -356,11 +349,9 @@
   
 
 
-  
+  
 True
 True
-adjustment1
-True
 Select the first prior heading for 
display whose outline level is less than or equal to the specified 
value.
 
   


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6-0' - editeng/source officecfg/registry sw/qa

2023-08-03 Thread Baole Fang (via logerrit)
 editeng/source/misc/swafopt.cxx|2 
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |2 
 sw/qa/uitest/data/tdf156165.odt|binary
 sw/qa/uitest/writer_tests/tdf156165.py |   80 +
 4 files changed, 82 insertions(+), 2 deletions(-)

New commits:
commit 4ea3099dba3d0f7d1f09b31f204223449bfbbc51
Author: Baole Fang 
AuthorDate: Thu Jul 6 12:03:31 2023 -0400
Commit: Thorsten Behrens 
CommitDate: Thu Aug 3 13:39:13 2023 +0200

tdf#156165: Fix replace custom styles while typing

Originally, Replace Custom Styles changes styles to text body by entering 
BuiltText. Since styles change to text body is removed from BuiltTest, it is 
converted independently.

Now, conversion is applied even during typing because m_aFlags.bChgUserColl 
is true (its default value) during typing. Therefore, its default value is 
changed to false.

Change-Id: I8ce067b311922b5e1bdcd84036229c369b50a977
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154144
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit e26aeb882dd236adf19679d5df9b7ba5da1ed226)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155043
Reviewed-by: Thorsten Behrens 
(cherry picked from commit e50ec4d8ddca5dfe6a4f329298c0bae4edc5e41c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155188
Reviewed-by: Ilmari Lauhakangas 
Reviewed-by: Patrick Luby 
Tested-by: Thorsten Behrens 

diff --git a/editeng/source/misc/swafopt.cxx b/editeng/source/misc/swafopt.cxx
index f6de4098d2e4..f5f79a45be97 100644
--- a/editeng/source/misc/swafopt.cxx
+++ b/editeng/source/misc/swafopt.cxx
@@ -27,7 +27,6 @@ SvxSwAutoFormatFlags::SvxSwAutoFormatFlags()
 bAutoCorrect =
 bCapitalStartSentence =
 bCapitalStartWord =
-bChgUserColl =
 bChgEnumNum =
 bAddNonBrkSpace =
 bChgOrdinalNumber =
@@ -42,6 +41,7 @@ SvxSwAutoFormatFlags::SvxSwAutoFormatFlags()
 bAFormatByInpDelSpacesAtSttEnd =
 bAFormatByInpDelSpacesBetweenLines = true;
 
+bChgUserColl =
 bReplaceStyles =
 bDelEmptyNode =
 bWithRedlining =
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 0f684bb2eea9..cfa36e974ca8 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -4235,7 +4235,7 @@
   Specifies whether user-defined styles applied in the 
document are replaced by predefined text document styles.
   Replace user-defined styles
 
-true
+false
   
   
 
diff --git a/sw/qa/uitest/data/tdf156165.odt b/sw/qa/uitest/data/tdf156165.odt
new file mode 100644
index ..aabcfef91499
Binary files /dev/null and b/sw/qa/uitest/data/tdf156165.odt differ
diff --git a/sw/qa/uitest/writer_tests/tdf156165.py 
b/sw/qa/uitest/writer_tests/tdf156165.py
new file mode 100644
index ..69d1928bb8ce
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/tdf156165.py
@@ -0,0 +1,80 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from uitest.uihelper.common import select_pos
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from time import sleep
+
+class tdf156165(UITestCase):
+
+   def test_tdf156165(self):
+with self.ui_test.load_file(get_url_for_data_file("tdf156165.odt")):
+xMainWindow = self.xUITest.getTopFocusWindow()
+writer_edit = xMainWindow.getChild("writer_edit")
+style=xMainWindow.getChild('applystyle')
+
+with 
self.ui_test.execute_dialog_through_command(".uno:AutoCorrectDlg") as xDialog:
+xTabs = xDialog.getChild("tabcontrol")
+select_pos(xTabs, "2")
+options=xDialog.getChild('list')
+checkbox=options.getChild("16")
+self.assertEqual("Replace Custom Styles", 
get_state_as_dict(checkbox)["Text"])
+
+# Replace Custom Styles is default to be false
+self.assertEqual("false", 
get_state_as_dict(checkbox)["IsChecked"])
+
+# Replace Custom Styles when applying manully with it disabled, 
should not change style
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"0", "START_POS": "12"}))
+self.xUITest.executeCommand(".uno:AutoFormatApply")
+sleep(1)
+

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - editeng/source officecfg/registry sw/qa

2023-08-01 Thread Baole Fang (via logerrit)
 editeng/source/misc/swafopt.cxx|2 
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |2 
 sw/qa/uitest/data/tdf156165.odt|binary
 sw/qa/uitest/writer_tests/tdf156165.py |   80 +
 4 files changed, 82 insertions(+), 2 deletions(-)

New commits:
commit e50ec4d8ddca5dfe6a4f329298c0bae4edc5e41c
Author: Baole Fang 
AuthorDate: Thu Jul 6 12:03:31 2023 -0400
Commit: Thorsten Behrens 
CommitDate: Wed Aug 2 00:36:44 2023 +0200

tdf#156165: Fix replace custom styles while typing

Originally, Replace Custom Styles changes styles to text body by entering 
BuiltText. Since styles change to text body is removed from BuiltTest, it is 
converted independently.

Now, conversion is applied even during typing because m_aFlags.bChgUserColl 
is true (its default value) during typing. Therefore, its default value is 
changed to false.

Change-Id: I8ce067b311922b5e1bdcd84036229c369b50a977
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154144
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit e26aeb882dd236adf19679d5df9b7ba5da1ed226)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155043
Reviewed-by: Thorsten Behrens 

diff --git a/editeng/source/misc/swafopt.cxx b/editeng/source/misc/swafopt.cxx
index f6de4098d2e4..f5f79a45be97 100644
--- a/editeng/source/misc/swafopt.cxx
+++ b/editeng/source/misc/swafopt.cxx
@@ -27,7 +27,6 @@ SvxSwAutoFormatFlags::SvxSwAutoFormatFlags()
 bAutoCorrect =
 bCapitalStartSentence =
 bCapitalStartWord =
-bChgUserColl =
 bChgEnumNum =
 bAddNonBrkSpace =
 bChgOrdinalNumber =
@@ -42,6 +41,7 @@ SvxSwAutoFormatFlags::SvxSwAutoFormatFlags()
 bAFormatByInpDelSpacesAtSttEnd =
 bAFormatByInpDelSpacesBetweenLines = true;
 
+bChgUserColl =
 bReplaceStyles =
 bDelEmptyNode =
 bWithRedlining =
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 0f684bb2eea9..cfa36e974ca8 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -4235,7 +4235,7 @@
   Specifies whether user-defined styles applied in the 
document are replaced by predefined text document styles.
   Replace user-defined styles
 
-true
+false
   
   
 
diff --git a/sw/qa/uitest/data/tdf156165.odt b/sw/qa/uitest/data/tdf156165.odt
new file mode 100644
index ..aabcfef91499
Binary files /dev/null and b/sw/qa/uitest/data/tdf156165.odt differ
diff --git a/sw/qa/uitest/writer_tests/tdf156165.py 
b/sw/qa/uitest/writer_tests/tdf156165.py
new file mode 100644
index ..69d1928bb8ce
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/tdf156165.py
@@ -0,0 +1,80 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from uitest.uihelper.common import select_pos
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from time import sleep
+
+class tdf156165(UITestCase):
+
+   def test_tdf156165(self):
+with self.ui_test.load_file(get_url_for_data_file("tdf156165.odt")):
+xMainWindow = self.xUITest.getTopFocusWindow()
+writer_edit = xMainWindow.getChild("writer_edit")
+style=xMainWindow.getChild('applystyle')
+
+with 
self.ui_test.execute_dialog_through_command(".uno:AutoCorrectDlg") as xDialog:
+xTabs = xDialog.getChild("tabcontrol")
+select_pos(xTabs, "2")
+options=xDialog.getChild('list')
+checkbox=options.getChild("16")
+self.assertEqual("Replace Custom Styles", 
get_state_as_dict(checkbox)["Text"])
+
+# Replace Custom Styles is default to be false
+self.assertEqual("false", 
get_state_as_dict(checkbox)["IsChecked"])
+
+# Replace Custom Styles when applying manully with it disabled, 
should not change style
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"0", "START_POS": "12"}))
+self.xUITest.executeCommand(".uno:AutoFormatApply")
+sleep(1)
+self.assertEqual(get_state_as_dict(style)["Text"], "eSelah")
+
+# Replace Custom Styles when typing with it disabled, should not 
change style
+writer_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"DOWN"}))
+

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

2023-07-28 Thread Baole Fang (via logerrit)
 editeng/source/misc/swafopt.cxx|2 
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |2 
 sw/qa/uitest/data/tdf156165.odt|binary
 sw/qa/uitest/writer_tests/tdf156165.py |   80 +
 4 files changed, 82 insertions(+), 2 deletions(-)

New commits:
commit e26aeb882dd236adf19679d5df9b7ba5da1ed226
Author: Baole Fang 
AuthorDate: Thu Jul 6 12:03:31 2023 -0400
Commit: Mike Kaganski 
CommitDate: Sat Jul 29 03:53:28 2023 +0200

tdf#156165: Fix replace custom styles while typing

Originally, Replace Custom Styles changes styles to text body by entering 
BuiltText. Since styles change to text body is removed from BuiltTest, it is 
converted independently.

Now, conversion is applied even during typing because m_aFlags.bChgUserColl 
is true (its default value) during typing. Therefore, its default value is 
changed to false.

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

diff --git a/editeng/source/misc/swafopt.cxx b/editeng/source/misc/swafopt.cxx
index f6de4098d2e4..f5f79a45be97 100644
--- a/editeng/source/misc/swafopt.cxx
+++ b/editeng/source/misc/swafopt.cxx
@@ -27,7 +27,6 @@ SvxSwAutoFormatFlags::SvxSwAutoFormatFlags()
 bAutoCorrect =
 bCapitalStartSentence =
 bCapitalStartWord =
-bChgUserColl =
 bChgEnumNum =
 bAddNonBrkSpace =
 bChgOrdinalNumber =
@@ -42,6 +41,7 @@ SvxSwAutoFormatFlags::SvxSwAutoFormatFlags()
 bAFormatByInpDelSpacesAtSttEnd =
 bAFormatByInpDelSpacesBetweenLines = true;
 
+bChgUserColl =
 bReplaceStyles =
 bDelEmptyNode =
 bWithRedlining =
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 5ac39808f1d0..ad2f1497a561 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -4235,7 +4235,7 @@
   Specifies whether user-defined styles applied in the 
document are replaced by predefined text document styles.
   Replace user-defined styles
 
-true
+false
   
   
 
diff --git a/sw/qa/uitest/data/tdf156165.odt b/sw/qa/uitest/data/tdf156165.odt
new file mode 100644
index ..aabcfef91499
Binary files /dev/null and b/sw/qa/uitest/data/tdf156165.odt differ
diff --git a/sw/qa/uitest/writer_tests/tdf156165.py 
b/sw/qa/uitest/writer_tests/tdf156165.py
new file mode 100644
index ..69d1928bb8ce
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/tdf156165.py
@@ -0,0 +1,80 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+from uitest.uihelper.common import select_pos
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from time import sleep
+
+class tdf156165(UITestCase):
+
+   def test_tdf156165(self):
+with self.ui_test.load_file(get_url_for_data_file("tdf156165.odt")):
+xMainWindow = self.xUITest.getTopFocusWindow()
+writer_edit = xMainWindow.getChild("writer_edit")
+style=xMainWindow.getChild('applystyle')
+
+with 
self.ui_test.execute_dialog_through_command(".uno:AutoCorrectDlg") as xDialog:
+xTabs = xDialog.getChild("tabcontrol")
+select_pos(xTabs, "2")
+options=xDialog.getChild('list')
+checkbox=options.getChild("16")
+self.assertEqual("Replace Custom Styles", 
get_state_as_dict(checkbox)["Text"])
+
+# Replace Custom Styles is default to be false
+self.assertEqual("false", 
get_state_as_dict(checkbox)["IsChecked"])
+
+# Replace Custom Styles when applying manully with it disabled, 
should not change style
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"0", "START_POS": "12"}))
+self.xUITest.executeCommand(".uno:AutoFormatApply")
+sleep(1)
+self.assertEqual(get_state_as_dict(style)["Text"], "eSelah")
+
+# Replace Custom Styles when typing with it disabled, should not 
change style
+writer_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"DOWN"}))
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"12", "START_POS": "12"}))
+writer_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
+  

[Libreoffice-commits] core.git: cui/source cui/uiconfig editeng/source include/editeng officecfg/registry

2023-07-04 Thread Baole Fang (via logerrit)
 cui/source/tabpages/autocdlg.cxx   |9 -
 cui/uiconfig/ui/wordcompletionpage.ui  |2 +-
 editeng/source/misc/acorrcfg.cxx   |4 ++--
 include/editeng/swafopt.hxx|3 ++-
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 254161f9dd2b7b3e416c54dfeb8e8c6e81cd7dcd
Author: Baole Fang 
AuthorDate: Sun Jun 25 22:08:37 2023 -0400
Commit: Caolán McNamara 
CommitDate: Tue Jul 4 11:17:10 2023 +0200

tdf#92311: increase word completion limit

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

diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 378fb68c4143..a23fc2015ebf 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -1981,7 +1981,6 @@ bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet* )
 bool bModified = false, bCheck;
 SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect();
 SvxSwAutoFormatFlags *pOpt = >GetSwFlags();
-sal_uInt16 nVal;
 
 bCheck = m_xCBActiv->get_active();
 bModified |= pOpt->bAutoCompleteWords != bCheck;
@@ -1999,13 +1998,13 @@ bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet* )
 bModified |= pOpt->bAutoCmpltShowAsTip != bCheck;
 pOpt->bAutoCmpltShowAsTip = bCheck;
 
-nVal = static_cast(m_xNFMinWordlen->get_value());
+sal_uInt16 nVal = static_cast(m_xNFMinWordlen->get_value());
 bModified |= nVal != pOpt->nAutoCmpltWordLen;
 pOpt->nAutoCmpltWordLen = nVal;
 
-nVal = static_cast(m_xNFMaxEntries->get_value());
-bModified |= nVal != pOpt->nAutoCmpltListLen;
-pOpt->nAutoCmpltListLen = nVal;
+sal_uInt32 nList = static_cast(m_xNFMaxEntries->get_value());
+bModified |= nList != pOpt->nAutoCmpltListLen;
+pOpt->nAutoCmpltListLen = nList;
 
 const int nPos = m_xDCBExpandKey->get_active();
 if (nPos != -1)
diff --git a/cui/uiconfig/ui/wordcompletionpage.ui 
b/cui/uiconfig/ui/wordcompletionpage.ui
index d77e2c4f81d3..1b7004ee2d49 100644
--- a/cui/uiconfig/ui/wordcompletionpage.ui
+++ b/cui/uiconfig/ui/wordcompletionpage.ui
@@ -4,7 +4,7 @@
   
   
 50
-65535
+4294967295
 500
 25
 100
diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx
index 8603b4347da1..4ff15f1bfc2d 100644
--- a/editeng/source/misc/acorrcfg.cxx
+++ b/editeng/source/misc/acorrcfg.cxx
@@ -524,9 +524,9 @@ void SvxSwAutoCorrCfg::Load(bool bInit)
 break; // "Completion/MinWordLen",
 case  35:
 {
-sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
+sal_Int64 nVal = 0; pValues[nProp] >>= nVal;
 rSwFlags.nAutoCmpltListLen =
-sal::static_int_cast< sal_uInt16 >(nVal);
+sal::static_int_cast< sal_uInt32 >(nVal);
 }
 break; // "Completion/MaxListLen",
 case  36: rSwFlags.bAutoCmpltCollectWords = 
*o3tl::doAccess(pValues[nProp]); break; // "Completion/CollectWords",
diff --git a/include/editeng/swafopt.hxx b/include/editeng/swafopt.hxx
index 71919383da96..8a4ca5aeaa62 100644
--- a/include/editeng/swafopt.hxx
+++ b/include/editeng/swafopt.hxx
@@ -86,7 +86,8 @@ struct EDITENG_DLLPUBLIC SvxSwAutoFormatFlags
 sal_UCS4 cBullet;
 sal_UCS4 cByInputBullet;
 
-sal_uInt16 nAutoCmpltWordLen, nAutoCmpltListLen;
+sal_uInt32 nAutoCmpltListLen;
+sal_uInt16 nAutoCmpltWordLen;
 sal_uInt16 nAutoCmpltExpandKey;
 
 sal_uInt8 nRightMargin;
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 0f684bb2eea9..dd880f51cfa4 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -4464,7 +4464,7 @@
   
   8
 
-
+
   
   
 Sets the maximum number of words to be recalled.


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

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

New commits:
commit a6d35a7940a2c72594b470aec341c867e6faf82c
Author: Baole Fang 
AuthorDate: Fri Jun 23 11:47:54 2023 -0400
Commit: خالد حسني 
CommitDate: Sat Jun 24 01:44:35 2023 +0200

tdf#142437: Fix word boundary detection in autocorrect

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

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

Change-Id: I27ec2f7fb8d360791a280d10aba9b6d16e7cfb71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153509
Tested-by: Jenkins
Reviewed-by: خالد حسني 
(cherry picked from commit caab94a3e0387bde05538cff91ff13446f330785)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153517

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


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

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

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

tdf#142437: Fix word boundary detection in autocorrect

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

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

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

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


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

2023-06-18 Thread Baole Fang (via logerrit)
 cui/source/customize/cfgutil.cxx |   33 +++--
 cui/source/inc/cfgutil.hxx   |2 +-
 2 files changed, 24 insertions(+), 11 deletions(-)

New commits:
commit 94bf26798bb973c7df26e2aa841099bb9cbaf3cb
Author: Baole Fang 
AuthorDate: Tue May 23 20:40:51 2023 -0400
Commit: Mike Kaganski 
CommitDate: Sun Jun 18 19:04:55 2023 +0200

tdf#148836: Alphabetize customize keyboard dialog

"All Commands" is kept at the top, and LibreOffice Macros, Styles and 
Sidebar Decks are kept at the bottom,
while others are sorted alphabetally.

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

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index aa77952563a8..3039486a2f30 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -469,21 +469,16 @@ void CuiConfigGroupListBox::ClearAll()
 m_xTreeView->clear();
 }
 
-void CuiConfigGroupListBox::InitModule()
+sal_Int32 CuiConfigGroupListBox::InitModule()
 {
 try
 {
+// return the number of added groups
 css::uno::Reference< css::frame::XDispatchInformationProvider > 
xProvider(m_xFrame, css::uno::UNO_QUERY_THROW);
 css::uno::Sequence< sal_Int16 > lGroups = 
xProvider->getSupportedCommandGroups();
 sal_Int32   c1  = lGroups.getLength();
 sal_Int32   i1  = 0;
-
-if ( c1 )
-{
-// Add All Commands category
-
aArr.push_back(std::make_unique(SfxCfgKind::GROUP_ALLFUNCTIONS,
 0));
-m_xTreeView->append(weld::toId(aArr.back().get()), 
CuiResId(RID_CUISTR_ALLFUNCTIONS));
-}
+sal_Int32   nAddedGroups = 0;
 
 for (i1=0; i1( 
SfxCfgKind::GROUP_FUNCTION, nGroupID ) );
 m_xTreeView->append(weld::toId(aArr.back().get()), sGroupName);
+nAddedGroups++;
 }
+return nAddedGroups;
 }
 catch(const css::uno::RuntimeException&)
 { throw; }
 catch(const css::uno::Exception&)
 {}
+return 0;
 }
 
 void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< 
css::script::browse::XBrowseNode >& xRootNode,
@@ -634,6 +632,7 @@ void CuiConfigGroupListBox::Init(const css::uno::Reference< 
css::uno::XComponent
 
 m_xContext = xContext;
 m_xFrame = xFrame;
+sal_Int32 nAddedGroups = 0;
 if( bEventMode )
 {
 m_sModuleLongName = sModuleLongName;
@@ -641,7 +640,7 @@ void CuiConfigGroupListBox::Init(const css::uno::Reference< 
css::uno::XComponent
 
m_xModuleCategoryInfo.set(m_xGlobalCategoryInfo->getByName(m_sModuleLongName), 
css::uno::UNO_QUERY_THROW);
 m_xUICmdDescription   = css::frame::theUICommandDescription::get( 
m_xContext );
 
-InitModule();
+nAddedGroups = InitModule();
 }
 
 SAL_INFO("cui.customize", "** ** About to initialise SF Scripts");
@@ -658,7 +657,21 @@ void CuiConfigGroupListBox::Init(const 
css::uno::Reference< css::uno::XComponent
 // TODO exception handling
 }
 
+m_xTreeView->thaw();
+m_xTreeView->make_sorted();
+m_xTreeView->make_unsorted();
+m_xTreeView->freeze();
+
+// add All Commands to the top
+if ( bEventMode && nAddedGroups )
+{
+aArr.insert(aArr.begin(), 
std::make_unique(SfxCfgKind::GROUP_ALLFUNCTIONS, 0));
+OUString sId(weld::toId(aArr.front().get()));
+OUString s(CuiResId(RID_CUISTR_ALLFUNCTIONS));
+m_xTreeView->insert(nullptr, 0, , , nullptr, nullptr, false, 
nullptr);
+}
 
+// add application macros to the end
 if ( rootNode.is() )
 {
 if ( bEventMode )
@@ -681,7 +694,7 @@ void CuiConfigGroupListBox::Init(const css::uno::Reference< 
css::uno::XComponent
 }
 }
 
-// add styles and sidebar decks
+// add styles and sidebar decks to the end
 if ( bEventMode )
 {
 aArr.push_back( std::make_unique( 
SfxCfgKind::GROUP_STYLES, 0, nullptr ) ); // TODO last parameter should contain 
user data
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index 44f532baa6ba..b1f22e4065b9 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -204,7 +204,7 @@ class CuiConfigGroupListBox
 css::uno::Reference< css::uno::XComponentContext > const & xCtx,
 std::u16string_view docName);
 
-void InitModule();
+sal_Int32 InitModule();
 void FillScriptList(const css::uno::Reference< 
css::script::browse::XBrowseNode >& xRootNode,
 const weld::TreeIter* pParentEntry);
 void FillFunctionsList(const css::uno::Sequence< 
css::frame::DispatchInformation >& xCommands);


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

2023-06-02 Thread Baole Fang (via logerrit)
 sc/qa/uitest/calc_tests8/tdf132026.py |   44 ++
 sc/qa/uitest/data/tdf132026.ods   |binary
 sc/source/ui/view/tabvwsha.cxx|   12 ++---
 3 files changed, 53 insertions(+), 3 deletions(-)

New commits:
commit 0450c7177f61ba5be15f7b4175b9fb5e89f850ae
Author: Baole Fang 
AuthorDate: Sun May 28 10:28:24 2023 -0400
Commit: Mike Kaganski 
CommitDate: Fri Jun 2 20:02:39 2023 +0200

tdf#132026: Fix selection in text cell

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

diff --git a/sc/qa/uitest/calc_tests8/tdf132026.py 
b/sc/qa/uitest/calc_tests8/tdf132026.py
new file mode 100644
index ..abd3a86e720b
--- /dev/null
+++ b/sc/qa/uitest/calc_tests8/tdf132026.py
@@ -0,0 +1,44 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_url_for_data_file
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf132026(UITestCase):
+
+def test_tdf132026(self):
+with self.ui_test.load_file(get_url_for_data_file("tdf132026.ods")) as 
calc_doc:
+MainWindow = self.xUITest.getTopFocusWindow()
+grid_window = MainWindow.getChild("grid_window")
+
+chars=["=","+","-"]
+directions=["UP","DOWN","LEFT","RIGHT"]
+
+# format general, should select cell
+for c in chars:
+sign=-1 if c=="-" else 1
+for i,direction in enumerate(directions):
+grid_window.executeAction("SELECT", 
mkPropertyValues({"CELL": "B2"}))
+grid_window.executeAction("TYPE", 
mkPropertyValues({"TEXT": c}))
+grid_window.executeAction("TYPE", 
mkPropertyValues({"KEYCODE": direction}))
+grid_window.executeAction("TYPE", 
mkPropertyValues({"KEYCODE": "RETURN"}))
+self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 
1).getString(), str(sign*(i+1)))
+
+# format text, shouldn't select cell
+for c in chars:
+for direction in directions:
+grid_window.executeAction("SELECT", 
mkPropertyValues({"CELL": "E2"}))
+grid_window.executeAction("TYPE", 
mkPropertyValues({"TEXT": c}))
+grid_window.executeAction("TYPE", 
mkPropertyValues({"KEYCODE": direction}))
+grid_window.executeAction("TYPE", 
mkPropertyValues({"KEYCODE": "RETURN"}))
+self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 
1).getString(), c)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/tdf132026.ods b/sc/qa/uitest/data/tdf132026.ods
new file mode 100644
index ..03c6c654fdc5
Binary files /dev/null and b/sc/qa/uitest/data/tdf132026.ods differ
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 4021f1937f91..f1305672a096 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -640,13 +640,19 @@ bool ScTabViewShell::IsRefInputMode() const
 ScInputHandler* pHdl = pScMod->GetInputHdl();
 if ( pHdl )
 {
+const ScViewData& rViewData = GetViewData();
+ScDocument& rDoc = rViewData.GetDocument();
+const ScAddress aPos( rViewData.GetCurPos() );
+const sal_uInt32 nIndex = rDoc.GetAttr(aPos, ATTR_VALUE_FORMAT 
)->GetValue();
+const SvNumFormatType nType = 
rDoc.GetFormatTable()->GetType(nIndex);
+if (nType == SvNumFormatType::TEXT)
+{
+return false;
+}
 OUString aString = pHdl->GetEditString();
 if ( !pHdl->GetSelIsRef() && aString.getLength() > 1 &&
  ( aString[0] == '+' || aString[0] == '-' ) )
 {
-const ScViewData& rViewData = GetViewData();
-ScDocument& rDoc = rViewData.GetDocument();
-const ScAddress aPos( rViewData.GetCurPos() );
 ScCompiler aComp( rDoc, aPos, rDoc.GetGrammar() );
 aComp.SetCloseBrackets( false );
 std::unique_ptr 
pArr(aComp.CompileString(aString));


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

2023-06-02 Thread Baole Fang (via logerrit)
 cui/source/options/connpooloptions.cxx |2 +-
 cui/source/options/optgdlg.cxx |6 +++---
 cui/source/options/optlingu.cxx|4 ++--
 cui/source/options/optsave.cxx |2 +-
 cui/source/options/treeopt.cxx |2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 69a3bcdaa54700a372151af52ccfbb0deed9db45
Author: Baole Fang 
AuthorDate: Sat May 27 13:23:25 2023 -0400
Commit: Mike Kaganski 
CommitDate: Fri Jun 2 17:02:33 2023 +0200

tdf#43157: Clean up OSL_FAIL

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

diff --git a/cui/source/options/connpooloptions.cxx 
b/cui/source/options/connpooloptions.cxx
index c067af0c3e47..80c202a78c0b 100644
--- a/cui/source/options/connpooloptions.cxx
+++ b/cui/source/options/connpooloptions.cxx
@@ -145,7 +145,7 @@ namespace offapp
 UpdateDriverList(pDriverSettings->getSettings());
 else
 {
-OSL_FAIL("ConnectionPoolOptionsPage::implInitControls: missing the 
DriverTimeouts item!");
+SAL_WARN("cui.options", 
"ConnectionPoolOptionsPage::implInitControls: missing the DriverTimeouts 
item!");
 UpdateDriverList(DriverPoolingSettings());
 }
 saveDriverList();
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 249d7b0318b6..da546d760d05 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -702,7 +702,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
 case 2: eSet = SFX_SYMBOLS_SIZE_LARGE; break;
 case 3: eSet = SFX_SYMBOLS_SIZE_32; break;
 default:
-OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of 
m_xIconSizeLB should not be possible!" );
+SAL_WARN("cui.options", "OfaViewTabPage::FillItemSet(): This 
state of m_xIconSizeLB should not be possible!");
 }
 aMiscOptions.SetSymbolsSize( eSet );
 }
@@ -718,7 +718,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
 case 1: eSet = ToolBoxButtonSize::Small; break;
 case 2: eSet = ToolBoxButtonSize::Large; break;
 default:
-OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of 
m_xSidebarIconSizeLB should not be possible!" );
+SAL_WARN("cui.options", "OfaViewTabPage::FillItemSet(): This 
state of m_xSidebarIconSizeLB should not be possible!");
 }
 
officecfg::Office::Common::Misc::SidebarIconSize::set(static_cast(eSet),
 xChanges);
 }
@@ -734,7 +734,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
 case 1: eSet = ToolBoxButtonSize::Small; break;
 case 2: eSet = ToolBoxButtonSize::Large; break;
 default:
-OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of 
m_xNotebookbarIconSizeLB should not be possible!" );
+SAL_WARN("cui.options", "OfaViewTabPage::FillItemSet(): This 
state of m_xNotebookbarIconSizeLB should not be possible!");
 }
 
officecfg::Office::Common::Misc::NotebookbarIconSize::set(static_cast(eSet),
 xChanges);
 }
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 584c86c5f7d6..d04de6aed890 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1519,7 +1519,7 @@ IMPL_LINK(SvxLinguTabPage, ClickHdl_Impl, weld::Button&, 
rBtn, void)
 }
 else
 {
-OSL_FAIL( "rBtn unexpected value" );
+SAL_WARN("cui.options", "rBtn unexpected value");
 }
 }
 
@@ -1551,7 +1551,7 @@ IMPL_LINK(SvxLinguTabPage, SelectHdl_Impl, 
weld::TreeView&, rBox, void)
 }
 else
 {
-OSL_FAIL( "rBox unexpected value" );
+SAL_WARN("cui.options", "rBtn unexpected value");
 }
 }
 
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 7799da84c8b6..56e0f4486730 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -422,7 +422,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
 case  APP_IMPRESS   : sReplace = 
"com.sun.star.presentation.PresentationDocument";break;
 case  APP_DRAW  : sReplace = 
"com.sun.star.drawing.DrawingDocument";break;
 case  APP_MATH  : sReplace = 
"com.sun.star.formula.FormulaProperties";break;
-default: OSL_FAIL("illegal user data");
+default: SAL_WARN("cui.options", "illegal user data");
 }
 sCommand = sCommand.replaceFirst("%1", sReplace);
 Reference< XEnumeration > xList = 
xQuery->createSubSetEnumerationByQuery(sCommand);
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index c32fb8d5fa7e..98d8a3e77c7d 100644

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

2023-06-02 Thread Baole Fang (via logerrit)
 sw/source/core/edit/autofmt.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 083975f9666e3dc6fd665dc0418e6c3130628359
Author: Baole Fang 
AuthorDate: Sat Apr 29 20:37:03 2023 -0400
Commit: Mike Kaganski 
CommitDate: Fri Jun 2 11:41:52 2023 +0200

tdf#90507: Prevent changing default style in AutoCorrect

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

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index f8bcfebe9875..2c9eb69ac16a 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1433,7 +1433,6 @@ void SwAutoFormat::BuildText()
 bBreak = !IsFastFullLine(*m_pCurTextFrame)
 || IsBlanksInString(*m_pCurTextFrame)
 || IsSentenceAtEnd(*m_pCurTextFrame);
-SetColl( RES_POOLCOLL_TEXT, true );
 if( !bBreak )
 {
 SetRedlineText( STR_AUTOFMTREDL_DEL_MORELINES );
@@ -2420,6 +2419,12 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, 
SvxSwAutoFormatFlags aFlags,
 break;
 }
 
+// replace custom styles with text body
+if ( IsPoolUserFormat( nPoolId ) && m_aFlags.bChgUserColl )
+{
+SetColl( RES_POOLCOLL_TEXT, true );
+}
+
 // check for left margin set by the style
 if( IsPoolUserFormat( nPoolId ) ||
 RES_POOLCOLL_STANDARD == nPoolId )


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

2023-06-02 Thread Baole Fang (via logerrit)
 sc/qa/uitest/calc_tests8/tdf131638.py |   26 ++
 sc/qa/uitest/data/tdf131638.ods   |binary
 sc/source/ui/view/viewfunc.cxx|   10 +-
 3 files changed, 31 insertions(+), 5 deletions(-)

New commits:
commit 730e6fa063fccbd12913362dd5d3c74ea14957be
Author: Baole Fang 
AuthorDate: Sat May 27 21:05:01 2023 -0400
Commit: Mike Kaganski 
CommitDate: Fri Jun 2 10:22:10 2023 +0200

tdf#131638: Fix text cell incorrect formula

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

diff --git a/sc/qa/uitest/calc_tests8/tdf131638.py 
b/sc/qa/uitest/calc_tests8/tdf131638.py
new file mode 100644
index ..bafbfc5d8567
--- /dev/null
+++ b/sc/qa/uitest/calc_tests8/tdf131638.py
@@ -0,0 +1,26 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_url_for_data_file
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf137726(UITestCase):
+
+def test_tdf137726(self):
+with self.ui_test.load_file(get_url_for_data_file("tdf131638.ods")) as 
calc_doc:
+MainWindow = self.xUITest.getTopFocusWindow()
+grid_window = MainWindow.getChild("grid_window")
+grid_window.executeAction("SELECT", mkPropertyValues({"CELL": 
"A1"}))
+grid_window.executeAction("TYPE", mkPropertyValues({"TEXT": 
"-/2"}))
+grid_window.executeAction("TYPE", mkPropertyValues({"KEYCODE": 
"RETURN"}))
+self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 
0).getString(), "-/2")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/tdf131638.ods b/sc/qa/uitest/data/tdf131638.ods
new file mode 100644
index ..a66a7e9c9de9
Binary files /dev/null and b/sc/qa/uitest/data/tdf131638.ods differ
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 78080364e928..bc149f62b40e 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -408,8 +408,11 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB 
nTab,
 
 bool bFormula = false;
 
+// do not check formula if it is a text cell
+sal_uInt32 format = rDoc.GetNumberFormat( nCol, nRow, nTab );
+SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
 // a single '=' character is handled as string (needed for special filters)
-if ( rString.getLength() > 1 )
+if ( pFormatter->GetType(format) != SvNumFormatType::TEXT && 
rString.getLength() > 1 )
 {
 if ( rString[0] == '=' )
 {
@@ -431,10 +434,8 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB 
nTab,
 // is non-empty and not a number, handle as formula
 if ( aString.getLength() > 1 )
 {
-sal_uInt32 nFormat = rDoc.GetNumberFormat( nCol, nRow, nTab );
-SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
 double fNumber = 0;
-if ( !pFormatter->IsNumberFormat( aString, nFormat, fNumber ) )
+if ( !pFormatter->IsNumberFormat( aString, format, fNumber ) )
 {
 bFormula = true;
 }
@@ -568,7 +569,6 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB 
nTab,
 
 ScFormulaCell aCell(rDoc, aPos, std::move( pArr ), 
formula::FormulaGrammar::GRAM_DEFAULT, ScMatrixMode::NONE);
 
-SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
 for (const auto& rTab : rMark)
 {
 i = rTab;


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

2023-05-27 Thread Baole Fang (via logerrit)
 cui/source/inc/treeopt.hxx   |2 
 cui/source/options/optsave.cxx   |   40 +++
 cui/source/options/treeopt.cxx   |4 +
 cui/uiconfig/ui/optsavepage.ui   |9 
 officecfg/registry/data/org/openoffice/Office/UI.xcu |   16 +++
 5 files changed, 45 insertions(+), 26 deletions(-)

New commits:
commit 9e92437cbb2180d51fdabc0d5efff24b530ba27a
Author: Baole Fang 
AuthorDate: Sat May 6 22:35:17 2023 -0400
Commit: Mike Kaganski 
CommitDate: Sat May 27 09:00:08 2023 +0200

tdf#148756: Fix document type in option dialog

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

diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index 69278a1b5349..74ca73944b66 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -142,6 +142,7 @@ private:
 
 css::uno::Reference < css::awt::XContainerWindowProvider >
 m_xContainerWinProvider;
+css::uno::Reference m_xFrame;
 
 static LastPageSaver*   pLastPageSaver;
 
@@ -193,6 +194,7 @@ public:
 
 // helper functions to call the language settings TabPage from the 
SpellDialog
 static void ApplyLanguageOptions(const SfxItemSet& rSet);
+static OUString getCurrentFactory_Impl( const css::uno::Reference< 
css::frame::XFrame >& _xFrame );
 
 voidSetNeedsRestart( svtools::RestartReason eReason );
 };
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 9b2aee019476..7799da84c8b6 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -106,13 +107,20 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, 
weld::DialogController* p
 m_xODFVersionLB->set_id(4, OUString::number(SvtSaveOptions::ODFVER_013)); 
// 1.3
 m_xODFVersionLB->set_id(5, 
OUString::number(SvtSaveOptions::ODFVER_LATEST)); // 1.3 Extended (recommended)
 
-m_xDocTypeLB->set_id(0, OUString::number(APP_WRITER)   );
-m_xDocTypeLB->set_id(1, OUString::number(APP_WRITER_WEB)   );
-m_xDocTypeLB->set_id(2, OUString::number(APP_WRITER_GLOBAL));
-m_xDocTypeLB->set_id(3, OUString::number(APP_CALC) );
-m_xDocTypeLB->set_id(4, OUString::number(APP_IMPRESS)  );
-m_xDocTypeLB->set_id(5, OUString::number(APP_DRAW) );
-m_xDocTypeLB->set_id(6, OUString::number(APP_MATH) );
+auto aFilterClassesNode = 
utl::OConfigurationTreeRoot::createWithComponentContext(
+comphelper::getProcessComponentContext(),
+
"org.openoffice.Office.UI/FilterClassification/GlobalFilters/Classes",
+-1,
+utl::OConfigurationTreeRoot::CM_READONLY
+);
+
+m_xDocTypeLB->append(OUString::number(APP_WRITER), 
aFilterClassesNode.getNodeValue("com.sun.star.text.TextDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_WRITER_WEB), 
aFilterClassesNode.getNodeValue("com.sun.star.text.WebDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_WRITER_GLOBAL), 
aFilterClassesNode.getNodeValue("com.sun.star.text.GlobalDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_CALC), 
aFilterClassesNode.getNodeValue("com.sun.star.sheet.SpreadsheetDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_IMPRESS), 
aFilterClassesNode.getNodeValue("com.sun.star.presentation.PresentationDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_DRAW), 
aFilterClassesNode.getNodeValue("com.sun.star.drawing.DrawingDocument/DisplayName").get());
+m_xDocTypeLB->append(OUString::number(APP_MATH), 
aFilterClassesNode.getNodeValue("com.sun.star.formula.FormulaProperties/DisplayName").get());
 
 m_xAutoSaveCB->connect_toggled( LINK( this, SvxSaveTabPage, 
AutoClickHdl_Impl ) );
 
@@ -434,7 +442,23 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
 pImpl->aODFArr[nData] = lODFList;
 }
 }
-m_xDocTypeLB->set_active(0);
+OUString sModule = 
OfaTreeOptionsDialog::getCurrentFactory_Impl(GetFrame());
+sal_Int32 docId = 0;
+if (sModule == "com.sun.star.text.TextDocument")
+docId = APP_WRITER;
+else if (sModule == "com.sun.star.text.WebDocument")
+docId = APP_WRITER_WEB;
+else if (sModule == "com.sun.star.text.GlobalDocument")
+docId = APP_WRITER_GLOBAL;
+else if (sModule == "com.sun.star.sheet.SpreadsheetDocument")
+docId = APP_CALC;
+else if (sModule == 
"com.sun.star.presentation.PresentationDocument")
+docId = APP_IMPRESS;
+else if 

[Libreoffice-commits] core.git: officecfg/registry sd/inc sd/source sd/uiconfig

2023-05-24 Thread Baole Fang (via logerrit)
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |
2 -
 sd/inc/strings.hrc   |
8 -
 sd/source/ui/dlg/sdpreslt.cxx|   
16 +-
 sd/source/ui/inc/sdpreslt.hxx|
1 
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx   |   
16 +++---
 sd/uiconfig/sdraw/popupmenu/page.xml |
2 -
 sd/uiconfig/sdraw/popupmenu/pagepanemaster.xml   |
2 -
 sd/uiconfig/sdraw/ui/notebookbar.ui  |
4 +-
 sd/uiconfig/sdraw/ui/notebookbar_compact.ui  |
4 +-
 sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact.ui   |
2 -
 10 files changed, 43 insertions(+), 14 deletions(-)

New commits:
commit 0a90b90048313fb43f8c5d7461f58dafec276600
Author: Baole Fang 
AuthorDate: Sun May 7 22:35:34 2023 -0400
Commit: Heiko Tietze 
CommitDate: Wed May 24 09:22:48 2023 +0200

tdf#148088: Fix master related UI in Draw

Page/Master Page... -> Page/Change Master Page... (corresponds to Impress)
In the above dialog:
Available Master Slides -> Available Master Pages
Select a Slide Design -> Select a Page Design
After clickling load:
Load Master Slide -> Load Master Page
In Master mode, right click/Rename Master:
Rename Master Slide -> Rename Master Page

Change-Id: I6a8e987d6f3eaf91289ec061ec87cd76b3f90ca2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151489
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-by: Heiko Tietze 

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index 716d496161e6..cca1b2ec38ae 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -1103,7 +1103,7 @@
   
   
 
-  Master Page...
+  Change Master Page...
 
 
   .uno:PresentationLayout
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index bf5372b2ad33..3e1ddd1542e7 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -159,7 +159,12 @@
 
 // Strings for animation effects
 #define STR_INSERT_TEXT NC_("STR_INSERT_TEXT", 
"Insert Text")
+#define STR_AVAILABLE_MASTERSLIDE   
NC_("STR_AVAILABLE_MASTERSLIDE", "Available Master Slides")
+#define STR_AVAILABLE_MASTERPAGE
NC_("STR_AVAILABLE_MASTERPAGE", "Available Master Pages")
+#define STR_SELECT_SLIDE
NC_("STR_SELECT_SLIDE", "Select a Slide Design")
+#define STR_SELECT_PAGE NC_("STR_SELECT_PAGE", 
"Select a Page Design")
 #define STR_LOAD_PRESENTATION_LAYOUT
NC_("STR_LOAD_PRESENTATION_LAYOUT", "Load Master Slide")
+#define STR_LOAD_DRAWING_LAYOUT 
NC_("STR_LOAD_DRAWING_LAYOUT", "Load Master Page")
 #define STR_GLUE_ESCDIR_SMART   
NC_("STR_GLUE_ESCDIR_SMART", "Smart")
 #define STR_GLUE_ESCDIR_LEFT
NC_("STR_GLUE_ESCDIR_LEFT", "Left")
 #define STR_GLUE_ESCDIR_RIGHT   
NC_("STR_GLUE_ESCDIR_RIGHT", "Right")
@@ -238,7 +243,8 @@
 #define STR_TITLE_RENAMEPAGE
NC_("STR_TITLE_RENAMEPAGE", "Rename Page")
 #define STR_TOOLTIP_RENAME  
NC_("STR_TOOLTIP_RENAME", "Duplicate or empty names are not possible")
 #define STR_DESC_RENAMESLIDE
NC_("STR_DESC_RENAMESLIDE", "Name")
-#define STR_TITLE_RENAMEMASTER  
NC_("STR_TITLE_RENAMEMASTER", "Rename Master Slide")
+#define STR_TITLE_RENAMEMASTERSLIDE 
NC_("STR_TITLE_RENAMEMASTERSLIDE", "Rename Master Slide")
+#define STR_TITLE_RENAMEMASTERPAGE  
NC_("STR_TITLE_RENAMEMASTERPAGE", "Rename Master Page")
 #define STR_PLACEHOLDER_DESCRIPTION_TITLE   
NC_("STR_PLACEHOLDER_DESCRIPTION_TITLE", "Title Area for AutoLayouts" )
 #define STR_PLACEHOLDER_DESCRIPTION_OUTLINE 
NC_("STR_PLACEHOLDER_DESCRIPTION_OUTLINE", "Object Area for AutoLayouts" )
 #define STR_PLACEHOLDER_DESCRIPTION_FOOTER  
NC_("STR_PLACEHOLDER_DESCRIPTION_FOOTER", "Footer Area" )
diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx
index dd54611e28d9..d0d0839bbb41 100644
--- a/sd/source/ui/dlg/sdpreslt.cxx
+++ b/sd/source/ui/dlg/sdpreslt.cxx
@@ -47,7 +47,18 @@ SdPresLayoutDlg::SdPresLayoutDlg(::sd::DrawDocShell* 
pDocShell,
 , m_xBtnLoad(m_xBuilder->weld_button("load"))
 , m_xVS(new ValueSet(m_xBuilder->weld_scrolled_window("selectwin", true)))
 , 

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

2023-05-04 Thread Baole Fang (via logerrit)
 sw/qa/uitest/data/tdf128192.odt |binary
 sw/qa/uitest/writer_tests4/tdf128192.py |   72 
 sw/source/core/edit/autofmt.cxx |4 +
 3 files changed, 76 insertions(+)

New commits:
commit 1cff5c9db7e0d7cf7ae45b306deb963d95926d99
Author: Baole Fang 
AuthorDate: Tue Apr 25 21:07:56 2023 -0400
Commit: Andreas Heinisch 
CommitDate: Thu May 4 08:44:47 2023 +0200

tdf#128192: Fix Tools/AutoCorrect/Apply

AutoCorrect() is applied in GET_ALL_INFO and HAS_FMTCOLL stage.
Also, UITest is added by examining whether "Replace dashes" is performed.

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

diff --git a/sw/qa/uitest/data/tdf128192.odt b/sw/qa/uitest/data/tdf128192.odt
new file mode 100644
index ..9f5c471381b6
Binary files /dev/null and b/sw/qa/uitest/data/tdf128192.odt differ
diff --git a/sw/qa/uitest/writer_tests4/tdf128192.py 
b/sw/qa/uitest/writer_tests4/tdf128192.py
new file mode 100644
index ..3c5f72c3beef
--- /dev/null
+++ b/sw/qa/uitest/writer_tests4/tdf128192.py
@@ -0,0 +1,72 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+
+#Bug 128192 - Fix Tools/AutoCorrect/Apply to apply for all styles
+
+class tdf128192(UITestCase):
+
+def test_tdf128192(self):
+with self.ui_test.load_file(get_url_for_data_file("tdf128192.odt")):
+MainWindow = self.xUITest.getTopFocusWindow()
+writer_edit = MainWindow.getChild("writer_edit")
+
+# perform Tools/AutoCorrect/Apply on the whole document
+self.xUITest.executeCommand(".uno:SelectAll")
+self.xUITest.executeCommand(".uno:AutoFormatApply")
+
+# test for each style whether "Replace dashes" works in AutoCorrect
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"9", "START_POS": "14"}))
+self.assertEqual(get_state_as_dict(writer_edit)["SelectedText"], 
"A – B")
+
+self.xUITest.executeCommand(".uno:GoUp")
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"19", "START_POS": "24"}))
+self.assertEqual(get_state_as_dict(writer_edit)["SelectedText"], 
"A – B")
+
+self.xUITest.executeCommand(".uno:GoUp")
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"12", "START_POS": "17"}))
+self.assertEqual(get_state_as_dict(writer_edit)["SelectedText"], 
"A – B")
+
+self.xUITest.executeCommand(".uno:GoUp")
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"11", "START_POS": "16"}))
+self.assertEqual(get_state_as_dict(writer_edit)["SelectedText"], 
"A – B")
+
+self.xUITest.executeCommand(".uno:GoUp")
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"11", "START_POS": "16"}))
+self.assertEqual(get_state_as_dict(writer_edit)["SelectedText"], 
"A – B")
+
+self.xUITest.executeCommand(".uno:GoUp")
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"11", "START_POS": "16"}))
+self.assertEqual(get_state_as_dict(writer_edit)["SelectedText"], 
"A – B")
+
+self.xUITest.executeCommand(".uno:GoUp")
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"11", "START_POS": "16"}))
+self.assertEqual(get_state_as_dict(writer_edit)["SelectedText"], 
"A – B")
+
+self.xUITest.executeCommand(".uno:GoUp")
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"16", "START_POS": "11"}))
+self.assertEqual(get_state_as_dict(writer_edit)["SelectedText"], 
"A – B")
+
+self.xUITest.executeCommand(".uno:GoUp")
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"25", "START_POS": "30"}))
+self.assertEqual(get_state_as_dict(writer_edit)["SelectedText"], 
"A – B")
+
+self.xUITest.executeCommand(".uno:GoUp")
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"10", "START_POS": "15"}))
+self.assertEqual(get_state_as_dict(writer_edit)["SelectedText"], 
"A – B")
+
+self.xUITest.executeCommand(".uno:GoUp")
+writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": 
"7", "START_POS": "12"}))
+

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

2023-05-02 Thread Baole Fang (via logerrit)
 svl/qa/unit/test_URIHelper.cxx |5 +
 svl/source/misc/urihelper.cxx  |4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit e8d7bf954fe74ce85bdd084d6e12d27027a4c379
Author: Baole Fang 
AuthorDate: Thu Apr 27 14:16:18 2023 -0400
Commit: Stephan Bergmann 
CommitDate: Wed May 3 07:55:02 2023 +0200

tdf#145925: Support AutoCapitalize in DOI recognition

Sometimes, the first character of the doi string is auto capitalized, which 
isn't recognized as DOI.
Now, the doi detection is able to recognize doi string with the first 
character capitalized,
like what is done in url recognition.

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

diff --git a/svl/qa/unit/test_URIHelper.cxx b/svl/qa/unit/test_URIHelper.cxx
index df9e5d5114b8..33a08996cb58 100644
--- a/svl/qa/unit/test_URIHelper.cxx
+++ b/svl/qa/unit/test_URIHelper.cxx
@@ -410,6 +410,11 @@ void Test::testFindFirstDOIInText() {
 };
 static Data const tests[] = {
 { "doi:10.1000/182", "https://doi.org/10.1000/182;, 0, 15 }, // valid 
doi suffix with only digits
+{ "Doi:10.1000/182", "https://doi.org/10.1000/182;, 0, 15 }, // valid 
doi suffix with some of the the first three character being capitalized
+{ "DoI:10.1000/182", "https://doi.org/10.1000/182;, 0, 15 }, // valid 
doi suffix with some of the the first three character being capitalized
+{ "DOI:10.1000/182", "https://doi.org/10.1000/182;, 0, 15 }, // valid 
doi suffix with some of the the first three character being capitalized
+{ "dOI:10.1000/182", "https://doi.org/10.1000/182;, 0, 15 }, // valid 
doi suffix with some of the the first three character being capitalized
+{ "dOi:10.1000/182", "https://doi.org/10.1000/182;, 0, 15 }, // valid 
doi suffix with some of the the first three character being capitalized
 { "doi:10.1038/nature03001", "https://doi.org/10.1038/nature03001;, 0, 
23 }, // valid doi suffix with alphanumeric characters
 { "doi:10.1093/ajae/aaq063", "https://doi.org/10.1093/ajae/aaq063;, 0, 
23 }, // valid doi suffix with multiple slash
 { "doi:10.1016/S0735-1097(98)00347-7", 
"https://doi.org/10.1016/S0735-1097(98)00347-7", 0, 33 }, // valid doi suffix 
with characters apart from alphanumeric
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index 0043b7883a87..9aa78a584614 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -757,7 +757,7 @@ OUString URIHelper::FindFirstDOIInText(OUString const & 
rText,
 sal_Int32 count = rEnd-rBegin;
 OUString candidate(rText.subView(rBegin, count));
 // Match with regex "doi:10\.\d{4,9}\/[-._;()\/:a-zA-Z0-9]+"
-if (candidate.startsWith("doi:10."))
+if (candidate.startsWithIgnoreAsciiCase("doi:10."))
 {
 bool flag = true;
 sal_Int32 digit = 0;
@@ -797,7 +797,7 @@ OUString URIHelper::FindFirstDOIInText(OUString const & 
rText,
 }
 if (flag && digit==-1)
 {
-return candidate.replaceFirst("doi:","https://doi.org/;);
+return OUString::Concat("https://doi.org/;)+candidate.subView(4);
 }
 }
 rBegin = rEnd;


[Libreoffice-commits] core.git: cui/inc cui/source editeng/source include/editeng include/svl officecfg/registry svl/qa svl/source sw/inc sw/source

2023-04-27 Thread Baole Fang (via logerrit)
 cui/inc/strings.hrc|1 
 cui/source/inc/autocdlg.hxx|2 
 cui/source/tabpages/autocdlg.cxx   |   15 +++
 editeng/source/misc/acorrcfg.cxx   |   18 +++
 editeng/source/misc/svxacorr.cxx   |   18 +++
 editeng/source/misc/swafopt.cxx|1 
 include/editeng/svxacorr.hxx   |6 +
 include/editeng/swafopt.hxx|1 
 include/svl/urihelper.hxx  |5 +
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   10 ++
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |8 +
 svl/qa/unit/test_URIHelper.cxx |   54 +++
 svl/source/misc/urihelper.cxx  |   59 +
 sw/inc/comcore.hxx |3 
 sw/inc/utlui.hrc   |3 
 sw/source/core/edit/autofmt.cxx|9 +
 sw/source/uibase/docvw/edtwin.cxx  |5 -
 sw/source/uibase/shells/textsh.cxx |3 
 sw/source/uibase/wrtsh/wrtsh1.cxx  |3 
 19 files changed, 210 insertions(+), 14 deletions(-)

New commits:
commit a772976f047882918d5386a3ef9226c4aa2aa118
Author: Baole Fang 
AuthorDate: Tue Apr 25 00:33:01 2023 -0400
Commit: Stephan Bergmann 
CommitDate: Thu Apr 27 15:27:33 2023 +0200

tdf#145925: Add DOI recognition

Detect DOI string in the form of "doi:10.*" and add hyperlink to it.
It works the same way as url recognition.

Change-Id: I3c4e78a110fd81ad7e727d5e9acee7e51127466a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150954
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Reviewed-by: Stephan Bergmann 

diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index 498e60e75bc2..442ac515ef8c 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -332,6 +332,7 @@
 #define RID_CUISTR_BOLD_UNDER   
NC_("RID_SVXSTR_BOLD_UNDER", "Automatic *bold*, /italic/, -strikeout- and 
_underline_")
 #define RID_CUISTR_NO_DBL_SPACES
NC_("RID_SVXSTR_NO_DBL_SPACES", "Ignore double spaces")
 #define RID_CUISTR_DETECT_URL   
NC_("RID_SVXSTR_DETECT_URL", "URL Recognition")
+#define RID_CUISTR_DETECT_DOI   
NC_("RID_SVXSTR_DETECT_DOI", "DOI citation recognition")
 #define RID_CUISTR_DASH NC_("RID_SVXSTR_DASH", 
"Replace dashes")
 #define RID_CUISTR_CORRECT_ACCIDENTAL_CAPS_LOCK 
NC_("RID_SVXSTR_CORRECT_ACCIDENTAL_CAPS_LOCK", "Correct accidental use of cAPS 
LOCK key")
 #define RID_CUISTR_NON_BREAK_SPACE  
NC_("RID_SVXSTR_NON_BREAK_SPACE", "Add non-breaking space before specific 
punctuation marks in French text")
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index 7b4842314779..2357677ef65f 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/cui/source/inc/autocdlg.hxx
@@ -57,6 +57,7 @@ private:
 OUString m_sStartCap;
 OUString m_sBoldUnderline;
 OUString m_sURL;
+OUString m_sDOI;
 OUString m_sNoDblSpaces;
 OUString m_sDash;
 OUString m_sAccidentalCaps;
@@ -92,6 +93,7 @@ class OfaSwAutoFmtOptionsPage : public SfxTabPage
 OUStringsNoDblSpaces;
 OUStringsCorrectCapsLock;
 OUStringsDetectURL;
+OUStringsDetectDOI;
 OUStringsDash;
 OUStringsRightMargin;
 OUStringsNum;
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index aea3f7d9727e..38a261ad5737 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -189,6 +189,7 @@ 
OfaAutocorrOptionsPage::OfaAutocorrOptionsPage(weld::Container* pPage, weld::Dia
 , m_sStartCap(CuiResId(RID_CUISTR_CPTL_STT_SENT))
 , m_sBoldUnderline(CuiResId(RID_CUISTR_BOLD_UNDER))
 , m_sURL(CuiResId(RID_CUISTR_DETECT_URL))
+, m_sDOI(CuiResId(RID_CUISTR_DETECT_DOI))
 , m_sNoDblSpaces(CuiResId(RID_CUISTR_NO_DBL_SPACES))
 , m_sDash(CuiResId(RID_CUISTR_DASH))
 , m_sAccidentalCaps(CuiResId(RID_CUISTR_CORRECT_ACCIDENTAL_CAPS_LOCK))
@@ -223,6 +224,7 @@ bool OfaAutocorrOptionsPage::FillItemSet( SfxItemSet* )
 pAutoCorrect->SetAutoCorrFlag(ACFlags::CapitalStartSentence, 
m_xCheckLB->get_toggle(nPos++) == TRISTATE_TRUE);
 pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgWeightUnderl,  
m_xCheckLB->get_toggle(nPos++) == TRISTATE_TRUE);
 pAutoCorrect->SetAutoCorrFlag(ACFlags::SetINetAttr,  
m_xCheckLB->get_toggle(nPos++) == TRISTATE_TRUE);
+pAutoCorrect->SetAutoCorrFlag(ACFlags::SetDOIAttr,   
m_xCheckLB->get_toggle(nPos++) == TRISTATE_TRUE);
 pAutoCorrect->SetAutoCorrFlag(ACFlags::ChgToEnEmDash,

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

2023-04-21 Thread Baole Fang (via logerrit)
 cui/source/dialogs/zoom.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 56d2939e1928ae06fa74cb4b4be36cc0eaf3e702
Author: Baole Fang 
AuthorDate: Wed Apr 19 19:15:24 2023 -0400
Commit: Heiko Tietze 
CommitDate: Fri Apr 21 09:14:09 2023 +0200

tdf#154731: Hide Zoom & View Layout dialog

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

diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index 0d6f44e405fd..7bef6a5b9860 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -264,7 +264,7 @@ SvxZoomDialog::SvxZoomDialog(weld::Window* pParent, const 
SfxItemSet& rCoreSet)
 else
 {
 // hide view layout related controls:
-m_xViewFrame->set_sensitive(false);
+m_xViewFrame->set_visible(false);
 }
 }
 


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

2023-04-20 Thread Baole Fang (via logerrit)
 include/svx/strings.hrc  |1 +
 include/svx/zoomctrl.hxx |1 +
 svx/source/stbctrls/zoomctrl.cxx |   21 +
 3 files changed, 23 insertions(+)

New commits:
commit 91148ed5d5ef3428a39676bec672ccb5918ff19a
Author: Baole Fang 
AuthorDate: Wed Apr 19 14:14:10 2023 -0400
Commit: Mike Kaganski 
CommitDate: Thu Apr 20 17:40:39 2023 +0200

tdf#154732: Fix zoom bar in Draw

Oringally, the zoom bar in both Draw and Impress show
"Fit slide to current window."
Now, the zoom bar in Draw is modified into
"Fit page to current window.", while Impress still uses "slide".

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

diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index b5b64bfd6304..7799a69bca11 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1324,6 +1324,7 @@
 #define RID_SVXSTR_DOC_MODIFIED_NO  
NC_("RID_SVXSTR_DOC_MODIFIED_NO", "The document has not been modified since the 
last save.")
 #define RID_SVXSTR_DOC_LOAD 
NC_("RID_SVXSTR_DOC_LOAD", "Loading document...")
 #define RID_SVXSTR_FIT_SLIDE
NC_("RID_SVXSTR_FIT_SLIDE", "Fit slide to current window.")
+#define RID_SVXSTR_FIT_PAGE 
NC_("RID_SVXSTR_FIT_PAGE", "Fit page to current window.")
 #define RID_SVXSTR_WARN_MISSING_SMARTART
NC_("RID_SVXSTR_WARN_MISSING_SMARTART", "Could not load all SmartArt objects. 
Saving in Microsoft Office 2010 or later would avoid this issue.")
 #define RID_SVXSTR_TABLECELL_HINT   
NC_("RID_SVXSTR_TABLECELL_HINT", "Table cell address. Click to open Table 
Properties dialog.")
 #define RID_SVXSTR_SECTION_HINT 
NC_("RID_SVXSTR_SECTION_HINT", "Section name. Click to open Edit Sections 
dialog.")
diff --git a/include/svx/zoomctrl.hxx b/include/svx/zoomctrl.hxx
index 0c64db1e5efa..15ccb03f5747 100644
--- a/include/svx/zoomctrl.hxx
+++ b/include/svx/zoomctrl.hxx
@@ -52,6 +52,7 @@ private:
 public:
 virtual void Paint(const UserDrawEvent& rEvt) override;
 virtual bool MouseButtonDown(const MouseEvent& rEvt) override;
+virtual void SAL_CALL initialize(const css::uno::Sequence& 
aArguments) override;
 
 SFX_DECL_STATUSBAR_CONTROL();
 
diff --git a/svx/source/stbctrls/zoomctrl.cxx b/svx/source/stbctrls/zoomctrl.cxx
index 001ba0ec1e3b..3faaa17073f2 100644
--- a/svx/source/stbctrls/zoomctrl.cxx
+++ b/svx/source/stbctrls/zoomctrl.cxx
@@ -39,6 +39,7 @@
 #include 
 
 #include 
+#include 
 
 SFX_IMPL_STATUSBAR_CONTROL(SvxZoomStatusBarControl,SvxZoomItem);
 
@@ -203,6 +204,26 @@ 
SvxZoomPageStatusBarControl::SvxZoomPageStatusBarControl(sal_uInt16 _nSlotId,
 GetStatusBar().SetQuickHelpText(GetId(), SvxResId(RID_SVXSTR_FIT_SLIDE));
 }
 
+void SAL_CALL SvxZoomPageStatusBarControl::initialize( const 
css::uno::Sequence< css::uno::Any >& aArguments )
+{
+// Call inherited initialize
+StatusbarController::initialize(aArguments);
+
+// Get document type
+css::uno::Reference< css::frame::XModuleManager2 > xModuleManager = 
css::frame::ModuleManager::create( m_xContext );
+OUString aModuleIdentifier = xModuleManager->identify( 
css::uno::Reference( m_xFrame, 
css::uno::UnoReference_Query::UNO_QUERY ) );
+
+// Decide what to show in zoom bar
+if ( aModuleIdentifier == "com.sun.star.drawing.DrawingDocument" )
+{
+GetStatusBar().SetQuickHelpText(GetId(), 
SvxResId(RID_SVXSTR_FIT_PAGE));
+}
+else if ( aModuleIdentifier == 
"com.sun.star.presentation.PresentationDocument" )
+{
+GetStatusBar().SetQuickHelpText(GetId(), 
SvxResId(RID_SVXSTR_FIT_SLIDE));
+}
+}
+
 void SvxZoomPageStatusBarControl::Paint(const UserDrawEvent& rUsrEvt)
 {
 vcl::RenderContext* pDev = rUsrEvt.GetRenderContext();


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

2023-04-11 Thread Baole Fang (via logerrit)
 sd/inc/strings.hrc |2 ++
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |6 +-
 sd/source/ui/view/drviewsa.cxx |6 +-
 sd/source/ui/view/outlnvsh.cxx |5 -
 4 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 487010ef62405a1a728ae9b3d838e934015b1719
Author: Baole Fang 
AuthorDate: Tue Mar 28 22:50:30 2023 -0400
Commit: Heiko Tietze 
CommitDate: Tue Apr 11 15:24:43 2023 +0200

tdf#150477: Change "Slide" to "Page" in Draw status bar

Originally, Draw displays "Slide x of y".
Now, a new string is added, so that it displays "Page x of y".

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

diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 81c54ccb8e86..187a411dc38e 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -94,6 +94,8 @@
 #define STR_SVX_FILENC_("STR_SVX_FILE", 
"Amiga SVX Audio")
 #define STR_SD_PAGE_COUNT   
NC_("STR_SD_PAGE_COUNT", "Slide %1 of %2")
 #define STR_SD_PAGE_COUNT_CUSTOM
NC_("STR_SD_PAGE_COUNT_CUSTOM", "Slide %1 of %2 (%3)")
+#define STR_SD_PAGE_COUNT_DRAW  
NC_("STR_SD_PAGE_COUNT_DRAW", "Page %1 of %2")
+#define STR_SD_PAGE_COUNT_CUSTOM_DRAW   
NC_("STR_SD_PAGE_COUNT_CUSTOM_DRAW", "Page %1 of %2 (%3)")
 #define STR_ALL_SUPPORTED_FORMATS   
NC_("STR_ALL_SUPPORTED_FORMATS", "All supported formats")
 #define STR_ALL_FILES   NC_("STR_ALL_FILES", 
"All files")
 #define STR_UNDO_INSERT_TEXTFRAME   
NC_("STR_UNDO_INSERT_TEXTFRAME", "Insert text frame")
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx 
b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 2bd908fe93d0..d1c130ae3a8f 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -820,6 +820,7 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
 // page view and layout
 SdPage* pPage  = nullptr;
 sal_uInt16 nSelectedPages = 
mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount();
+View* pDrView = ();
 
 //Set number of slides
 if (nSelectedPages > 0)
@@ -836,7 +837,10 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
 sal_Int32 nPageCount = mrSlideSorter.GetModel().GetPageCount();
 sal_Int32 nActivePageCount = 
static_cast(mrSlideSorter.GetModel().GetDocument()->GetActiveSdPageCount());
 
-aPageStr = (nPageCount == nActivePageCount) ? 
SdResId(STR_SD_PAGE_COUNT) : SdResId(STR_SD_PAGE_COUNT_CUSTOM);
+if (pDrView->GetDoc().GetDocumentType() == DocumentType::Draw)
+aPageStr = (nPageCount == nActivePageCount) ? 
SdResId(STR_SD_PAGE_COUNT_DRAW) : SdResId(STR_SD_PAGE_COUNT_CUSTOM_DRAW);
+else
+aPageStr = (nPageCount == nActivePageCount) ? 
SdResId(STR_SD_PAGE_COUNT) : SdResId(STR_SD_PAGE_COUNT_CUSTOM);
 
 aPageStr = aPageStr.replaceFirst("%1", 
OUString::number(nFirstPage));
 aPageStr = aPageStr.replaceFirst("%2", 
OUString::number(nPageCount));
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index b09944043c24..34324d3aa93f 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -656,7 +656,11 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
 sal_Int32 nPageCount = sal_Int32(GetDoc()->GetSdPageCount(mePageKind));
 sal_Int32 nActivePageCount = 
sal_Int32(GetDoc()->GetActiveSdPageCount());
 // Always show the slide/page number.
-OUString aOUString = (nPageCount == nActivePageCount) ? 
SdResId(STR_SD_PAGE_COUNT) : SdResId(STR_SD_PAGE_COUNT_CUSTOM);
+OUString aOUString;
+if (GetDoc()->GetDocumentType() == DocumentType::Draw)
+aOUString = (nPageCount == nActivePageCount) ? 
SdResId(STR_SD_PAGE_COUNT_DRAW) : SdResId(STR_SD_PAGE_COUNT_CUSTOM_DRAW);
+else
+aOUString = (nPageCount == nActivePageCount) ? 
SdResId(STR_SD_PAGE_COUNT) : SdResId(STR_SD_PAGE_COUNT_CUSTOM);
 
 aOUString = aOUString.replaceFirst("%1", 
OUString::number(maTabControl->GetCurPagePos() + 1));
 aOUString = aOUString.replaceFirst("%2", OUString::number(nPageCount));
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 1d3bd9500841..8add43b4ad4b 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1320,7 +1320,10 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& 
rSet)
 
 SdrPage* pPage = GetDoc()->GetSdPage( static_cast(nPos), 
PageKind::Standard );
 
-aPageStr = 

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

2023-04-07 Thread Baole Fang (via logerrit)
 sd/inc/strings.hrc |1 -
 sd/source/ui/docshell/docshel2.cxx |   11 ---
 2 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 04bf1d2385ed80e7aee8015dc69e868c2abe4142
Author: Baole Fang 
AuthorDate: Tue Mar 28 23:18:37 2023 -0400
Commit: Mike Kaganski 
CommitDate: Fri Apr 7 16:30:21 2023 +0200

tdf#154437: Check "Page" instead of "Slide" in Draw rename

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

diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index c9a48bfe3574..81c54ccb8e86 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -92,7 +92,6 @@
 #define STR_VOC_FILENC_("STR_VOC_FILE", 
"Creative Labs Audio")
 #define STR_AIFF_FILE   NC_("STR_AIFF_FILE", 
"Apple/SGI Audio")
 #define STR_SVX_FILENC_("STR_SVX_FILE", 
"Amiga SVX Audio")
-#define STR_SD_PAGE NC_("STR_SD_PAGE", 
"Slide")
 #define STR_SD_PAGE_COUNT   
NC_("STR_SD_PAGE_COUNT", "Slide %1 of %2")
 #define STR_SD_PAGE_COUNT_CUSTOM
NC_("STR_SD_PAGE_COUNT_CUSTOM", "Slide %1 of %2 (%3)")
 #define STR_ALL_SUPPORTED_FORMATS   
NC_("STR_ALL_SUPPORTED_FORMATS", "All supported formats")
diff --git a/sd/source/ui/docshell/docshel2.cxx 
b/sd/source/ui/docshell/docshel2.cxx
index caf0fc86f1b1..582afec0517a 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -305,12 +305,17 @@ bool DrawDocShell::IsNewPageNameValid( OUString & 
rInOutPageName, bool bResetStr
 {
 bool bCanUseNewName = false;
 
-// check if name is something like 'Slide n'
-OUString aStrPage(SdResId(STR_SD_PAGE) + " ");
+// check if name is something like 'Slide/Page n'
+OUString aStrPage;
+if (GetDoc()->GetDocumentType() == DocumentType::Draw)
+aStrPage = SdResId(STR_PAGE_NAME) + " ";
+else
+// using the same strings as SdPage::GetName
+aStrPage = SdResId(STR_PAGE) + " ";
 
 bool bIsStandardName = false;
 
-// prevent also _future_ slide names of the form "'STR_SD_PAGE' + ' ' + 
'[0-9]+|[a-z]|[A-Z]|[CDILMVX]+|[cdilmvx]+'"
+// prevent also _future_ slide names of the form "'STR_PAGE' + ' ' + 
'[0-9]+|[a-z]|[A-Z]|[CDILMVX]+|[cdilmvx]+'"
 // (arabic, lower- and upper case single letter, lower- and upper case 
roman numbers)
 if (rInOutPageName.startsWith(aStrPage) &&
 rInOutPageName.getLength() > aStrPage.getLength())


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

2023-03-20 Thread Baole Fang (via logerrit)
 sc/qa/unit/data/xml/tdf153514.xml   |   15 
 sc/qa/unit/subsequent_filters_test4.cxx |   38 
 2 files changed, 53 insertions(+)

New commits:
commit 8cf73a9a8227f90217c595be04519f0c3692754c
Author: Baole Fang 
AuthorDate: Sat Mar 18 00:52:25 2023 -0400
Commit: Mike Kaganski 
CommitDate: Tue Mar 21 04:34:23 2023 +

tdf#153514: sc_subsequent_filters_test4: Add unittest

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

diff --git a/sc/qa/unit/data/xml/tdf153514.xml 
b/sc/qa/unit/data/xml/tdf153514.xml
new file mode 100644
index ..8715925a1d58
--- /dev/null
+++ b/sc/qa/unit/data/xml/tdf153514.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sc/qa/unit/subsequent_filters_test4.cxx 
b/sc/qa/unit/subsequent_filters_test4.cxx
index ec22e998d611..21a918086304 100644
--- a/sc/qa/unit/subsequent_filters_test4.cxx
+++ b/sc/qa/unit/subsequent_filters_test4.cxx
@@ -981,6 +981,44 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, 
testColorScaleNumWithRefXLSX)
  
pColorScaleEntry->GetFormula(formula::FormulaGrammar::GRAM_NATIVE));
 }
 
+CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testTdf153514)
+{
+ScDocument aDoc;
+OUString aFullUrl = 
m_directories.getURLFromSrc(u"sc/qa/unit/data/xml/tdf153514.xml");
+
+OUString aValidPath;
+osl::FileBase::getSystemPathFromFileURL(aFullUrl, aValidPath);
+
+ScOrcusFilters* pOrcus = ScFormatFilter::Get().GetOrcusFilters();
+CPPUNIT_ASSERT(pOrcus);
+
+pOrcus->importODS_Styles(aDoc, aValidPath);
+ScStyleSheetPool* pStyleSheetPool = aDoc.GetStyleSheetPool();
+
+ScStyleSheet* pStyleSheet;
+// Case sensitive tests
+pStyleSheet = pStyleSheetPool->FindCaseIns("aBcD", SfxStyleFamily::Para);
+CPPUNIT_ASSERT_EQUAL(OUString("aBcD"), pStyleSheet->GetName());
+pStyleSheet = pStyleSheetPool->FindCaseIns("abCd", SfxStyleFamily::Para);
+CPPUNIT_ASSERT_EQUAL(OUString("abCd"), pStyleSheet->GetName());
+pStyleSheet = pStyleSheetPool->FindCaseIns("Abcd", SfxStyleFamily::Para);
+CPPUNIT_ASSERT_EQUAL(OUString("Abcd"), pStyleSheet->GetName());
+pStyleSheet = pStyleSheetPool->FindCaseIns("ABCD", SfxStyleFamily::Para);
+CPPUNIT_ASSERT_EQUAL(OUString("ABCD"), pStyleSheet->GetName());
+// Case insensitive tests
+pStyleSheet = pStyleSheetPool->FindCaseIns("abcd", SfxStyleFamily::Para);
+CPPUNIT_ASSERT(pStyleSheet);
+CPPUNIT_ASSERT(pStyleSheet->GetName().equalsIgnoreAsciiCase("abcd"));
+CPPUNIT_ASSERT(pStyleSheet->GetName() != "abcd");
+pStyleSheet = pStyleSheetPool->FindCaseIns("ABCd", SfxStyleFamily::Para);
+CPPUNIT_ASSERT(pStyleSheet);
+CPPUNIT_ASSERT(pStyleSheet->GetName().equalsIgnoreAsciiCase("ABCd"));
+CPPUNIT_ASSERT(pStyleSheet->GetName() != "ABCd");
+// Not match tests
+pStyleSheet = pStyleSheetPool->FindCaseIns("NotFound", 
SfxStyleFamily::Para);
+CPPUNIT_ASSERT(!pStyleSheet);
+}
+
 CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testOrcusODSStyleInterface)
 {
 ScDocument aDoc;


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

2023-03-17 Thread Baole Fang (via logerrit)
 desktop/source/app/dispatchwatcher.cxx |   45 -
 1 file changed, 22 insertions(+), 23 deletions(-)

New commits:
commit 70b8adb100499178ad52f23f7c0a1b7a31129921
Author: Baole Fang 
AuthorDate: Thu Mar 16 20:47:03 2023 -0400
Commit: Mike Kaganski 
CommitDate: Fri Mar 17 19:52:06 2023 +

tdf#153683: Refactor fix

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

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index f314fcd0ff4b..b00cff042b7e 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -285,41 +285,38 @@ void batchPrint( std::u16string_view rPrinterName, const 
Reference< XPrintable >
 }
 
 // Get xDoc module name
-OUString getName(const Reference< XPrintable > & xDoc)
+OUString getName(const Reference< XInterface > & xDoc)
 {
-OUString aDocService;
 Reference< XModel > xModel( xDoc, UNO_QUERY );
-const Reference xServiceInfo(xModel, UNO_QUERY_THROW);
-if ( xModel.is() )
-{
-utl::MediaDescriptor aMediaDesc( xModel->getArgs() );
-aDocService = 
aMediaDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_DOCUMENTSERVICE,
 OUString() );
-}
-OString aModuleId = OUStringToOString(aDocService, 
osl_getThreadTextEncoding());
-if (aModuleId == "com.sun.star.text.TextDocument"
-|| aModuleId == "com.sun.star.text.GlobalDocument")
+if (!xModel)
+return OUString();
+utl::MediaDescriptor aMediaDesc( xModel->getArgs() );
+OUString aDocService = 
aMediaDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_DOCUMENTSERVICE,
 OUString() );
+if (aDocService == "com.sun.star.text.TextDocument")
 return "Writer";
-else if (aModuleId == "com.sun.star.text.WebDocument")
+else if (aDocService == "com.sun.star.text.GlobalDocument")
+return "Writer master";
+else if (aDocService == "com.sun.star.text.WebDocument")
 return "Writer/Web";
-else if (aModuleId == "com.sun.star.drawing.DrawingDocument")
+else if (aDocService == "com.sun.star.drawing.DrawingDocument")
 return "Draw";
-else if (aModuleId == "com.sun.star.presentation.PresentationDocument")
+else if (aDocService == "com.sun.star.presentation.PresentationDocument")
 return "Impress";
-else if (aModuleId == "com.sun.star.sheet.SpreadsheetDocument")
+else if (aDocService == "com.sun.star.sheet.SpreadsheetDocument")
 return "Calc";
-else if (aModuleId == "com.sun.star.script.BasicIDE")
+else if (aDocService == "com.sun.star.script.BasicIDE")
 return "Basic";
-else if (aModuleId == "com.sun.star.formula.FormulaProperties")
+else if (aDocService == "com.sun.star.formula.FormulaProperties")
 return "Math";
-else if (aModuleId == "com.sun.star.sdb.RelationDesign")
+else if (aDocService == "com.sun.star.sdb.RelationDesign")
 return "Relation Design";
-else if (aModuleId == "com.sun.star.sdb.QueryDesign")
+else if (aDocService == "com.sun.star.sdb.QueryDesign")
 return "Query Design";
-else if (aModuleId == "com.sun.star.sdb.TableDesign")
+else if (aDocService == "com.sun.star.sdb.TableDesign")
 return "Table Design";
-else if (aModuleId == "com.sun.star.sdb.DataSourceBrowser")
+else if (aDocService == "com.sun.star.sdb.DataSourceBrowser")
 return "Data Source Browser";
-else if (aModuleId == "com.sun.star.sdb.DatabaseDocument")
+else if (aDocService == "com.sun.star.sdb.DatabaseDocument")
 return "Database";
 
 return OUString();
@@ -704,8 +701,10 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector " << aTargetURL8 << 
" as a " << name <<" document";
+std::cout << " -> " << aTargetURL8;
 std::cout << " using filter : " << 
OUStringToOString(aFilter, osl_getThreadTextEncoding()) << std::endl;
 if (!bMultiFileTarget && 
FStatHelper::IsDocument(aOutFile))
 std::cout << "Overwriting: " << 
OUStringToOString(aTempName, osl_getThreadTextEncoding()) << std::endl ;


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

2023-03-16 Thread Baole Fang (via logerrit)
 basic/source/runtime/runtime.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit d34a3c92eb68b7f0b2cef698639a2853e19a898f
Author: Baole Fang 
AuthorDate: Thu Mar 16 21:25:58 2023 -0400
Commit: Mike Kaganski 
CommitDate: Fri Mar 17 04:46:46 2023 +

tdf#152690: Refactor fix

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

diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 69eeb19b1d1f..abcee4bcc42d 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1491,7 +1491,8 @@ namespace
 case '[':
 sResult.append(*start++);
 seenright = 0;
-if (start < end && *start=='!'){
+if (start < end && *start == '!')
+{
 sResult.append('^');
 start++;
 }


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

2023-03-16 Thread Baole Fang (via logerrit)
 basic/qa/basic_coverage/test_like.bas |   41 +
 basic/qa/cppunit/test_vba.cxx |1 
 basic/qa/vba_tests/like.vb|   42 ++
 basic/source/runtime/runtime.cxx  |7 +++--
 4 files changed, 88 insertions(+), 3 deletions(-)

New commits:
commit e12fff12b66561bc46a0e22f58919efa443e7e17
Author: Baole Fang 
AuthorDate: Sat Mar 11 21:39:23 2023 -0500
Commit: Mike Kaganski 
CommitDate: Thu Mar 16 21:14:20 2023 +

tdf#152690: Fix "!" behavior when it is not the first in a group

Fix "!" behavior when it is not the first in a group.
Add testcases for "!" and Like.

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

diff --git a/basic/qa/basic_coverage/test_like.bas 
b/basic/qa/basic_coverage/test_like.bas
new file mode 100644
index ..2d018bf64f01
--- /dev/null
+++ b/basic/qa/basic_coverage/test_like.bas
@@ -0,0 +1,41 @@
+'
+' This file is part of the LibreOffice project.
+'
+' This Source Code Form is subject to the terms of the Mozilla Public
+' License, v. 2.0. If a copy of the MPL was not distributed with this
+' file, You can obtain one at http://mozilla.org/MPL/2.0/.
+'
+
+Option Explicit
+
+Function doUnitTest() As String
+TestUtil.TestInit
+verify_testLike
+doUnitTest = TestUtil.GetResult()
+End Function
+
+Sub verify_testLike()
+On Error GoTo errorHandler
+' Negation test
+TestUtil.AssertEqual("!" Like "[.!?]",  True, "Negation1")
+TestUtil.AssertEqual("a" Like "[!abc]",  False, "Negation2")
+TestUtil.AssertEqual("!" Like "[!!?]", False, "Negation3")
+TestUtil.AssertEqual("^" Like "[.!?]", False, "Negation4")
+TestUtil.AssertEqual("^" Like "[.^?]", True, "Negation5")
+' Like test from microsoft vba
+TestUtil.AssertEqual("aBBBa" Like "a*a", True, "Like1")
+TestUtil.AssertEqual("F" Like "[A-Z]", True, "Like2")
+TestUtil.AssertEqual("F" Like "[!A-Z]", False, "Like3")
+TestUtil.AssertEqual("a2a" Like "a#a", True, "Like4")
+TestUtil.AssertEqual("aM5b" Like "a[L-P]#[!c-e]", True, "Like5")
+TestUtil.AssertEqual("BAT123khg" Like "B?T*", True, "Like6")
+TestUtil.AssertEqual("CAT123khg" Like "B?T*", False, "Like7")
+TestUtil.AssertEqual("ab" Like "a*b", True, "Like8")
+TestUtil.AssertEqual("a*b" Like "a [*]b", False, "Like9")
+TestUtil.AssertEqual("axb" Like "a [*]b", False, "Like10")
+TestUtil.AssertEqual("a [xyz" Like "a [[]*", True, "Like11")
+
+Exit Sub
+errorHandler:
+TestUtil.ReportErrorHandler("verify_testLike", Err, Error$, Erl)
+End Sub
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index b778d393019b..8a15ba7234e8 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -114,6 +114,7 @@ void VBATest::testMiscVBAFunctions()
 "minute.vb",
 "month.vb",
 "monthname.vb",
+"like.vb",
 "oct.vb",
 "optional_paramters.vb",
 "qbcolor.vb",
diff --git a/basic/qa/vba_tests/like.vb b/basic/qa/vba_tests/like.vb
new file mode 100644
index ..c3be1e081b16
--- /dev/null
+++ b/basic/qa/vba_tests/like.vb
@@ -0,0 +1,42 @@
+'
+' This file is part of the LibreOffice project.
+'
+' This Source Code Form is subject to the terms of the Mozilla Public
+' License, v. 2.0. If a copy of the MPL was not distributed with this
+' file, You can obtain one at http://mozilla.org/MPL/2.0/.
+'
+
+Option VBASupport 1
+Option Explicit
+
+Function doUnitTest() As String
+TestUtil.TestInit
+verify_testLike
+doUnitTest = TestUtil.GetResult()
+End Function
+
+Sub verify_testLike()
+On Error GoTo errorHandler
+' Negation test
+TestUtil.AssertEqual("!" Like "[.!?]",  True, "Negation1")
+TestUtil.AssertEqual("a" Like "[!abc]",  False, "Negation2")
+TestUtil.AssertEqual("!" Like "[!!?]", False, "Negation3")
+TestUtil.AssertEqual("^" Like "[.!?]", False, "Negation4")
+TestUtil.AssertEqual("^" Like "[.^?]", True, "Negation5")
+' Like test from microsoft vba
+TestUtil.AssertEqual("aBBBa" Like "a*a", True, "Like1")
+TestUtil.AssertEqual("F" Like "[A-Z]", True, "Like2")
+TestUtil.AssertEqual("F" Like "[!A-Z]", False, "Like3")
+TestUtil.AssertEqual("a2a" Like "a#a", True, "Like4")
+TestUtil.AssertEqual("aM5b" Like "a[L-P]#[!c-e]", True, "Like5")
+TestUtil.AssertEqual("BAT123khg" Like "B?T*", True, "Like6")
+TestUtil.AssertEqual("CAT123khg" Like "B?T*", False, "Like7")
+TestUtil.AssertEqual("ab" Like "a*b", True, "Like8")
+TestUtil.AssertEqual("a*b" Like "a [*]b", False, "Like9")
+TestUtil.AssertEqual("axb" Like "a [*]b", False, "Like10")
+TestUtil.AssertEqual("a [xyz" Like "a [[]*", True, "Like11")
+
+Exit Sub
+errorHandler:
+TestUtil.ReportErrorHandler("verify_testLike", Err, Error$, Erl)

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

2023-03-16 Thread Baole Fang (via logerrit)
 io/source/TextInputStream/TextInputStream.cxx |   18 ++
 1 file changed, 18 insertions(+)

New commits:
commit bf6d1e58031c56dbe85995572deabd35200c9c74
Author: Baole Fang 
AuthorDate: Mon Mar 13 18:34:50 2023 -0400
Commit: Michael Stahl 
CommitDate: Thu Mar 16 09:23:33 2023 +

tdf#150135: Fix OTextInputStream to throw runtime exception when 
uninitialized

New method checkNull is added to the class to throw a runtime error if 
mxStream is uninitialized. It is run in the beginning of all methods that 
require an initialized mxStream.

Change-Id: Ia1f15d90c79c71b2a2350d9b60ef1bf68fb9009c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148819
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 16242898da50fbf680df558cb47d1978c3304572)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148872
Reviewed-by: Michael Stahl 

diff --git a/io/source/TextInputStream/TextInputStream.cxx 
b/io/source/TextInputStream/TextInputStream.cxx
index 9f7c884725cd..1ce12a6e796e 100644
--- a/io/source/TextInputStream/TextInputStream.cxx
+++ b/io/source/TextInputStream/TextInputStream.cxx
@@ -72,6 +72,8 @@ class OTextInputStream : public WeakImplHelper< 
XTextInputStream2, XServiceInfo
 /// @throws IOException
 /// @throws RuntimeException
 sal_Int32 implReadNext();
+/// @throws RuntimeException
+void checkNull();
 
 public:
 OTextInputStream();
@@ -122,22 +124,33 @@ OTextInputStream::~OTextInputStream()
 }
 }
 
+// Check uninitialized object
+
+void OTextInputStream::checkNull()
+{
+if (mxStream==nullptr){
+throw RuntimeException("Uninitialized object");
+}
+}
 
 // XTextInputStream
 
 OUString OTextInputStream::readLine(  )
 {
+checkNull();
 static Sequence< sal_Unicode > aDummySeq;
 return implReadString( aDummySeq, true, true );
 }
 
 OUString OTextInputStream::readString( const Sequence< sal_Unicode >& 
Delimiters, sal_Bool bRemoveDelimiter )
 {
+checkNull();
 return implReadString( Delimiters, bRemoveDelimiter, false );
 }
 
 sal_Bool OTextInputStream::isEOF()
 {
+checkNull();
 bool bRet = false;
 if( mnCharsInBuffer == 0 && mbReachedEOF )
 bRet = true;
@@ -337,26 +350,31 @@ void OTextInputStream::setEncoding( const OUString& 
Encoding )
 
 sal_Int32 OTextInputStream::readBytes( Sequence< sal_Int8 >& aData, sal_Int32 
nBytesToRead )
 {
+checkNull();
 return mxStream->readBytes( aData, nBytesToRead );
 }
 
 sal_Int32 OTextInputStream::readSomeBytes( Sequence< sal_Int8 >& aData, 
sal_Int32 nMaxBytesToRead )
 {
+checkNull();
 return mxStream->readSomeBytes( aData, nMaxBytesToRead );
 }
 
 void OTextInputStream::skipBytes( sal_Int32 nBytesToSkip )
 {
+checkNull();
 mxStream->skipBytes( nBytesToSkip );
 }
 
 sal_Int32 OTextInputStream::available(  )
 {
+checkNull();
 return mxStream->available();
 }
 
 void OTextInputStream::closeInput(  )
 {
+checkNull();
 mxStream->closeInput();
 }
 


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

2023-03-16 Thread Baole Fang (via logerrit)
 desktop/source/app/dispatchwatcher.cxx |   44 -
 1 file changed, 43 insertions(+), 1 deletion(-)

New commits:
commit 80d5d2eb70fd84e98cbe19cd4363d12d50ec31f6
Author: Baole Fang 
AuthorDate: Wed Mar 15 01:51:12 2023 -0400
Commit: Noel Grandin 
CommitDate: Thu Mar 16 06:36:22 2023 +

tdf#153683: Show the used module in --convert-to

Implements getName that returns the module name.
When outputs the convert-to message, module name is included.

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

diff --git a/desktop/source/app/dispatchwatcher.cxx 
b/desktop/source/app/dispatchwatcher.cxx
index 5b7fd944fee9..f314fcd0ff4b 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -284,6 +284,47 @@ void batchPrint( std::u16string_view rPrinterName, const 
Reference< XPrintable >
 xDoc->print( aPrinterArgs );
 }
 
+// Get xDoc module name
+OUString getName(const Reference< XPrintable > & xDoc)
+{
+OUString aDocService;
+Reference< XModel > xModel( xDoc, UNO_QUERY );
+const Reference xServiceInfo(xModel, UNO_QUERY_THROW);
+if ( xModel.is() )
+{
+utl::MediaDescriptor aMediaDesc( xModel->getArgs() );
+aDocService = 
aMediaDesc.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_DOCUMENTSERVICE,
 OUString() );
+}
+OString aModuleId = OUStringToOString(aDocService, 
osl_getThreadTextEncoding());
+if (aModuleId == "com.sun.star.text.TextDocument"
+|| aModuleId == "com.sun.star.text.GlobalDocument")
+return "Writer";
+else if (aModuleId == "com.sun.star.text.WebDocument")
+return "Writer/Web";
+else if (aModuleId == "com.sun.star.drawing.DrawingDocument")
+return "Draw";
+else if (aModuleId == "com.sun.star.presentation.PresentationDocument")
+return "Impress";
+else if (aModuleId == "com.sun.star.sheet.SpreadsheetDocument")
+return "Calc";
+else if (aModuleId == "com.sun.star.script.BasicIDE")
+return "Basic";
+else if (aModuleId == "com.sun.star.formula.FormulaProperties")
+return "Math";
+else if (aModuleId == "com.sun.star.sdb.RelationDesign")
+return "Relation Design";
+else if (aModuleId == "com.sun.star.sdb.QueryDesign")
+return "Query Design";
+else if (aModuleId == "com.sun.star.sdb.TableDesign")
+return "Table Design";
+else if (aModuleId == "com.sun.star.sdb.DataSourceBrowser")
+return "Data Source Browser";
+else if (aModuleId == "com.sun.star.sdb.DatabaseDocument")
+return "Database";
+
+return OUString();
+}
+
 } // anonymous namespace
 
 DispatchWatcher::DispatchWatcher()
@@ -661,9 +702,10 @@ bool DispatchWatcher::executeDispatchRequests( const 
std::vector " << aTargetURL8;
+std::cout << " -> " << aTargetURL8 << 
" as a " << name <<" document";
 std::cout << " using filter : " << 
OUStringToOString(aFilter, osl_getThreadTextEncoding()) << std::endl;
 if (!bMultiFileTarget && 
FStatHelper::IsDocument(aOutFile))
 std::cout << "Overwriting: " << 
OUStringToOString(aTempName, osl_getThreadTextEncoding()) << std::endl ;


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

2023-03-14 Thread Baole Fang (via logerrit)
 sc/source/ui/vba/vbaapplication.cxx |5 ++---
 sc/source/ui/vba/vbaapplication.hxx |2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 20c7df24b2df57f4bbd62d08cc759ad62d6512ce
Author: Baole Fang 
AuthorDate: Tue Mar 14 11:13:59 2023 -0400
Commit: Mike Kaganski 
CommitDate: Wed Mar 15 05:38:20 2023 +

Refactor InchesToPoints in Calc

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

diff --git a/sc/source/ui/vba/vbaapplication.cxx 
b/sc/source/ui/vba/vbaapplication.cxx
index 59088788b4d7..d9e5ba984f5a 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -1329,11 +1329,10 @@ uno::Reference< excel::XRange > SAL_CALL 
ScVbaApplication::Union(
 return lclCreateVbaRange( mxContext, getCurrentDocument(), aList );
 }
 
-double
+double SAL_CALL
 ScVbaApplication::InchesToPoints( double Inches )
 {
-   double result = Inches * 72.0;
-   return result;
+   return o3tl::convert(Inches, o3tl::Length::in, o3tl::Length::pt);
 }
 
 double SAL_CALL
diff --git a/sc/source/ui/vba/vbaapplication.hxx 
b/sc/source/ui/vba/vbaapplication.hxx
index 3c0ed903f9d1..4a049100b608 100644
--- a/sc/source/ui/vba/vbaapplication.hxx
+++ b/sc/source/ui/vba/vbaapplication.hxx
@@ -143,7 +143,7 @@ public:
 virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Intersect( const 
css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< 
ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& 
Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const 
css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, 
const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& 
Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const 
css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, 
const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& 
Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const 
css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, 
const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& 
Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) override;
 virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const 
css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< 
ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& 
Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const 
css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, 
const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& 
Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const 
css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, 
const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& 
Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const 
css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, 
const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& 
Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) override;
 virtual double SAL_CALL CentimetersToPoints( double Centimeters ) override;
-virtual double SAL_CALL InchesToPoints( double InchesToPoints ) override;
+virtual double SAL_CALL InchesToPoints( double Inches ) override;
 virtual void SAL_CALL Volatile( const css::uno::Any& Volatile ) override;
 virtual css::uno::Any SAL_CALL MenuBars( const css::uno::Any& aIndex ) 
override;
 virtual css::uno::Any SAL_CALL Rows( const css::uno::Any& aIndex ) 
override;


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

2023-03-14 Thread Baole Fang (via logerrit)
 io/source/TextInputStream/TextInputStream.cxx |   18 ++
 1 file changed, 18 insertions(+)

New commits:
commit 16242898da50fbf680df558cb47d1978c3304572
Author: Baole Fang 
AuthorDate: Mon Mar 13 18:34:50 2023 -0400
Commit: Noel Grandin 
CommitDate: Tue Mar 14 06:47:26 2023 +

tdf#150135: Fix OTextInputStream to throw runtime exception when 
uninitialized

New method checkNull is added to the class to throw a runtime error if 
mxStream is uninitialized. It is run in the beginning of all methods that 
require an initialized mxStream.

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

diff --git a/io/source/TextInputStream/TextInputStream.cxx 
b/io/source/TextInputStream/TextInputStream.cxx
index 9f7c884725cd..1ce12a6e796e 100644
--- a/io/source/TextInputStream/TextInputStream.cxx
+++ b/io/source/TextInputStream/TextInputStream.cxx
@@ -72,6 +72,8 @@ class OTextInputStream : public WeakImplHelper< 
XTextInputStream2, XServiceInfo
 /// @throws IOException
 /// @throws RuntimeException
 sal_Int32 implReadNext();
+/// @throws RuntimeException
+void checkNull();
 
 public:
 OTextInputStream();
@@ -122,22 +124,33 @@ OTextInputStream::~OTextInputStream()
 }
 }
 
+// Check uninitialized object
+
+void OTextInputStream::checkNull()
+{
+if (mxStream==nullptr){
+throw RuntimeException("Uninitialized object");
+}
+}
 
 // XTextInputStream
 
 OUString OTextInputStream::readLine(  )
 {
+checkNull();
 static Sequence< sal_Unicode > aDummySeq;
 return implReadString( aDummySeq, true, true );
 }
 
 OUString OTextInputStream::readString( const Sequence< sal_Unicode >& 
Delimiters, sal_Bool bRemoveDelimiter )
 {
+checkNull();
 return implReadString( Delimiters, bRemoveDelimiter, false );
 }
 
 sal_Bool OTextInputStream::isEOF()
 {
+checkNull();
 bool bRet = false;
 if( mnCharsInBuffer == 0 && mbReachedEOF )
 bRet = true;
@@ -337,26 +350,31 @@ void OTextInputStream::setEncoding( const OUString& 
Encoding )
 
 sal_Int32 OTextInputStream::readBytes( Sequence< sal_Int8 >& aData, sal_Int32 
nBytesToRead )
 {
+checkNull();
 return mxStream->readBytes( aData, nBytesToRead );
 }
 
 sal_Int32 OTextInputStream::readSomeBytes( Sequence< sal_Int8 >& aData, 
sal_Int32 nMaxBytesToRead )
 {
+checkNull();
 return mxStream->readSomeBytes( aData, nMaxBytesToRead );
 }
 
 void OTextInputStream::skipBytes( sal_Int32 nBytesToSkip )
 {
+checkNull();
 mxStream->skipBytes( nBytesToSkip );
 }
 
 sal_Int32 OTextInputStream::available(  )
 {
+checkNull();
 return mxStream->available();
 }
 
 void OTextInputStream::closeInput(  )
 {
+checkNull();
 mxStream->closeInput();
 }
 


[Libreoffice-commits] core.git: include/vbahelper oovbaapi/ooo sc/source sw/source vbahelper/source

2023-03-13 Thread Baole Fang (via logerrit)
 include/vbahelper/vbaapplicationbase.hxx  |1 -
 oovbaapi/ooo/vba/XApplicationBase.idl |1 -
 oovbaapi/ooo/vba/excel/XApplication.idl   |1 +
 sc/source/ui/vba/vbaapplication.cxx   |6 ++
 sc/source/ui/vba/vbaapplication.hxx   |1 +
 sw/source/ui/vba/vbaapplication.cxx   |2 +-
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |5 -
 7 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit a6edfaaeb02169d90d8b414c480257b1ec0bcaad
Author: Baole Fang 
AuthorDate: Sun Mar 12 22:14:31 2023 -0400
Commit: Mike Kaganski 
CommitDate: Mon Mar 13 15:16:24 2023 +

tdf#150281: Fix CentimetersToPoints in Calc

Originally, CentimetersToPoints was implemented as a base method for
Writer and Calc. They are both using the same implementation,
which is correct for Writer, but wrong for Calc.
Since their behavior should be different,
I remove the base method and implement a correct one for Calc.

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

diff --git a/include/vbahelper/vbaapplicationbase.hxx 
b/include/vbahelper/vbaapplicationbase.hxx
index 24bac8204d7e..6c8f4460fa00 100644
--- a/include/vbahelper/vbaapplicationbase.hxx
+++ b/include/vbahelper/vbaapplicationbase.hxx
@@ -73,7 +73,6 @@ public:
 
 virtual css::uno::Any SAL_CALL Run( const OUString& MacroName, const 
css::uno::Any& varg1, const css::uno::Any& varg2, const css::uno::Any& varg3, 
const css::uno::Any& varg4, const css::uno::Any& varg5, const css::uno::Any& 
varg6, const css::uno::Any& varg7, const css::uno::Any& varg8, const 
css::uno::Any& varg9, const css::uno::Any& varg10, const css::uno::Any& varg11, 
const css::uno::Any& varg12, const css::uno::Any& varg13, const css::uno::Any& 
varg14, const css::uno::Any& varg15, const css::uno::Any& varg16, const 
css::uno::Any& varg17, const css::uno::Any& varg18, const css::uno::Any& 
varg19, const css::uno::Any& varg20, const css::uno::Any& varg21, const 
css::uno::Any& varg22, const css::uno::Any& varg23, const css::uno::Any& 
varg24, const css::uno::Any& varg25, const css::uno::Any& varg26, const 
css::uno::Any& varg27, const css::uno::Any& varg28, const css::uno::Any& 
varg29, const css::uno::Any& varg30 ) override;
 virtual void SAL_CALL OnTime( const css::uno::Any& aEarliestTime, const 
OUString& aFunction, const css::uno::Any& aLatestTime, const css::uno::Any& 
aSchedule ) override;
-virtual float SAL_CALL CentimetersToPoints( float Centimeters ) override;
 virtual void SAL_CALL Undo() override;
 virtual void SAL_CALL Quit() override;
 
diff --git a/oovbaapi/ooo/vba/XApplicationBase.idl 
b/oovbaapi/ooo/vba/XApplicationBase.idl
index c4e968872546..3a8612516366 100644
--- a/oovbaapi/ooo/vba/XApplicationBase.idl
+++ b/oovbaapi/ooo/vba/XApplicationBase.idl
@@ -37,7 +37,6 @@ interface XApplicationBase
 any CommandBars( [in] any Index );
 any Run([in] string MacroName, [in] /*Optional*/ any varg1, [in] 
/*Optional*/ any varg2, [in] /*Optional*/ any varg3, [in] /*Optional*/ any 
varg4, [in] /*Optional*/ any varg5, [in] /*Optional*/ any varg6, [in] 
/*Optional*/ any varg7, [in] /*Optional*/ any varg8, [in] /*Optional*/ any 
varg9, [in] /*Optional*/ any varg10, [in] /*Optional*/ any varg11, [in] 
/*Optional*/ any varg12, [in] /*Optional*/ any varg13, [in] /*Optional*/ any 
varg14, [in] /*Optional*/ any varg15, [in] /*Optional*/ any varg16, [in] 
/*Optional*/ any varg17, [in] /*Optional*/ any varg18, [in] /*Optional*/ any 
varg19, [in] /*Optional*/ any varg20, [in] /*Optional*/ any varg21, [in] 
/*Optional*/ any varg22, [in] /*Optional*/ any varg23, [in] /*Optional*/ any 
varg24, [in] /*Optional*/ any varg25, [in] /*Optional*/ any varg26, [in] 
/*Optional*/ any varg27, [in] /*Optional*/ any varg28, [in] /*Optional*/ any 
varg29, [in] /*Optional*/ any varg30);
 void OnTime( [in] any EarliestTime, [in] string Procedure, [in] any 
LatestTime, [in] any Schedule );
-float CentimetersToPoints([in] float Centimeters );
 void Undo();
 };
 
diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl 
b/oovbaapi/ooo/vba/excel/XApplication.idl
index c51640abe7e4..bcdc11672c15 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -89,6 +89,7 @@ interface XApplication
 raises(com::sun::star::script::BasicErrorException);
 XRange Union([in] XRange Arg1, [in] XRange Arg2, [in] /*Optional*/ any 
Arg3, [in] /*Optional*/ any Arg4, [in] /*Optional*/ any Arg5, [in] /*Optional*/ 
any Arg6, [in] /*Optional*/ any Arg7, [in] /*Optional*/ any Arg8, [in] 
/*Optional*/ any Arg9, [in] /*Optional*/ any Arg10, [in] /*Optional*/ any 
Arg11, [in] /*Optional*/ any Arg12, [in] /*Optional*/ any Arg13, [in] 
/*Optional*/ any Arg14, [in] /*Optional*/ any Arg15, [in] /*Optional*/ any