svx/source/tbxctrls/tbcontrl.cxx           |    3 +++
 unotools/source/i18n/localedatawrapper.cxx |   20 +++++++-------------
 2 files changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 37494dc5457f5feb44465d2eb508a5f77fec74cd
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Aug 22 14:44:43 2022 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Aug 22 20:30:32 2022 +0200

    I see this empty entry for the separator in the styles dropdown
    
    Change-Id: I0c0787f893e50ea32b3dc7bf4356b4603d8f8cdd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138689
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 610bb630e55e..db147949c306 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1575,6 +1575,9 @@ void 
SvxStyleBox_Base::CalcOptimalExtraUserWidth(vcl::RenderContext& rRenderCont
     {
         OUString sStyleName(get_text(i));
 
+        if (sStyleName.isEmpty())
+            continue;
+
         rRenderContext.Push(vcl::PushFlags::FILLCOLOR | vcl::PushFlags::FONT | 
vcl::PushFlags::TEXTCOLOR);
         SetupEntry(rRenderContext, i, tools::Rectangle(0, 0, RECT_MAX, 
ITEM_HEIGHT), sStyleName, true);
         auto aScriptChanges = CheckScript(sStyleName);
commit b759f6720b50487200740a6202e21774897b44b2
Author:     Eike Rathke <[email protected]>
AuthorDate: Mon Aug 22 16:16:08 2022 +0200
Commit:     Eike Rathke <[email protected]>
CommitDate: Mon Aug 22 20:30:20 2022 +0200

    Resolves: tdf#150288 Do not prepend the locale's full date acceptance 
pattern
    
    ... if it wasn't present as first, but take the date acceptance
    patterns as specified by the user.
    
    Change-Id: Ife2fd39731bac0e0b121f22392f22b48ffc9c978
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138694
    Reviewed-by: Eike Rathke <[email protected]>
    Tested-by: Jenkins

diff --git a/unotools/source/i18n/localedatawrapper.cxx 
b/unotools/source/i18n/localedatawrapper.cxx
index 54aa49f44877..9e6fe8990979 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -1550,19 +1550,13 @@ void LocaleDataWrapper::loadDateAcceptancePatterns(
         }
     }
 
-    // Never overwrite the locale's full date pattern! The first.
-    if (std::as_const(aDateAcceptancePatterns)[0] == rPatterns[0])
-        aDateAcceptancePatterns = comphelper::containerToSequence(rPatterns);  
  // sane
-    else
-    {
-        // Copy existing full date pattern and append the sequence passed.
-        /* TODO: could check for duplicates and shrink target sequence */
-        Sequence< OUString > aTmp( rPatterns.size() + 1 );
-        auto it = aTmp.getArray();
-        *it = std::as_const(aDateAcceptancePatterns)[0];
-        std::copy(rPatterns.begin(), rPatterns.end(), std::next(it));
-        aDateAcceptancePatterns = aTmp;
-    }
+    // Earlier versions checked for presence of the full date pattern with
+    // aDateAcceptancePatterns[0] == rPatterns[0] and prepended that if not.
+    // This lead to confusion if the patterns were intentionally specified
+    // without, giving entirely a different DMY order, see tdf#150288.
+    // Not checking this and accepting the given patterns as is may result in
+    // the user shooting themself in the foot, but we can't have both.
+    aDateAcceptancePatterns = comphelper::containerToSequence(rPatterns);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to