editeng/qa/unit/core-test.cxx | 4 ++-- editeng/source/editeng/impedit2.cxx | 3 ++- editeng/source/editeng/impedit4.cxx | 2 +- sw/inc/crsrsh.hxx | 1 + sw/source/core/crsr/crstrvl1.cxx | 5 +++++ sw/source/core/crsr/swcrsr.cxx | 2 +- sw/source/uibase/inc/wrtsh.hxx | 2 +- sw/source/uibase/shells/textsh.cxx | 14 ++++---------- sw/source/uibase/wrtsh/select.cxx | 4 ++-- sw/uiconfig/swriter/ui/fldvarpage.ui | 22 ++++++++++++++++------ 10 files changed, 35 insertions(+), 24 deletions(-)
New commits: commit 04dd541becd9232555e4d6d1e41462359f253993 Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Tue May 7 14:33:10 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 8 10:25:23 2024 +0200 Design change in variable page of the field dialog in Writer Improves the commit 8e86df886f84fe69f13cfc367a5dd843e6ea917c Change-Id: I69bc7a8ddcc9593e1e0deb26311c31032f3f9ae8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167285 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sw/uiconfig/swriter/ui/fldvarpage.ui b/sw/uiconfig/swriter/ui/fldvarpage.ui index 9fd8c8f8a306..9cfb4ce2bf8d 100644 --- a/sw/uiconfig/swriter/ui/fldvarpage.ui +++ b/sw/uiconfig/swriter/ui/fldvarpage.ui @@ -59,6 +59,8 @@ <object class="GtkGrid" id="gdNameValue"> <property name="visible">True</property> <property name="can-focus">False</property> + <property name="hexpand">False</property> + <property name="vexpand">True</property> <property name="row-spacing">6</property> <property name="column-spacing">6</property> <child> @@ -195,9 +197,9 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">0</property> <property name="top-attach">1</property> - <property name="width">2</property> + <property name="width">3</property> </packing> </child> <child> @@ -205,7 +207,6 @@ <property name="visible">True</property> <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="vexpand">True</property> <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> @@ -227,6 +228,9 @@ <property name="headers-clickable">False</property> <property name="search-column">0</property> <property name="show-expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection"/> + </child> <child> <object class="GtkTreeViewColumn" id="treeviewcolumn1"> <child> @@ -262,7 +266,6 @@ <packing> <property name="left-attach">0</property> <property name="top-attach">0</property> - <property name="height">2</property> </packing> </child> <child> @@ -270,7 +273,6 @@ <property name="visible">True</property> <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="vexpand">True</property> <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> @@ -292,6 +294,9 @@ <property name="headers-clickable">False</property> <property name="search-column">0</property> <property name="show-expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection"/> + </child> <child> <object class="GtkTreeViewColumn" id="treeviewcolumn2"> <child> @@ -334,7 +339,6 @@ <property name="visible">True</property> <property name="can-focus">False</property> <property name="hexpand">True</property> - <property name="vexpand">True</property> <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> @@ -364,6 +368,9 @@ <property name="headers-clickable">False</property> <property name="search-column">0</property> <property name="show-expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection"/> + </child> <child> <object class="GtkTreeViewColumn" id="treeviewcolumn3"> <child> @@ -406,6 +413,9 @@ <property name="headers-clickable">False</property> <property name="search-column">0</property> <property name="show-expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection"/> + </child> <child> <object class="GtkTreeViewColumn" id="treeviewcolumn4"> <child> commit de8eaca887762568e158024ad5bdbfb21526b734 Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Tue Apr 30 13:52:09 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed May 8 10:25:08 2024 +0200 Case Rotation in Impress and Writer improved Word boundaries at the end of the paragraph are now correctly detected. Sentence case is not applied without multi word selection in Writer anymore. Change-Id: If6e2eeaa1ecca215d583e8f33364db466bf7c57d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166928 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index b69f58df9e8f..e40d5f0bf4c9 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -1896,8 +1896,8 @@ void Test::testTransliterate() esel = ESelection(0, selStart, 0, selEnd); CPPUNIT_ASSERT_EQUAL(u""_ustr, editEng.GetText(esel)); CPPUNIT_ASSERT_EQUAL(u"Mary Jones met joe Smith. Time Passed."_ustr, lcl_translitTest(editEng, sText2, esel, TF::TITLE_CASE)); - CPPUNIT_ASSERT_EQUAL(u"Mary Jones met joe Smith. Time Passed."_ustr, lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE)); - CPPUNIT_ASSERT_EQUAL(u"Mary Jones met joe Smith. Time Passed."_ustr, lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE)); + CPPUNIT_ASSERT_EQUAL(u"Mary Jones met joe SMITH. Time Passed."_ustr, lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE)); + CPPUNIT_ASSERT_EQUAL(u"Mary Jones met joe smith. Time Passed."_ustr, lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE)); /* No selection tests. Cursor between the 'm' and 'e' in 'met'. */ selStart = 12; diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 1f5a97053ba7..4e56da97f706 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1586,7 +1586,8 @@ EditSelection ImpEditEngine::SelectWord( const EditSelection& rCurSel, sal_Int16 if ( nType == i18n::WordType::ANY_WORD ) { i18n::Boundary aBoundary = _xBI->getWordBoundary( - aPaM.GetNode()->GetString(), aPaM.GetIndex(), aLocale, nWordType, true); + aPaM.GetNode()->GetString(), aPaM.GetIndex(), aLocale, nWordType, + aPaM.GetNode()->GetString().getLength() == aPaM.GetIndex() ? false : true); // don't select when cursor at end of word if ( ( aBoundary.endPos > aPaM.GetIndex() || ( bAcceptEndOfWord && aBoundary.endPos == aPaM.GetIndex() ) ) && diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 17318e5d65a4..b5b4018d9de2 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2712,7 +2712,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, if ( !aSel.HasRange() ) { - aSel = SelectWord( aSel, css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, true, true ); + aSel = SelectWord( aSel, css::i18n::WordType::WORD_COUNT, true, true ); if (!aSel.HasRange() && aSel.Min().GetIndex() > 0 && u".!?"_ustr.indexOf(aSel.Min().GetNode()->GetChar(aSel.Min().GetIndex() - 1)) > -1 ) { diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 1d85ce278736..23dd92da39e1 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -766,6 +766,7 @@ public: SW_DLLPUBLIC bool GoStartSentence(); SW_DLLPUBLIC bool GoEndSentence(); bool SelectWord( const Point* pPt ); + bool SelectWordWT( const Point* pt, sal_Int16 nWordType ); void ExpandToSentenceBorders(); // get position from current cursor diff --git a/sw/source/core/crsr/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx index 5654566769c8..260cc07ba3d4 100644 --- a/sw/source/core/crsr/crstrvl1.cxx +++ b/sw/source/core/crsr/crstrvl1.cxx @@ -85,6 +85,11 @@ bool SwCursorShell::SelectWord( const Point* pPt ) return m_pCurrentCursor->SelectWord( this, pPt ); } +bool SwCursorShell::SelectWordWT( const Point* pPt, sal_Int16 nWordType ) +{ + return m_pCurrentCursor->SelectWordWT( this, nWordType, pPt ); +} + void SwCursorShell::ExpandToSentenceBorders() { m_pCurrentCursor->ExpandToSentenceBorders(GetLayout()); diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 63b107f823d8..d0584fc97887 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1452,10 +1452,10 @@ bool SwCursor::SelectWordWT( SwViewShell const * pViewShell, sal_Int16 nWordType } else { - bool bForward = true; sal_Int32 nPtPos = GetPoint()->GetContentIndex(); HideWrapper w(pViewShell->GetLayout(), pTextNd, nPtPos); + bool bForward = w.m_pText->getLength() == w.m_nPtIndex ? false : true; Boundary aBndry( g_pBreakIt->GetBreakIter()->getWordBoundary( *w.m_pText, w.m_nPtIndex, diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 6c0d4c2dda0b..fc7f69b3d8de 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -200,7 +200,7 @@ public: // select word / sentence bool SelNearestWrd(); - SW_DLLPUBLIC bool SelWrd(const Point * = nullptr ); + SW_DLLPUBLIC bool SelWrd(const Point * = nullptr, sal_Int16 nWordType = i18n::WordType::ANYWORD_IGNOREWHITESPACES ); // #i32329# Enhanced selection void SelSentence (const Point *); SW_DLLPUBLIC void SelPara (const Point *); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 93020de3bad2..77f300367f50 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -90,6 +90,8 @@ #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <IDocumentUndoRedo.hxx> #include <formatcontentcontrol.hxx> +#include <com/sun/star/i18n/WordType.hpp> + using namespace ::com::sun::star; @@ -894,16 +896,8 @@ void SwTextShell::ExecRotateTransliteration( SfxRequest const & rReq ) else { if (bSentenceCase) - { - if (!rSh.IsEndSentence()) - rSh.EndSentence(false); - } - if (rSh.IsEndSentence()) - { - rSh.BwdSentence(true); - rSh.TransliterateText(transFlags); - } - else if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && rSh.SelWrd()) + transFlags = m_aRotateCase.getNextMode(); + if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && rSh.SelWrd(nullptr, i18n::WordType::WORD_COUNT)) rSh.TransliterateText(transFlags); } } diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx index 3ae5842f6187..d104ce90aa9b 100644 --- a/sw/source/uibase/wrtsh/select.cxx +++ b/sw/source/uibase/wrtsh/select.cxx @@ -79,13 +79,13 @@ bool SwWrtShell::SelNearestWrd() return SelWrd(); } -bool SwWrtShell::SelWrd(const Point *pPt ) +bool SwWrtShell::SelWrd(const Point *pPt, sal_Int16 nWordType ) { bool bRet; { SwMvContext aMvContext(this); SttSelect(); - bRet = SwCursorShell::SelectWord( pPt ); + bRet = SwCursorShell::SelectWordWT( pPt, nWordType ); } EndSelect(); if( bRet )