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 |    5 ++---
 10 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit cb47cc7d13057bbd54dac1a623fcb39320096cb3
Author:     Thorsten Behrens <thorsten.behr...@allotropia.de>
AuthorDate: Wed May 8 10:36:23 2024 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Wed May 8 10:36:23 2024 +0200

    Fixup: Design change in variable page of the field dialog in Writer
    
    Adding improvements from patchset 2, out of
    https://gerrit.libreoffice.org/c/core/+/167285
    
    Change-Id: I29cb1ab50dd3a59e842724005b443b4b6f1fe483

diff --git a/sw/uiconfig/swriter/ui/fldvarpage.ui 
b/sw/uiconfig/swriter/ui/fldvarpage.ui
index 5a4e42081221..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>
@@ -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>
@@ -272,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>
@@ -339,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>
commit 9fa365b462524783dad84ba845cab30b4066d500
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:30:56 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 b19382142f3d..10c61aec374b 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -2048,8 +2048,8 @@ void Test::testTransliterate()
     esel = ESelection(0, selStart, 0, selEnd);
     CPPUNIT_ASSERT_EQUAL(OUString(""), editEng.GetText(esel));
     CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::TITLE_CASE));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE));
-    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe Smith. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::UPPERCASE_LOWERCASE));
+    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe SMITH. Time Passed."), 
lcl_translitTest(editEng, sText2, esel, TF::LOWERCASE_UPPERCASE));
+    CPPUNIT_ASSERT_EQUAL(OUString("Mary Jones met joe smith. Time Passed."), 
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 ccdcd1e0bbc1..664502f4cd71 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1585,7 +1585,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 0258900725ea..f09a296e8f58 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2701,7 +2701,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 &&
             
OUString(".!?").indexOf(aSel.Min().GetNode()->GetChar(aSel.Min().GetIndex() - 
1)) > -1 )
         {
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 7948edd79e5c..db88b5644da3 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -758,6 +758,7 @@ public:
     bool GoStartSentence();
     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 5a2f9afeada5..078927789420 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1455,10 +1455,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 5af856f23f9e..9e67a6496c10 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();
-    bool    SelWrd      (const Point * = nullptr );
+    bool    SelWrd      (const Point * = nullptr, sal_Int16 nWordType = 
i18n::WordType::ANYWORD_IGNOREWHITESPACES );
     // #i32329# Enhanced selection
     void    SelSentence (const Point *);
     void    SelPara     (const Point *);
diff --git a/sw/source/uibase/shells/textsh.cxx 
b/sw/source/uibase/shells/textsh.cxx
index d80f8b5b51f6..4820522fa35a 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 )

Reply via email to