sw/source/ui/fldui/DateFormFieldDialog.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 9b4e0e65e38b21b9af7314732d6839e8bfd671c2
Author:     Tamás Zolnai <[email protected]>
AuthorDate: Mon Jul 1 14:24:08 2019 +0200
Commit:     Tamás Zolnai <[email protected]>
CommitDate: Fri Jul 12 05:53:45 2019 +0200

    MSForms: date form field dialog: create the format entry if it does not 
exist
    
    Change-Id: I62da736efeabc2da634d9a7a38512d7e908b03fc
    Reviewed-on: https://gerrit.libreoffice.org/75450
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <[email protected]>

diff --git a/sw/source/ui/fldui/DateFormFieldDialog.cxx 
b/sw/source/ui/fldui/DateFormFieldDialog.cxx
index bfc3aa3e3aa0..ad511dff7ddf 100644
--- a/sw/source/ui/fldui/DateFormFieldDialog.cxx
+++ b/sw/source/ui/fldui/DateFormFieldDialog.cxx
@@ -77,8 +77,17 @@ void DateFormFieldDialog::InitControls()
         {
             LanguageType aLangType = LanguageTag(sLang).getLanguageType();
             sal_uInt32 nFormatKey = 
m_pNumberFormatter->GetEntryKey(sFormatString, aLangType);
+            bool bValidFormat = nFormatKey != NUMBERFORMAT_ENTRY_NOT_FOUND;
+            if (nFormatKey == NUMBERFORMAT_ENTRY_NOT_FOUND)
+            {
+                sal_Int32 nCheckPos = 0;
+                SvNumFormatType nType;
+                bValidFormat
+                    = m_pNumberFormatter->PutEntry(sFormatString, nCheckPos, 
nType, nFormatKey,
+                                                   
LanguageTag(sLang).getLanguageType());
+            }
 
-            if (aLangType != LANGUAGE_DONTKNOW && nFormatKey != 
NUMBERFORMAT_ENTRY_NOT_FOUND)
+            if (aLangType != LANGUAGE_DONTKNOW && bValidFormat)
             {
                 if (m_xFormatLB->GetCurLanguage() == aLangType)
                 {
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to