summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-06-15 08:38:46 +0200
committerMichael Stahl <mstahl@redhat.com>2016-06-15 11:27:26 +0000
commit53b97fd4d058ac36b20555b843a8194b6128e4e3 (patch)
treea10bb3f3fd122f4872800905414aa45c15bd9438
parentf44047ae020f32f15babd9b8a0432a449663fca0 (diff)
/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@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit abca482aebeb01d516816b543a07edc1dd178240) Reviewed-on: https://gerrit.libreoffice.org/26286 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/source/uibase/config/modcfg.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx
index 2e40ba7c94fb..f0c8185fe11f 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -1250,7 +1250,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;
@@ -1282,7 +1282,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;