Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi Björn,

I've started to work on the *Bug
34465*<https://bugs.freedesktop.org/show_bug.cgi?id=34465>and I have
some questions:

1) What do you suggest to find all places where Put( const SfxPoolItem&,
USHORT nWhich) is used?
    I came up with idea to make function private and fix all places where
g++ gives error. Do you have better idea?

2) Is it a good idea to make a special clone method in SfxPoolItem, such as

virtual SfxPoolItem*     CloneAtWhich( sal_uInt16 nNewWhich, SfxItemPool
*pPool = 0 ) const
                             { SfxPoolItem *pItem = Clone( pPool );
pItem->SetWhich( nNewWhich );
                                 return pItem; }

Which is used for example in:

diff --git a/sc/source/core/tool/autoform.cxx
b/sc/source/core/tool/autoform.cxx
index 14be99e..1dd481c 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -672,9 +672,9 @@ void ScAutoFormatData::FillToItemSet( sal_uInt16
nIndex, SfxItemSet& rItemSet, S
         }
         else
         {
-            rItemSet.Put( rField.GetHeight(), ATTR_CJK_FONT_HEIGHT );
-            rItemSet.Put( rField.GetWeight(), ATTR_CJK_FONT_WEIGHT );
-            rItemSet.Put( rField.GetPosture(), ATTR_CJK_FONT_POSTURE );
+            rItemSet.Put( *(rField.GetHeight().CloneAtWhich(
ATTR_CJK_FONT_HEIGHT )) );
+            rItemSet.Put( *(rField.GetWeight().CloneAtWhich(
ATTR_CJK_FONT_WEIGHT )) );
+            rItemSet.Put( *(rField.GetPosture().CloneAtWhich(
ATTR_CJK_FONT_POSTURE )) );
         }
         // do not insert empty CTL font
         const SvxFontItem& rCTLFont = rField.GetCTLFont();




Best Regards,
   Maciek

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.