[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: editeng/source officecfg/registry

2023-07-04 Thread Caolán McNamara (via logerrit)
 editeng/source/misc/acorrcfg.cxx   |2 +-
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2559baf56eed67dd97183d8852360866b5fe9d4e
Author: Caolán McNamara 
AuthorDate: Tue Jul 4 10:15:53 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jul 4 17:15:29 2023 +0200

32bit is enough for the word completion limit

and we don't have to change the xcs in that case

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

diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx
index 4ff15f1bfc2d..74d97d5a41f9 100644
--- a/editeng/source/misc/acorrcfg.cxx
+++ b/editeng/source/misc/acorrcfg.cxx
@@ -524,7 +524,7 @@ void SvxSwAutoCorrCfg::Load(bool bInit)
 break; // "Completion/MinWordLen",
 case  35:
 {
-sal_Int64 nVal = 0; pValues[nProp] >>= nVal;
+sal_Int32 nVal = 0; pValues[nProp] >>= nVal;
 rSwFlags.nAutoCmpltListLen =
 sal::static_int_cast< sal_uInt32 >(nVal);
 }
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index dd880f51cfa4..0f684bb2eea9 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: editeng/source officecfg/registry

2013-02-11 Thread Samuel Mehrbrodt
 editeng/source/misc/swafopt.cxx|6 +++---
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 992f3ce06773cd05dbb66162f51408338d3db801
Author: Samuel Mehrbrodt s.mehrbr...@gmail.com
Date:   Thu Jan 31 11:37:59 2013 +0100

Better default values for Word completion feature


http://nabble.documentfoundation.org/Libreoffice-ux-advise-Word-completion-default-value-td4031168.html

Change-Id: Ifef07653c2155b3c26d65d41cae1164b44fbd04f
Reviewed-on: https://gerrit.libreoffice.org/1937
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/editeng/source/misc/swafopt.cxx b/editeng/source/misc/swafopt.cxx
index a416507..a3cba1b 100644
--- a/editeng/source/misc/swafopt.cxx
+++ b/editeng/source/misc/swafopt.cxx
@@ -49,7 +49,7 @@ SvxSwAutoFmtFlags::SvxSwAutoFmtFlags()
 bWithRedlining =
 bAutoCmpltEndless =
 bAutoCmpltAppendBlanc =
-bAutoCmpltShowAsTip = sal_False;
+bAutoCmpltShowAsTip = sal_True;
 
 bSetBorder =
 bCreateTable =
@@ -76,8 +76,8 @@ SvxSwAutoFmtFlags::SvxSwAutoFmtFlags()
 cByInputBullet = cBullet;
 aByInputBulletFont = aBulletFont;
 
-nAutoCmpltWordLen = 10;
-nAutoCmpltListLen = 500;
+nAutoCmpltWordLen = 8;
+nAutoCmpltListLen = 1000;
 m_pAutoCompleteList = 0;
 pSmartTagMgr = 0;
 }
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 6fec206..8f987e0 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -4782,7 +4782,7 @@
descSets the value for the 
minimum word length./desc
labelMin. word length/label
/info
-value10/value
+value8/value
/prop
prop oor:name=MaxListLen oor:type=xs:int 
oor:nillable=false
!-- OldPath: Writer/AutoComplete/Words 
--
@@ -4793,7 +4793,7 @@
descSets the maximum number 
of words to be recalled./desc
labelMax. entries/label
/info
-   value500/value
+   value1000/value
/prop
prop oor:name=CollectWords 
oor:type=xs:boolean oor:nillable=false
!-- OldPath: Writer/AutoComplete/Words 
--
@@ -4837,7 +4837,7 @@
descSpecifies if the 
suggestions for the automatic word completion function should be displayed as 
Tip helps./desc
labelShow as tip/label
/info
-   valuefalse/value
+   valuetrue/value
/prop
prop oor:name=AcceptKey oor:type=xs:int 
oor:nillable=false
!-- OldPath: Writer/AutoComplete/Words 
--
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits