[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sw/source

Stephan Bergmann sbergman at redhat.com
Wed Jun 15 06:50:14 UTC 2016


 sw/source/uibase/config/modcfg.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit abca482aebeb01d516816b543a07edc1dd178240
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jun 15 08:38:46 2016 +0200

    /org.openoffice.Office.Writer/FormLetter/MailingOutput/Format is xs:int
    
    ...i.e., sal_Int32.  Regression introduced with
    ba9acdf799bf556c8a20b1dc27eb116e23d481db "convert TXTFORMAT constants to scoped
    enum".  (The problem with storing a sal_uInt8 in an Any is that sal_uInt8 ==
    sal_Bool, so actually a Boolean Any is constructed---and configmgr will throw an
    exception when trying to set that value for the "Format" prop.  The problem with
    extracting a sal_uInt8 from a sal_Int32 Any with getValue/static_cast is that
    it doesn't even read (only) the low order bits, but on big endian machines reads
    the high order bits.)
    
    This is a backported version of 25a60d19d56a4bdb4f1b6ef27d842f90617fcff8
    "/org.openoffice.Office.Writer/FormLetter/MailingOutput/Format is xs:int" which
    uses o3tl::doAccess newly introduced on master.
    
    Change-Id: I654da713bbf78b3215de7a09056a5172fc204258
    Reviewed-on: https://gerrit.libreoffice.org/26285
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx
index 418df87..d50018b 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -1249,7 +1249,7 @@ void SwMiscConfig::ImplCommit()
             case 3 : pValues[nProp] <<= bGrfToGalleryAsLnk; break;
             case 4 : pValues[nProp] <<= bNumAlignSize; break;
             case 5 : pValues[nProp] <<= bSinglePrintJob; break;
-            case 6 : pValues[nProp] <<= static_cast<sal_uInt8>(nMailingFormats); break;
+            case 6 : pValues[nProp] <<= static_cast<sal_Int32>(nMailingFormats); break;
             case 7 : pValues[nProp] <<= sNameFromColumn;  break;
             case 8 : pValues[nProp] <<= sMailingPath;     break;
             case 9 : pValues[nProp] <<= sMailName;        break;
@@ -1281,7 +1281,13 @@ void SwMiscConfig::Load()
                 case 3 : bGrfToGalleryAsLnk = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
                 case 4 : bNumAlignSize = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
                 case 5 : bSinglePrintJob = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
-                case 6 : nMailingFormats = static_cast<MailTextFormats>(*static_cast<sal_uInt8 const *>(pValues[nProp].getValue())); break;
+                case 6 :
+                    {
+                        sal_Int32 n = 0;
+                        pValues[nProp] >>= n;
+                        nMailingFormats = static_cast<MailTextFormats>(n);
+                        break;
+                    }
                 case 7 : pValues[nProp] >>= sTmp; sNameFromColumn = sTmp; break;
                 case 8 : pValues[nProp] >>= sTmp; sMailingPath = sTmp;  break;
                 case 9 : pValues[nProp] >>= sTmp; sMailName = sTmp;     break;


More information about the Libreoffice-commits mailing list