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

Caolán McNamara caolanm at redhat.com
Mon Jun 19 15:27:56 UTC 2017


 editeng/qa/unit/core-test.cxx      |   17 +++++++++++++++++
 editeng/source/misc/svxacorr.cxx   |    2 +-
 vcl/source/window/menuitemlist.cxx |    4 ++++
 3 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit 99461ec3c33575a764065946ff7b4cbeb3e3741f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 19 16:26:20 2017 +0100

    restore gtk3 menu separators
    
    Change-Id: I48b302780db420346280d782c1804fe6e93c90be

diff --git a/vcl/source/window/menuitemlist.cxx b/vcl/source/window/menuitemlist.cxx
index b03ef0e89c56..95cf7a07875f 100644
--- a/vcl/source/window/menuitemlist.cxx
+++ b/vcl/source/window/menuitemlist.cxx
@@ -69,6 +69,8 @@ MenuItemData* MenuItemList::Insert(
 
     SalItemParams aSalMIData;
     aSalMIData.nId = nId;
+    aSalMIData.eType = eType;
+    aSalMIData.nBits = nBits;
     aSalMIData.pMenu = pMenu;
     aSalMIData.aText = rStr;
 
@@ -99,6 +101,8 @@ void MenuItemList::InsertSeparator(const OString &rIdent, size_t nPos)
 
     SalItemParams aSalMIData;
     aSalMIData.nId = 0;
+    aSalMIData.eType = MenuItemType::SEPARATOR;
+    aSalMIData.nBits = MenuItemBits::NONE;
     aSalMIData.pMenu = nullptr;
     aSalMIData.aText.clear();
     aSalMIData.aImage = Image();
commit 3212a2419416359f11e60c62cadeeaa8078c33a7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 19 15:02:17 2017 +0100

    consider field marks as text for auto quotes
    
    Change-Id: I511a13f7785a0de6efaa8439d3f0bff20a1644ed

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index f620a72d8843..b71c90c72dfc 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -375,6 +375,7 @@ void Test::testAutocorrect()
         CPPUNIT_ASSERT_EQUAL_MESSAGE("autocorrect", sExpected, aFoo.getResult());
     }
 
+    // don't autocapitalize after a field mark
     {
         OUString sInput("Test. \x01 test");
         sal_Unicode cNextChar(' ');
@@ -385,6 +386,22 @@ void Test::testAutocorrect()
 
         CPPUNIT_ASSERT_EQUAL_MESSAGE("autocorrect", sExpected, aFoo.getResult());
     }
+
+    // consider field contents as text for auto quotes
+    {
+        OUString sInput("T\x01");
+        sal_Unicode cNextChar('"');
+        const sal_Unicode EXPECTED[] = { 'T', 0x01, 0x0201d };
+        OUString sExpected(EXPECTED, SAL_N_ELEMENTS(EXPECTED));
+
+        TestAutoCorrDoc aFoo(sInput, LANGUAGE_ENGLISH_US);
+        aAutoCorrect.SetAutoCorrFlag(ChgQuotes, true);
+        aAutoCorrect.DoAutoCorrect(aFoo, sInput, sInput.getLength(), cNextChar, true);
+        fprintf(stderr, "text is %x\n", aFoo.getResult()[aFoo.getResult().getLength() - 1]);
+
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("autocorrect", sExpected, aFoo.getResult());
+    }
+
 }
 
 void Test::testHyperlinkCopyPaste()
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index c7ec14cb0be6..d8804dcd1727 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1258,7 +1258,7 @@ void SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt,
             {
                 sal_Unicode cPrev;
                 bool bSttQuote = !nInsPos ||
-                        IsWordDelim( ( cPrev = rTxt[ nInsPos-1 ])) ||
+                        NonFieldWordDelim( ( cPrev = rTxt[ nInsPos-1 ])) ||
                         lcl_IsInAsciiArr( "([{", cPrev ) ||
                         ( cEmDash && cEmDash == cPrev ) ||
                         ( cEnDash && cEnDash == cPrev );


More information about the Libreoffice-commits mailing list