[Libreoffice-commits] core.git: Branch 'private/kohei/chart-bugs' - 252 commits - accessibility/inc accessibility/source avmedia/source basctl/source basegfx/source basic/source binaryurp/source canvas/source chart2/inc chart2/opengl chart2/Package_opengl.mk chart2/qa chart2/source codemaker/source comphelper/source compilerplugins/clang config.guess configmgr/source config.sub configure.ac connectivity/inc connectivity/source cppcanvas/source cppuhelper/source cui/AllLangResTarget_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk dbaccess/source desktop/source desktop/uiconfig editeng/source embeddedobj/source extensions/AllLangResTarget_bib.mk extensions/inc extensions/source extensions/uiconfig extensions/UIConfig_sbibliography.mk external/libmwaw external/libodfgen external/librevenge external/libwps external/lpsolve external/rhino extras/source filter/source forms/source formula/inc formula/Module_formula.mk formula/source formula/uiconfig formula/UIConfig_formula.mk framework/source helpco mpiler/inc helpcompiler/source helpcontent2 hwpfilter/source idlc/inc idlc/source include/basegfx include/basic include/canvas include/codemaker include/com include/comphelper include/connectivity include/editeng include/filter include/formula include/jvmaccess include/LibreOfficeKit include/oox include/rtl include/sal include/sfx2 include/sot include/svl include/svtools include/svx include/tools include/unotest include/unotools include/vcl include/xmloff include/xmlreader jvmaccess/source jvmfwk/source l10ntools/source libreofficekit/source lingucomponent/source linguistic/source lotuswordpro/source Makefile.in odk/examples odk/source offapi/com offapi/UnoApi_offapi.mk officecfg/registry oox/source qadevOOo/tests readlicense_oo/docs registry/source reportdesign/inc reportdesign/source Repository.mk rsc/inc rsc/source sal/osl sc/inc scp2/AutoInstall.mk scp2/source sc/qa sc/source sd/inc sd/Library_sd.mk sd/qa sd/source sd/uiconfig sfx2/source shell/source slideshow/source smoketest/ libtest.cxx solenv/gbuild soltools/mkdepend sot/source starmath/source stoc/source svl/CppunitTest_svl_itempool.mk svl/CppunitTest_svl_items.mk svl/CppunitTest_svl_qa_cppunit.mk svl/Module_svl.mk svl/qa svl/source svtools/source svx/inc svx/Library_svx.mk svx/source svx/uiconfig svx/UIConfig_svx.mk sw/CppunitTest_sw_tox.mk sw/inc sw/Library_sw.mk sw/qa sw/sdi sw/source sw/uiconfig sw/UIConfig_swriter.mk sysui/desktop test/source toolkit/Library_tk.mk toolkit/source tools/source ucb/source udkapi/com UnoControls/inc UnoControls/source unotest/source unotools/source unusedcode.easy uui/AllLangResTarget_uui.mk uui/source uui/uiconfig uui/UIConfig_uui.mk vcl/generic vcl/inc vcl/Library_vcl.mk vcl/osx vcl/quartz vcl/source vcl/unx wizards/com writerfilter/inc writerfilter/Library_writerfilter.mk writerfilter/source xmloff/CppunitTest_xmloff_uxmloff.mk xmloff/inc xmloff/Library_xo.mk xmloff/source xmlreader/source xmlsecurity/source

Kohei Yoshida kohei.yoshida at collabora.com
Thu Jun 19 11:32:54 PDT 2014


Rebased ref, commits from common ancestor:
commit 0fad728f04a8496a8860ddf976885c5e24f62835
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 19 14:21:25 2014 -0400

    Fix illegal memory access.
    
    Change-Id: I884bc109119212d9a89b761813043c5458b8046d

diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index f61ed6c..5e65713 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -801,7 +801,6 @@ sal_Bool SAL_CALL SvXMLExport::filter( const uno::Sequence< beans::PropertyValue
     try
     {
         const sal_Int32 nPropCount = aDescriptor.getLength();
-        const beans::PropertyValue* pProps = aDescriptor.getConstArray();
 
         const sal_uInt32 nTest =
             EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS;
@@ -810,6 +809,7 @@ sal_Bool SAL_CALL SvXMLExport::filter( const uno::Sequence< beans::PropertyValue
             // evaluate descriptor only for flat files and if a base URI
             // has not been provided already
 
+            const beans::PropertyValue* pProps = aDescriptor.getConstArray();
             for( sal_Int32 nIndex = 0; nIndex < nPropCount; nIndex++, pProps++ )
             {
                 const OUString& rPropName = pProps->Name;
@@ -828,6 +828,7 @@ sal_Bool SAL_CALL SvXMLExport::filter( const uno::Sequence< beans::PropertyValue
             }
         }
 
+        const beans::PropertyValue* pProps = aDescriptor.getConstArray();
         for (sal_Int32 nIndex = 0; nIndex < nPropCount; ++nIndex, ++pProps)
         {
             const OUString& rPropName = pProps->Name;
commit e6eca5d3fe2fdb4fd7587f3449f45fd7365e0cf7
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 19 14:02:27 2014 -0400

    Build fix.
    
    Change-Id: Ib306deee13906f49d8611cd66f6a5262b52d04df

diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 00f67e3..5bda8cc 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -154,7 +154,7 @@ public:
                           com::sun::star::chart::XChartDocument > rChartDoc,
                       bool bIncludeTable );
 
-    UniReference< XMLPropertySetMapper > GetPropertySetMapper() const { return mxPropertySetMapper;}
+    UniReference<XMLPropertySetMapper> GetPropertySetMapper() const;
 
     void SetChartRangeAddress( const OUString& rAddress )
         { msChartAddress = rAddress; }
commit 461d8db718350852b8b37830c0cabf6ee3b699bf
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 19 10:53:02 2014 -0400

    Remove this debug statement.
    
    Change-Id: Ibe2bc19e9cec1d112eb3e3bf631896203974b7e1

diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index a6e46ea..00f67e3 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -2326,10 +2326,6 @@ void SchXMLExportHelper_Impl::exportAxis(
         lcl_exportNumberFormat( sNumFormat, xAxisProps, mrExport );
         aPropertyStates = mxExpPropMapper->Filter( xAxisProps );
 
-        fprintf(stdout, "SchXMLExportHelper_Impl::exportAxis:   src shell = '%s'  dest shell = '%s'\n",
-                rtl::OUStringToOString(maSrcShellID, RTL_TEXTENCODING_UTF8).getStr(),
-                rtl::OUStringToOString(maDestShellID, RTL_TEXTENCODING_UTF8).getStr());
-
         if (!maSrcShellID.isEmpty() && !maDestShellID.isEmpty() && maSrcShellID != maDestShellID)
         {
             // Disable link to source number format property when pasting to
commit 94adffd6fa264fd8eb6779911ea508c03b87d134
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Jun 18 23:20:55 2014 -0400

    Pass source and destination shell IDs when pasting from Calc to Calc.
    
    This modifies the signature of one variant of Paste() virtual method of
    SdrExchangeView and its child classes.
    
    Change-Id: I54c39b18c260e25d78e126aaabeaaf642ad049f8

diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index 50a304b..9437893 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -487,7 +487,9 @@ void EmbeddedObjectContainer::AddEmbeddedObject( const ::com::sun::star::uno::Re
     }
 }
 
-bool EmbeddedObjectContainer::StoreEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName, bool bCopy )
+bool EmbeddedObjectContainer::StoreEmbeddedObject(
+    const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName, bool bCopy,
+    const OUString& rSrcShellID, const OUString& rDestShellID )
 {
     uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
     if ( rName.isEmpty() )
@@ -506,7 +508,14 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject( const uno::Reference < embed:
         {
             uno::Sequence < beans::PropertyValue > aSeq;
             if ( bCopy )
-                xPersist->storeToEntry( pImpl->mxStorage, rName, aSeq, aSeq );
+            {
+                uno::Sequence<beans::PropertyValue> aObjArgs(2);
+                aObjArgs[0].Name = "SourceShellID";
+                aObjArgs[0].Value <<= rSrcShellID;
+                aObjArgs[1].Name = "DestinationShellID";
+                aObjArgs[1].Value <<= rDestShellID;
+                xPersist->storeToEntry(pImpl->mxStorage, rName, aSeq, aObjArgs);
+            }
             else
             {
                 //TODO/LATER: possible optimization, don't store immediately
@@ -529,7 +538,7 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject( const uno::Reference < embed:
 bool EmbeddedObjectContainer::InsertEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName )
 {
     // store it into the container storage
-    if ( StoreEmbeddedObject( xObj, rName, false ) )
+    if (StoreEmbeddedObject(xObj, rName, false, OUString(), OUString()))
     {
         // remember object
         AddEmbeddedObject( xObj, rName );
@@ -683,7 +692,9 @@ bool EmbeddedObjectContainer::TryToCopyGraphReplacement( EmbeddedObjectContainer
     return bResult;
 }
 
-uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmbeddedObject( EmbeddedObjectContainer& rSrc, const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName )
+uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmbeddedObject(
+    EmbeddedObjectContainer& rSrc, const uno::Reference <embed::XEmbeddedObject>& xObj, OUString& rName,
+    const OUString& rSrcShellID, const OUString& rDestShellID )
 {
     uno::Reference< embed::XEmbeddedObject > xResult;
 
@@ -703,7 +714,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
         rName = CreateUniqueObjectName();
 
     // objects without persistence are not really stored by the method
-    if ( xObj.is() && StoreEmbeddedObject( xObj, rName, true ) )
+    if (xObj.is() && StoreEmbeddedObject(xObj, rName, true, rSrcShellID, rDestShellID))
     {
         xResult = Get_Impl( rName, xObj);
         if ( !xResult.is() )
diff --git a/include/comphelper/embeddedobjectcontainer.hxx b/include/comphelper/embeddedobjectcontainer.hxx
index 28be667..8895a8d 100644
--- a/include/comphelper/embeddedobjectcontainer.hxx
+++ b/include/comphelper/embeddedobjectcontainer.hxx
@@ -58,7 +58,9 @@ class COMPHELPER_DLLPUBLIC EmbeddedObjectContainer
 
 public:
     // add an embedded object to the container storage
-    bool            StoreEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, OUString&, bool );
+    bool StoreEmbeddedObject(
+        const css::uno::Reference<css::embed::XEmbeddedObject>& xObj, OUString& rName, bool bCopy,
+        const OUString& rSrcShellID, const OUString& rDestShellID );
 
     // add an embedded object that has been imported from the container storage - should only be called by filters!
     void                AddEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, const OUString& );
@@ -119,7 +121,9 @@ public:
                         InsertEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream >&, OUString& );
 
     // copy an embedded object into the storage, open the new copy and return it
-    ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > CopyAndGetEmbeddedObject( EmbeddedObjectContainer& rSrc, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, /* TODO const OUString& aOrigName,*/ OUString& rName );
+    css::uno::Reference <css::embed::XEmbeddedObject> CopyAndGetEmbeddedObject(
+        EmbeddedObjectContainer& rSrc, const css::uno::Reference <css::embed::XEmbeddedObject>& xObj, OUString& rName,
+        const OUString& rSrcShellID, const OUString& rDestShellID );
 
     // move an embedded object from one container to another one
     bool MoveEmbeddedObject( EmbeddedObjectContainer& rSrc, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, OUString& );
diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx
index 4a714dc..21e27fa 100644
--- a/include/svx/fmview.hxx
+++ b/include/svx/fmview.hxx
@@ -108,8 +108,6 @@ public:
 
     // for copying complete form structures, not only control models
     virtual SdrModel* GetMarkedObjModel() const SAL_OVERRIDE;
-    using E3dView::Paste;
-    virtual bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0) SAL_OVERRIDE;
 
     virtual bool MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin ) SAL_OVERRIDE;
 
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 82ee2fb..dc53f08 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -580,6 +580,9 @@ public:
     // it should be sufficient to do "virtual Foo* Clone() const { return CloneHelper< Foo >(); }".
     // Note that this function uses operator= internally.
     virtual SdrObject* Clone() const;
+
+    virtual SdrObject* CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const;
+
     // implemented mainly for the purposes of Clone()
     SdrObject& operator=(const SdrObject& rObj);
 
diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index ce42640..68ad43e 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -145,7 +145,10 @@ public:
     virtual OUString TakeObjNameSingul() const SAL_OVERRIDE;
     virtual OUString TakeObjNamePlural() const SAL_OVERRIDE;
 
-    SdrOle2Obj* Clone() const SAL_OVERRIDE;
+    virtual SdrOle2Obj* Clone() const SAL_OVERRIDE;
+    virtual SdrOle2Obj* CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const SAL_OVERRIDE;
+
+    SdrOle2Obj& assignFrom( const SdrOle2Obj& rObj, const OUString& rSrcShellID, const OUString& rDestShellID );
     SdrOle2Obj& operator=(const SdrOle2Obj& rObj);
 
     virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
diff --git a/include/svx/svdxcgv.hxx b/include/svx/svdxcgv.hxx
index fa18cb5..f92a2f0 100644
--- a/include/svx/svdxcgv.hxx
+++ b/include/svx/svdxcgv.hxx
@@ -103,7 +103,10 @@ public:
     // View angezeigt wird.
     // Gueltige Werte fuer nOptions sind SDRINSERT_DONTMARK und
     // SDRINSERT_ADDMARK (siehe svdedtv.hxx).
-    virtual bool    Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+    virtual bool Paste(
+        const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+        const OUString& rSrcShellID, const OUString& rDestShellID );
+
     bool            Paste(const OUString& rStr, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
     bool            Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
 
diff --git a/include/svx/view3d.hxx b/include/svx/view3d.hxx
index 4681121..faf43db 100644
--- a/include/svx/view3d.hxx
+++ b/include/svx/view3d.hxx
@@ -98,7 +98,9 @@ public:
 
     // On Paste: We need to insert the objects of the Scene, but not the Scene itself
     using SdrView::Paste;
-    virtual bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0) SAL_OVERRIDE;
+    virtual bool Paste(
+        const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+        const OUString& rSrcShellID, const OUString& rDestShellID ) SAL_OVERRIDE;
 
     // #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...)
     bool ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene, Point aOffset);
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 14d4088..5288b1d 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -689,6 +689,11 @@ void ScDrawTransferObj::SetDragWasInternal()
     bDragWasInternal = true;
 }
 
+OUString ScDrawTransferObj::GetShellID() const
+{
+    return maShellID;
+}
+
 SdrOle2Obj* ScDrawTransferObj::GetSingleObject()
 {
     //  if single OLE object was copied, get its object
@@ -748,7 +753,10 @@ void ScDrawTransferObj::InitDocShell()
         // SdrExchangeView aDestView( pDestModel );
         SdrView aDestView( pDestModel );
         aDestView.ShowSdrPage(aDestView.GetModel()->GetPage(0));
-        aDestView.Paste( *pModel, Point( aSrcSize.Width()/2, aSrcSize.Height()/2 ) );
+        aDestView.Paste(
+            *pModel,
+            Point(aSrcSize.Width()/2, aSrcSize.Height()/2),
+            NULL, 0, OUString(), OUString());
 
         // put objects to right layer (see ScViewFunc::PasteDataFormat for SOT_FORMATSTR_ID_DRAWING)
 
diff --git a/sc/source/ui/inc/drwtrans.hxx b/sc/source/ui/inc/drwtrans.hxx
index 5b4e869..efca067 100644
--- a/sc/source/ui/inc/drwtrans.hxx
+++ b/sc/source/ui/inc/drwtrans.hxx
@@ -90,6 +90,8 @@ public:
     void                SetDragSourceFlags( sal_uInt16 nFlags );
     void                SetDragWasInternal();
 
+    OUString GetShellID() const;
+
     SdrView*            GetDragSourceView()             { return pDragSourceView; }
     sal_uInt16              GetDragSourceFlags() const      { return nDragSourceFlags; }
 
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index e686a01..6cf3825 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -119,8 +119,8 @@ public:
                                                        ::com::sun::star::datatransfer::XTransferable >& rxTransferable );
 
     void            PasteDraw();
-    void            PasteDraw( const Point& rLogicPos, SdrModel* pModel,
-                                bool bGroup = false, bool bSameDocClipboard = false );
+    void PasteDraw( const Point& rLogicPos, SdrModel* pModel, bool bGroup,
+                    const OUString& rSrcShellID, const OUString& rDestShellID );
 
     bool            PasteOnDrawObjectLinked(
                         const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable,
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d6730ae..219f794 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4433,7 +4433,8 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
 
         bPasteIsMove = bIsMove;
 
-        pViewData->GetView()->PasteDraw( aLogicPos, rData.pDrawTransfer->GetModel() );
+        pViewData->GetView()->PasteDraw(
+            aLogicPos, rData.pDrawTransfer->GetModel(), false, "A", "B");
 
         if (bPasteIsMove)
             rData.pDrawTransfer->SetDragWasInternal();
@@ -4536,8 +4537,9 @@ void ScGridWindow::PasteSelection( const Point& rPosPixel )
 
                 //  bSameDocClipboard argument for PasteDraw is needed
                 //  because only DragData is checked directly inside PasteDraw
-                pViewData->GetView()->PasteDraw( aLogicPos, pDrawTransfer->GetModel(), false,
-                            pDrawTransfer->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID() );
+                pViewData->GetView()->PasteDraw(
+                    aLogicPos, pDrawTransfer->GetModel(), false,
+                    pDrawTransfer->GetShellID(), SfxObjectShell::CreateShellID(pViewData->GetDocShell()));
             }
         }
     }
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index d82e725..be5d96c 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -447,8 +447,11 @@ void ScViewFunc::PasteDraw()
                                      pViewData->GetActivePart() ) );
     ScDrawTransferObj* pDrawClip = ScDrawTransferObj::GetOwnClipboard( pWin );
     if (pDrawClip)
-        PasteDraw( aPos, pDrawClip->GetModel(), false,
-            pDrawClip->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID() );
+    {
+        OUString aSrcShellID = pDrawClip->GetShellID();
+        OUString aDestShellID = SfxObjectShell::CreateShellID(pViewData->GetDocShell());
+        PasteDraw(aPos, pDrawClip->GetModel(), false, aSrcShellID, aDestShellID);
+    }
 }
 
 void ScViewFunc::PasteFromSystem()
@@ -584,7 +587,9 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran
         SCROW nPosY = pViewData->GetCurY();
         Window* pWin = GetActiveWin();
         Point aPos = pWin->PixelToLogic( pViewData->GetScrPos( nPosX, nPosY, pViewData->GetActivePart() ) );
-        PasteDraw( aPos, pDrawClip->GetModel(), false, pDrawClip->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID() );
+        PasteDraw(
+            aPos, pDrawClip->GetModel(), false,
+            pDrawClip->GetShellID(), SfxObjectShell::CreateShellID(pViewData->GetDocShell()));
     }
     else
     {
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 8236fd6..9d39811 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -522,7 +522,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
                 nObjCount += pPage->GetObjCount();          // count group object only once
             }
 
-            PasteDraw( aPos, pModel.get(), (nObjCount > 1) );     // grouped if more than 1 object
+            PasteDraw(aPos, pModel.get(), (nObjCount > 1), "A", "B");     // grouped if more than 1 object
             pModel.reset();
             aDragShellRef->DoClose();
             bRet = true;
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 4cf39cf..8799d59 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -74,8 +74,10 @@ static void lcl_AdjustInsertPos( ScViewData* pData, Point& rPos, Size& rSize )
 }
 
 void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
-        bool bGroup, bool bSameDocClipboard )
+        bool bGroup, const OUString& rSrcShellID, const OUString& rDestShellID )
 {
+    bool bSameDocClipboard = rSrcShellID == rDestShellID;
+
     MakeDrawLayer();
     Point aPos( rLogicPos );
 
@@ -221,7 +223,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
         if ( !bSameDocClipboard )
             GetViewData()->GetDocument()->SetPastingDrawFromOtherDoc( true );
 
-        pScDrawView->Paste( *pModel, aPos, NULL, nOptions );
+        pScDrawView->Paste(*pModel, aPos, NULL, nOptions, rSrcShellID, rDestShellID);
 
         if ( !bSameDocClipboard )
             GetViewData()->GetDocument()->SetPastingDrawFromOtherDoc( false );
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index bc2af1c..65b6ff7 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1095,7 +1095,7 @@ bool SdDrawDocument::InsertBookmarkAsObject(
             pBMView->GetDoc().SetAllocDocSh(true);
 
         SdDrawDocument* pTmpDoc = (SdDrawDocument*) pBMView->GetMarkedObjModel();
-        bOK = pView->Paste(*pTmpDoc, aObjPos, pPage);
+        bOK = pView->Paste(*pTmpDoc, aObjPos, pPage, 0, OUString(), OUString());
 
         if (bOLEObjFound)
             pBMView->GetDoc().SetAllocDocSh(false);
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 80dd74e..b78671d 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -195,7 +195,10 @@ public:
     virtual void onAccessibilityOptionsChanged() SAL_OVERRIDE;
 
     virtual SdrModel*   GetMarkedObjModel() const SAL_OVERRIDE;
-    virtual bool        Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0) SAL_OVERRIDE;
+    virtual bool Paste(
+        const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+        const OUString& rSrcShellID, const OUString& rDestShellID ) SAL_OVERRIDE;
+
     using SdrExchangeView::Paste;
 
     /** returns true if we have an undo manager and there is an open list undo action */
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 631a238..9fdad1d 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -976,9 +976,11 @@ SdrModel* View::GetMarkedObjModel() const
     return FmFormView::GetMarkedObjModel();;
 }
 
-bool View::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst /* =NULL */, sal_uInt32 nOptions /* =0 */)
+bool View::Paste(
+    const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+    const OUString& rSrcShellID, const OUString& rDestShellID )
 {
-    return FmFormView::Paste( rMod, rPos, pLst,nOptions );;
+    return FmFormView::Paste(rMod, rPos, pLst, nOptions, rSrcShellID, rDestShellID);
 }
 
 } // end of namespace sd
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index f59139d..315433c 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -604,7 +604,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
                     SdDrawDocument* pSourceDoc = (SdDrawDocument*) pSourceView->GetModel();
                     pSourceDoc->CreatingDataObj( pOwnData );
                     SdDrawDocument* pModel = (SdDrawDocument*) pSourceView->GetMarkedObjModel();
-                    bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+                    bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
 
                     if( !pPage )
                         pPage = (SdPage*) GetSdrPageView()->GetPage();
@@ -645,7 +645,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
                     pWorkModel->DeletePage( (sal_uInt16) i );
             }
 
-            bReturn = Paste( *pWorkModel, maDropPos, pPage, nPasteOptions );
+            bReturn = Paste(*pWorkModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
 
             if( !pPage )
                 pPage = (SdPage*) GetSdrPageView()->GetPage();
@@ -804,7 +804,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
                         maDropPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
                     }
 
-                    bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+                    bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
                 }
 
                 xShell->DoClose();
@@ -887,7 +887,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
                             pModel->DeletePage( (sal_uInt16) i );
                     }
 
-                    bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+                    bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
 
                     if( !pPage )
                         pPage = (SdPage*) GetSdrPageView()->GetPage();
@@ -1513,7 +1513,7 @@ bool View::PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uLong nP
     pModel->setUnoModel( Reference< XInterface >::query( xComponent ) );
 
     CreateTableFromRTF( *xStm, pModel.get() );
-    bool bRet = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+    bool bRet = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
 
     xComponent->dispose();
     xComponent.clear();
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 9659771..3ac2c0d 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -441,7 +441,9 @@ SdrModel* E3dView::GetMarkedObjModel() const
 // When pasting objects have to integrated if a scene is inserted, but
 // not the scene itself
 
-bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+bool E3dView::Paste(
+    const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+    const OUString& rSrcShellID, const OUString& rDestShellID )
 {
     bool bRetval = false;
 
@@ -486,7 +488,7 @@ bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, s
     else
     {
         // call parent
-        bRetval = SdrView::Paste(rMod, rPos, pLst, nOptions);
+        bRetval = SdrView::Paste(rMod, rPos, pLst, nOptions, rSrcShellID, rDestShellID);
     }
 
     return bRetval;
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index e6234e2..702fd00 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -379,13 +379,6 @@ SdrModel* FmFormView::GetMarkedObjModel() const
     return E3dView::GetMarkedObjModel();
 }
 
-
-bool FmFormView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
-{
-    return E3dView::Paste(rMod, rPos, pLst, nOptions);
-}
-
-
 void FmFormView::ActivateControls(SdrPageView* pPageView)
 {
     if (!pPageView)
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index d8513d5..a5fd48a 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1041,6 +1041,11 @@ SdrObject* SdrObject::Clone() const
     return CloneHelper< SdrObject >();
 }
 
+SdrObject* SdrObject::CloneWithShellIDs( const OUString& /*rSrcShellID*/, const OUString& /*rDestShellID*/ ) const
+{
+    return Clone();
+}
+
 SdrObject& SdrObject::operator=(const SdrObject& rObj)
 {
     if( this == &rObj )
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index e01dae9..86379ce 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -1624,7 +1624,20 @@ SdrOle2Obj* SdrOle2Obj::Clone() const
     return CloneHelper< SdrOle2Obj >();
 }
 
-SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
+SdrOle2Obj* SdrOle2Obj::CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const
+{
+    SdrOle2Obj* pObj =
+        dynamic_cast<SdrOle2Obj*>(
+            SdrObjFactory::MakeNewObject(GetObjInventor(), GetObjIdentifier(), NULL));
+
+    if (pObj)
+        pObj->assignFrom(*this, rSrcShellID, rDestShellID);
+
+    return pObj;
+}
+
+SdrOle2Obj& SdrOle2Obj::assignFrom(
+    const SdrOle2Obj& rObj, const OUString& rSrcShellID, const OUString& rDestShellID )
 {
     //TODO/LATER: who takes over control of my old object?!
     if( &rObj != this )
@@ -1671,7 +1684,8 @@ SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
                 if ( xObj.is() )
                 {
                     OUString aTmp;
-                    xObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject( rContainer, xObj, aTmp ), rOle2Obj.GetAspect() );
+                    xObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
+                        rContainer, xObj, aTmp, rSrcShellID, rDestShellID), rOle2Obj.GetAspect());
                     m_bTypeAsked = false;
                     mpImpl->aPersistName = aTmp;
                     CheckFileLink_Impl();
@@ -1684,7 +1698,10 @@ SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
     return *this;
 }
 
-
+SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
+{
+    return assignFrom(rObj, OUString(), OUString());
+}
 
 void SdrOle2Obj::ImpSetVisAreaSize()
 {
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 0ec6046..5b3c57b 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -223,7 +223,9 @@ bool SdrExchangeView::Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt
     return true;
 }
 
-bool SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+bool SdrExchangeView::Paste(
+    const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+    const OUString& rSrcShellID, const OUString& rDestShellID )
 {
     const SdrModel* pSrcMod=&rMod;
     if (pSrcMod==pMod)
@@ -298,7 +300,7 @@ bool SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList*
         {
             const SdrObject* pSrcOb=pSrcPg->GetObj(nOb);
 
-            SdrObject* pNeuObj = pSrcOb->Clone();
+            SdrObject* pNeuObj = pSrcOb->CloneWithShellIDs(rSrcShellID, rDestShellID);
 
             if (pNeuObj!=NULL)
             {
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 9aaab2a..2dfa6a9 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1507,7 +1507,7 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
         // #i50824#
         // method <lcl_RemoveOleObjsFromSdrModel> replaced by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs>
         lcl_ConvertSdrOle2ObjsToSdrGrafObjs( pModel );
-        pView->Paste( *pModel, aPos );
+        pView->Paste(*pModel, aPos, NULL, 0, OUString(), OUString());
 
         sal_uLong nCnt = pView->GetMarkedObjectList().GetMarkCount();
         if( nCnt )
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 188d012..7c47e26 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -435,7 +435,9 @@ SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
     pPersistShell->GetEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
         pSrc->GetEmbeddedObjectContainer(),
         pSrc->GetEmbeddedObjectContainer().GetEmbeddedObject( aOLEObj.aName ),
-        aNewName );
+        aNewName,
+        OUString(),
+        OUString());
 
     SwOLENode* pOLENd = pDoc->GetNodes().MakeOLENode( rIdx, aNewName, GetAspect(),
                                     (SwGrfFmtColl*)pDoc->GetDfltGrfFmtColl(),
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index fbb75a9..10c1b7e 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -435,7 +435,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
             // TODO/LATER: Copying through the container would copy the replacement image as well
             comphelper::EmbeddedObjectContainer aCnt;
             OUString aName = aCnt.CreateUniqueObjectName();
-            if ( aCnt.StoreEmbeddedObject( rSwOLE.GetOleRef(), aName, true ) )
+            if (aCnt.StoreEmbeddedObject(rSwOLE.GetOleRef(), aName, true, OUString(), OUString()))
             {
                 uno::Reference < embed::XEmbeddedObject > aNew = aCnt.GetEmbeddedObject( aName );
                 rDoc.Insert( rContext.GetRepeatPaM(),
commit 95ce0319f14d9f3deaad06c6d8f84b73b1014c9f
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Jun 18 18:55:52 2014 -0400

    Send correct shell ID when pasting chart into writer.
    
    So that the number formats survive...
    
    Change-Id: I884c02be7ca350a99545203f9ce6d40e46937b75

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 766cb50..9d33a70 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -1717,7 +1717,10 @@ bool SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
         nId = 0;
 
     if (nId)
-        xStrm = rData.GetInputStream(nId, OUString());
+    {
+        SwDocShell* pDocSh = rSh.GetDoc()->GetDocShell();
+        xStrm = rData.GetInputStream(nId, SfxObjectShell::CreateShellID(pDocSh));
+    }
 
     if (xStrm.is())
     {
commit 477a82987dc66b4d2471295d75a77b5660c13963
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Jun 18 10:33:03 2014 -0400

    Copy the number formats when copying sheet data for chart on clipboard.
    
    Else the chart may lose number formats when pasted.  Ensure that number
    formats are mapped properly when copying them from one document to another.

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index e4e956b..3c636eb 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -27,6 +27,7 @@
 #include "types.hxx"
 #include "mtvelements.hxx"
 #include <formula/types.hxx>
+#include <svl/zforlist.hxx>
 
 #include <set>
 #include <vector>
@@ -232,7 +233,10 @@ public:
 
     void CopyToClip(
         sc::CopyToClipContext& rCxt, SCROW nRow1, SCROW nRow2, ScColumn& rColumn ) const;
-    void CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol);
+
+    void CopyStaticToDocument(
+        SCROW nRow1, SCROW nRow2, const SvNumberFormatterMergeMap& rMap, ScColumn& rDestCol );
+
     void CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDestCol );
     bool InitBlockPosition( sc::ColumnBlockPosition& rBlockPos );
     bool InitBlockPosition( sc::ColumnBlockConstPosition& rBlockPos ) const;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 9d032d5..700086d 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -40,6 +40,7 @@
 #include "calcconfig.hxx"
 #include <tools/fract.hxx>
 #include <tools/gen.hxx>
+#include <svl/zforlist.hxx>
 
 #include <memory>
 #include <map>
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 14bdbe5..3d70c49 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -412,7 +412,11 @@ public:
     void        DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nDelFlag);
     void CopyToClip( sc::CopyToClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable );
     void CopyToClip( sc::CopyToClipContext& rCxt, const ScRangeList& rRanges, ScTable* pTable );
-    void CopyStaticToDocument(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pDestTab);
+
+    void CopyStaticToDocument(
+        SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const SvNumberFormatterMergeMap& rMap,
+        ScTable* pDestTab );
+
     void CopyCellToDocument( SCCOL nSrcCol, SCROW nSrcRow, SCCOL nDestCol, SCROW nDestRow, ScTable& rDestTab );
 
     bool InitColumnBlockPosition( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol );
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 0bc27bb..0f5bc92 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1040,7 +1040,8 @@ void ScColumn::CopyToClip(
     rColumn.CellStorageModified();
 }
 
-void ScColumn::CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol)
+void ScColumn::CopyStaticToDocument(
+    SCROW nRow1, SCROW nRow2, const SvNumberFormatterMergeMap& rMap, ScColumn& rDestCol )
 {
     if (nRow1 > nRow2)
         return;
@@ -1149,6 +1150,17 @@ void ScColumn::CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol
             break;
     }
 
+    // Dont' forget to copy the number formats over.  Charts may reference them.
+    for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+    {
+        sal_uInt32 nNumFmt = GetNumberFormat(nRow);
+        SvNumberFormatterMergeMap::const_iterator itNum = rMap.find(nNumFmt);
+        if (itNum != rMap.end())
+            nNumFmt = itNum->second;
+
+        rDestCol.SetNumberFormat(nRow, nNumFmt);
+    }
+
     rDestCol.CellStorageModified();
 }
 
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 4df3001..fa71aa0 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2157,8 +2157,12 @@ void ScDocument::CopyStaticToDocument(const ScRange& rSrcRange, SCTAB nDestTab,
     if (!pSrcTab || !pDestTab)
         return;
 
+    pDestDoc->GetFormatTable()->MergeFormatter(*GetFormatTable());
+    SvNumberFormatterMergeMap aMap = pDestDoc->GetFormatTable()->ConvertMergeTableToMap();
+
     pSrcTab->CopyStaticToDocument(
-        rSrcRange.aStart.Col(), rSrcRange.aStart.Row(), rSrcRange.aEnd.Col(), rSrcRange.aEnd.Row(), pDestTab);
+        rSrcRange.aStart.Col(), rSrcRange.aStart.Row(), rSrcRange.aEnd.Col(), rSrcRange.aEnd.Row(),
+        aMap, pDestTab);
 }
 
 void ScDocument::CopyCellToDocument( const ScAddress& rSrcPos, const ScAddress& rDestPos, ScDocument& rDestDoc )
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index b16aaa2..4c75534 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -556,7 +556,8 @@ void ScTable::CopyToClip(
     }
 }
 
-void ScTable::CopyStaticToDocument(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pDestTab)
+void ScTable::CopyStaticToDocument(
+    SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const SvNumberFormatterMergeMap& rMap, ScTable* pDestTab )
 {
     if (nCol1 > nCol2)
         return;
@@ -565,7 +566,7 @@ void ScTable::CopyStaticToDocument(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
     {
         ScColumn& rSrcCol = aCol[i];
         ScColumn& rDestCol = pDestTab->aCol[i];
-        rSrcCol.CopyStaticToDocument(nRow1, nRow2, rDestCol);
+        rSrcCol.CopyStaticToDocument(nRow1, nRow2, rMap, rDestCol);
     }
 }
 
commit 146c9e0154e1b42c5963a0e16d325d0bb131283f
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jun 17 19:37:20 2014 -0400

    Set the number format code only when it changes.
    
    Otherwise the chart view would keep updating itself endlessly.
    
    Change-Id: I653ae396a48dd0fdcaa3ef308657509dac541594

diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index c6ba570..acc7570 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -148,8 +148,11 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
 
     bool bLinkToSource = true;
     xProp->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkToSource;
+    xProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey;
 
-    if (bLinkToSource || !(xProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey))
+    sal_Int32 nOldNumberFormat = nNumberFormatKey;
+
+    if (bLinkToSource)
     {
         bool bFormatSet = false;
         //check whether we have a percent scale -> use percent format
@@ -323,7 +326,8 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
             }
         }
 
-        xProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::makeAny(nNumberFormatKey));
+        if (nOldNumberFormat != nNumberFormatKey)
+            xProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::makeAny(nNumberFormatKey));
     }
 
     return nNumberFormatKey;
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index a29c174..9142b3e 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1877,7 +1877,9 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
     }
     catch ( const beans::UnknownPropertyException& ) {}
 
-    if (bLinkToSource || !(xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat))
+    xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat;
+    sal_Int32 nOldFormat = nFormat;
+    if (bLinkToSource)
     {
         uno::Reference< chart2::XChartType > xChartType( DataSeriesHelper::getChartTypeOfSeries( xSeries, xDiagram ) );
 
@@ -1903,7 +1905,7 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
             }
         }
 
-        if (nFormat >= 0)
+        if (nFormat >= 0 && nOldFormat != nFormat)
             xSeriesOrPointProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::makeAny(nFormat));
     }
 
commit eb7f88bf9becf96cf2370b558e7c21ba71371af0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jun 17 18:43:48 2014 -0400

    Get the linked number format feature to work again...
    
    Now we have to query the linked number format property flag explicitly
    rather than just relying on whether or not the number format is set.
    
    Change-Id: Ic9a35a252f3b8a4e9a2eaeb7459419a927c1b52f

diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index b179526..7c72e48 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -458,9 +458,8 @@ void SAL_CALL ChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram
                 if( xAxisProp.is())
                 {
                     // set number format to source format
-                    uno::Any aValue = xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT);
-                    if( aValue.hasValue())
-                        xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
+                    xAxisProp->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::makeAny(true));
+                    xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
                 }
             }
         }
@@ -758,9 +757,8 @@ void ChartTypeTemplate::adaptAxes(
                             if( xAxisProp.is())
                             {
                                 // set number format to source format
-                                uno::Any aValue = xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT);
-                                if( aValue.hasValue())
-                                    xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
+                                xAxisProp->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::makeAny(true));
+                                xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
                             }
                         }
                     }
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index 48a3a72..c6ba570 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -143,7 +143,13 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
     Reference< chart2::XChartDocument > xChartDoc( xNumberFormatsSupplier, uno::UNO_QUERY );
 
     Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
-    if( xProp.is() && !( xProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey ) )
+    if (!xProp.is())
+        return 0;
+
+    bool bLinkToSource = true;
+    xProp->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkToSource;
+
+    if (bLinkToSource || !(xProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey))
     {
         bool bFormatSet = false;
         //check whether we have a percent scale -> use percent format
@@ -316,7 +322,10 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
                 }
             }
         }
+
+        xProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::makeAny(nNumberFormatKey));
     }
+
     return nNumberFormatKey;
 }
 
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 4d4c3c8..a29c174 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1870,7 +1870,14 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
     if( !xSeriesOrPointProp.is() )
         return nFormat;
 
-    if (!(xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat))
+    bool bLinkToSource = true;
+    try
+    {
+        xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkToSource;
+    }
+    catch ( const beans::UnknownPropertyException& ) {}
+
+    if (bLinkToSource || !(xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat))
     {
         uno::Reference< chart2::XChartType > xChartType( DataSeriesHelper::getChartTypeOfSeries( xSeries, xDiagram ) );
 
@@ -1895,7 +1902,11 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
                     nFormat = xValues->getNumberFormatKeyByIndex( nPointIndex );
             }
         }
+
+        if (nFormat >= 0)
+            xSeriesOrPointProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::makeAny(nFormat));
     }
+
     if(nFormat<0)
         nFormat=0;
     return nFormat;
commit 5663fa6e26ee4cdc16de52a96cd81c8049c3399c
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jun 17 17:08:31 2014 -0400

    Disable "link to source" when the source and destination shell IDs differ.
    
    This should preserve number formats in chart when pasted, even if the
    original chart has its number formats linked to its data source.
    
    Change-Id: I78a704d6fae00680b19d7558b95340dba14a9ca0

diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index d2cdfbd..a6e46ea 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -2279,6 +2279,32 @@ bool lcl_exportAxisType( const Reference< chart2::XAxis > xChart2Axis, SvXMLExpo
     return bExportDateScale;
 }
 
+void disableLinkedNumberFormat(
+    std::vector<XMLPropertyState>& rPropStates, const UniReference<XMLPropertySetMapper>& rMapper )
+{
+    for (size_t i = 0; i < rPropStates.size(); ++i)
+    {
+        XMLPropertyState& rState = rPropStates[i];
+        if (rState.mnIndex < 0 || rMapper->GetEntryCount() <= rState.mnIndex)
+            continue;
+
+        OUString aXMLName = rMapper->GetEntryXMLName(rState.mnIndex);
+
+        if (aXMLName != "link-data-style-to-source")
+            continue;
+
+        // Entry found.  Set the value to false and bail out.
+        rState.maValue <<= false;
+        return;
+    }
+
+    // Entry not found.  Insert a new entry for this.
+    sal_Int32 nIndex = rMapper->GetEntryIndex(XML_NAMESPACE_CHART, "link-data-style-to-source", 0);
+    XMLPropertyState aState(nIndex);
+    aState.maValue <<= false;
+    rPropStates.push_back(aState);
+}
+
 }
 
 void SchXMLExportHelper_Impl::exportAxis(
@@ -2297,7 +2323,6 @@ void SchXMLExportHelper_Impl::exportAxis(
     // get property states for autostyles
     if( xAxisProps.is() && mxExpPropMapper.is() )
     {
-        bool bIgnoreLinkedNumFmt = maSrcShellID != maDestShellID;
         lcl_exportNumberFormat( sNumFormat, xAxisProps, mrExport );
         aPropertyStates = mxExpPropMapper->Filter( xAxisProps );
 
@@ -2305,33 +2330,12 @@ void SchXMLExportHelper_Impl::exportAxis(
                 rtl::OUStringToOString(maSrcShellID, RTL_TEXTENCODING_UTF8).getStr(),
                 rtl::OUStringToOString(maDestShellID, RTL_TEXTENCODING_UTF8).getStr());
 
-        if (bIgnoreLinkedNumFmt && false)
+        if (!maSrcShellID.isEmpty() && !maDestShellID.isEmpty() && maSrcShellID != maDestShellID)
         {
-            bool bFound = false;
-            const UniReference<XMLPropertySetMapper>& rMapper = mxExpPropMapper->getPropertySetMapper();
-            for (size_t i = 0; i < aPropertyStates.size(); ++i)
-            {
-                XMLPropertyState& rState = aPropertyStates[i];
-                if (rState.mnIndex < 0 || rMapper->GetEntryCount() <= rState.mnIndex)
-                    continue;
-
-                OUString aAPIName = rMapper->GetEntryAPIName(rState.mnIndex);
-                OUString aXMLName = rMapper->GetEntryXMLName(rState.mnIndex);
-
-                if (aAPIName != "LinkNumberFormatToSource")
-                    continue;
-
-                rState.maValue <<= false;
-                bFound = true;
-            }
-
-            if (!bFound)
-            {
-                sal_Int32 nIndex = rMapper->GetEntryIndex(XML_NAMESPACE_CHART, "link-data-style-to-source", 0);
-                XMLPropertyState aState(nIndex);
-                aState.maValue <<= false;
-                aPropertyStates.push_back(aState);
-            }
+            // Disable link to source number format property when pasting to
+            // a different doc shell.  These shell ID's should be both empty
+            // during real ODF export.
+            disableLinkedNumberFormat(aPropertyStates, mxExpPropMapper->getPropertySetMapper());
         }
     }
 
commit aeb086514060affd61c8a62f8dfd95b8a9b1ab93
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jun 17 16:54:18 2014 -0400

    Make the "link to source" property a real property of Axis and DataPoint.
    
    It was previously just an alias for the NumberFormat property not being
    set i.e. the single internal property "NumberFormat" representing 2
    external properties.
    
    Change-Id: Id17dd5bd1ce4d9296917620229498b2128bab378

diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 2c10c61..4643d6c 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -656,9 +656,8 @@ const std::vector< WrappedProperty* > AxisWrapper::createWrappedProperties()
     aWrappedProperties.push_back( new WrappedProperty("Visible","Show") );
     aWrappedProperties.push_back( new WrappedDirectStateProperty("DisplayLabels","DisplayLabels") );
     aWrappedProperties.push_back( new WrappedDirectStateProperty("TextBreak","TextBreak") );
-    WrappedNumberFormatProperty* pWrappedNumberFormatProperty = new WrappedNumberFormatProperty( m_spChart2ModelContact );
-    aWrappedProperties.push_back( pWrappedNumberFormatProperty );
-    aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(pWrappedNumberFormatProperty) );
+    aWrappedProperties.push_back( new WrappedNumberFormatProperty(m_spChart2ModelContact) );
+    aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(m_spChart2ModelContact) );
     aWrappedProperties.push_back( new WrappedProperty("StackedText","StackCharacters") );
     aWrappedProperties.push_back( new WrappedDirectStateProperty("CrossoverPosition","CrossoverPosition") );
     {
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index e8fc2e0..7199f97 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -697,9 +697,8 @@ const std::vector< WrappedProperty* > DataSeriesPointWrapper::createWrappedPrope
         WrappedStatisticProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
         aWrappedProperties.push_back( new WrappedAttachedAxisProperty( m_spChart2ModelContact ) );
 
-        WrappedNumberFormatProperty* pWrappedNumberFormatProperty = new WrappedNumberFormatProperty( m_spChart2ModelContact );
-        aWrappedProperties.push_back( pWrappedNumberFormatProperty );
-        aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(pWrappedNumberFormatProperty) );
+        aWrappedProperties.push_back( new WrappedNumberFormatProperty(m_spChart2ModelContact) );
+        aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(m_spChart2ModelContact) );
     }
 
     WrappedSymbolProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
index 198dc0c..85d8e7e 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
@@ -33,18 +33,11 @@ namespace wrapper
 WrappedNumberFormatProperty::WrappedNumberFormatProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
         : WrappedDirectStateProperty( CHART_UNONAME_NUMFMT, CHART_UNONAME_NUMFMT )
         , m_spChart2ModelContact(spChart2ModelContact)
-        , m_pWrappedLinkNumberFormatProperty(NULL)
 {
-    m_aOuterValue = getPropertyDefault( 0 );
 }
 
 WrappedNumberFormatProperty::~WrappedNumberFormatProperty()
 {
-    if( m_pWrappedLinkNumberFormatProperty )
-    {
-        if( m_pWrappedLinkNumberFormatProperty->m_pWrappedNumberFormatProperty == this )
-            m_pWrappedLinkNumberFormatProperty->m_pWrappedNumberFormatProperty = 0;
-    }
 }
 
 void WrappedNumberFormatProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
@@ -54,19 +47,8 @@ void WrappedNumberFormatProperty::setPropertyValue( const Any& rOuterValue, cons
     if( ! (rOuterValue >>= nFormat) )
         throw lang::IllegalArgumentException( "Property 'NumberFormat' requires value of type sal_Int32", 0, 0 );
 
-    m_aOuterValue = rOuterValue;
     if(xInnerPropertySet.is())
-    {
-        bool bUseSourceFormat = !xInnerPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue();
-        if( bUseSourceFormat )
-        {
-            uno::Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
-            if( xChartDoc.is() && xChartDoc->hasInternalDataProvider() )
-                bUseSourceFormat = false;
-        }
-        if( !bUseSourceFormat )
-            xInnerPropertySet->setPropertyValue( m_aInnerName, this->convertOuterToInnerValue( rOuterValue ) );
-    }
+        xInnerPropertySet->setPropertyValue(getInnerName(), this->convertOuterToInnerValue(rOuterValue));
 }
 
 Any WrappedNumberFormatProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
@@ -77,7 +59,7 @@ Any WrappedNumberFormatProperty::getPropertyValue( const Reference< beans::XProp
         OSL_FAIL("missing xInnerPropertySet in WrappedNumberFormatProperty::getPropertyValue");
         return Any();
     }
-    Any aRet( xInnerPropertySet->getPropertyValue( m_aInnerName ));
+    Any aRet( xInnerPropertySet->getPropertyValue(getInnerName()));
     if( !aRet.hasValue() )
     {
         sal_Int32 nKey = 0;
@@ -100,23 +82,14 @@ Any WrappedNumberFormatProperty::getPropertyDefault( const Reference< beans::XPr
     return uno::makeAny( sal_Int32( 0 ) );
 }
 
-WrappedLinkNumberFormatProperty::WrappedLinkNumberFormatProperty( WrappedNumberFormatProperty* pWrappedNumberFormatProperty ) :
-    WrappedProperty( CHART_UNONAME_LINK_TO_SRC_NUMFMT, OUString() ),
-    m_pWrappedNumberFormatProperty( pWrappedNumberFormatProperty )
+WrappedLinkNumberFormatProperty::WrappedLinkNumberFormatProperty( const boost::shared_ptr<Chart2ModelContact>& pChart2ModelContact ) :
+    WrappedDirectStateProperty(CHART_UNONAME_LINK_TO_SRC_NUMFMT, CHART_UNONAME_LINK_TO_SRC_NUMFMT),
+    m_pChart2ModelContact(pChart2ModelContact)
 {
-    if( m_pWrappedNumberFormatProperty )
-    {
-        m_pWrappedNumberFormatProperty->m_pWrappedLinkNumberFormatProperty = this;
-    }
 }
 
 WrappedLinkNumberFormatProperty::~WrappedLinkNumberFormatProperty()
 {
-    if( m_pWrappedNumberFormatProperty )
-    {
-        if( m_pWrappedNumberFormatProperty->m_pWrappedLinkNumberFormatProperty == this )
-            m_pWrappedNumberFormatProperty->m_pWrappedLinkNumberFormatProperty = 0;
-    }
 }
 
 void WrappedLinkNumberFormatProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
@@ -128,31 +101,7 @@ void WrappedLinkNumberFormatProperty::setPropertyValue( const Any& rOuterValue,
         return;
     }
 
-    bool bLinkFormat = false;
-    if( rOuterValue >>= bLinkFormat )
-    {
-        Any aValue;
-        if( bLinkFormat )
-        {
-            if( m_pWrappedNumberFormatProperty )
-            {
-                uno::Reference< chart2::XChartDocument > xChartDoc( m_pWrappedNumberFormatProperty->m_spChart2ModelContact->getChart2Document() );
-                if( xChartDoc.is() && xChartDoc->hasInternalDataProvider() )
-                    return;
-            }
-        }
-        else
-        {
-            if( m_pWrappedNumberFormatProperty )
-            {
-                aValue = m_pWrappedNumberFormatProperty->getPropertyValue( xInnerPropertySet );
-            }
-            else
-                aValue <<= sal_Int32( 0 );
-        }
-
-        xInnerPropertySet->setPropertyValue(CHART_UNONAME_NUMFMT, aValue);
-    }
+    xInnerPropertySet->setPropertyValue(getInnerName(), rOuterValue);
 }
 
 Any WrappedLinkNumberFormatProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
@@ -163,8 +112,8 @@ Any WrappedLinkNumberFormatProperty::getPropertyValue( const Reference< beans::X
         OSL_FAIL("missing xInnerPropertySet in WrappedNumberFormatProperty::getPropertyValue");
         return getPropertyDefault(0);
     }
-    bool bLink = ! xInnerPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue();
-    return uno::makeAny( bLink );
+
+    return xInnerPropertySet->getPropertyValue(getInnerName());
 }
 
 Any WrappedLinkNumberFormatProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx
index 618fc07..d721e6b 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx
@@ -49,14 +49,12 @@ public:
     friend class WrappedLinkNumberFormatProperty;
 private:
     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
-    mutable ::com::sun::star::uno::Any m_aOuterValue;
-    WrappedLinkNumberFormatProperty* m_pWrappedLinkNumberFormatProperty;
 };
 
-class WrappedLinkNumberFormatProperty : public WrappedProperty
+class WrappedLinkNumberFormatProperty : public WrappedDirectStateProperty
 {
 public:
-    WrappedLinkNumberFormatProperty( WrappedNumberFormatProperty* pWrappedNumberFormatProperty );
+    WrappedLinkNumberFormatProperty( const boost::shared_ptr<Chart2ModelContact>& pChart2ModelContact );
     virtual ~WrappedLinkNumberFormatProperty();
 
     virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
@@ -68,9 +66,8 @@ public:
     virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
 
-    friend class WrappedNumberFormatProperty;
 private:
-    WrappedNumberFormatProperty* m_pWrappedNumberFormatProperty;
+    boost::shared_ptr<Chart2ModelContact> m_pChart2ModelContact;
 };
 
 } //namespace wrapper
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index fe8eeb5..e3b7175 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -423,8 +423,9 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
 
         case SID_ATTR_NUMBERFORMAT_SOURCE:
         {
-            bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue());
-            rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet ));
+            bool bLinkToSource = true;
+            GetPropertySet()->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkToSource;
+            rOutItemSet.Put(SfxBoolItem(nWhichId, bLinkToSource));
         }
         break;
 
@@ -930,6 +931,8 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
             bool bUseSourceFormat =
                 (static_cast< const SfxBoolItem & >(
                     rItemSet.Get( nWhichId )).GetValue() );
+            GetPropertySet()->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::makeAny(bUseSourceFormat));
+
             bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue();
 
             bChangedOtherwise = (bUseSourceFormat == bNumberFormatIsSet);
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index 90e7660..a345bd9 100644
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -67,7 +67,8 @@ enum
     PROP_AXIS_CROSSOVER_POSITION,
     PROP_AXIS_CROSSOVER_VALUE,
     PROP_AXIS_DISPLAY_LABELS,
-    PROP_AXIS_NUMBER_FORMAT,
+    PROP_AXIS_NUMBERFORMAT,
+    PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
     PROP_AXIS_LABEL_POSITION,
     PROP_AXIS_TEXT_ROTATION,
     PROP_AXIS_TEXT_BREAK,
@@ -115,10 +116,17 @@ void lcl_AddPropertiesToVector(
 
     rOutProperties.push_back(
         Property( CHART_UNONAME_NUMFMT,
-                  PROP_AXIS_NUMBER_FORMAT,
+                  PROP_AXIS_NUMBERFORMAT,
                   cppu::UnoType<sal_Int32>::get(),
                   beans::PropertyAttribute::BOUND
-                  | beans::PropertyAttribute::MAYBEVOID ));
+                  | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+    rOutProperties.push_back(
+        Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT,
+                  PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
+                  ::getBooleanCppuType(),
+                  beans::PropertyAttribute::BOUND
+                  | beans::PropertyAttribute::MAYBEDEFAULT ));
 
     rOutProperties.push_back(
         Property( "LabelPosition",
@@ -220,6 +228,7 @@ private:
         ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true );
         ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, ::com::sun::star::chart::ChartAxisPosition_ZERO );
         ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_LABELS, true );
+        ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE, true );
         ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LABEL_POSITION, ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS );
         ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_AXIS_TEXT_ROTATION, 0.0 );
         ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_BREAK, false );
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index 2ebfa95..e145d42 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -282,7 +282,14 @@ void DataPointProperties::AddPropertiesToVector(
                   PROP_DATAPOINT_NUMBER_FORMAT,
                   cppu::UnoType<sal_Int32>::get(),
                   beans::PropertyAttribute::BOUND
-                  | beans::PropertyAttribute::MAYBEVOID ));
+                  | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+    rOutProperties.push_back(
+        Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT,
+                  PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE,
+                  ::getBooleanCppuType(),
+                  beans::PropertyAttribute::BOUND
+                  | beans::PropertyAttribute::MAYBEDEFAULT ));
 
     //additional 'PercentageNumberFormat'
     rOutProperties.push_back(
@@ -410,6 +417,8 @@ void DataPointProperties::AddDefaultsToMap(
     PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_DATAPOINT_PERCENT_DIAGONAL, 0 );
 
     PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_DATAPOINT_TEXT_ROTATION, 0.0 );
+
+    PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE, true);
 }
 
 } //  namespace chart
diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx
index 596adf8..2d7258a 100644
--- a/chart2/source/model/main/DataPointProperties.hxx
+++ b/chart2/source/model/main/DataPointProperties.hxx
@@ -62,6 +62,7 @@ public:
         PROP_DATAPOINT_LABEL,
         PROP_DATAPOINT_LABEL_SEPARATOR,
         PROP_DATAPOINT_NUMBER_FORMAT,
+        PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE,
         PROP_DATAPOINT_PERCENTAGE_NUMBER_FORMAT,
         PROP_DATAPOINT_LABEL_PLACEMENT,
         PROP_DATAPOINT_REFERENCE_DIAGRAM_SIZE,
commit fef5655df572e9e363da485d7a138ecd626c3ea0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jun 17 11:41:06 2014 -0400

    Use define constant to keep track of all NumberFormat property usage.
    
    Change-Id: I2a544922e03ec8253290ac8bf5a89c9cdd72d8dd

diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx
index 7962249..2b5f601 100644
--- a/chart2/inc/unonames.hxx
+++ b/chart2/inc/unonames.hxx
@@ -17,6 +17,8 @@
 #define CHART_UNONAME_SPLINE_RESOLUTION     "SplineResolution"
 #define CHART_UNONAME_CURVE_STYLE           "CurveStyle"
 #define CHART_UNONAME_CURVE_RESOLUTION      "CurveResolution"
+#define CHART_UNONAME_NUMFMT                "NumberFormat"
+#define CHART_UNONAME_LINK_TO_SRC_NUMFMT    "LinkNumberFormatToSource"
 
 #endif
 
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 06d56b3..2c10c61 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -27,6 +27,7 @@
 #include "GridWrapper.hxx"
 #include "TitleWrapper.hxx"
 #include "DisposeHelper.hxx"
+#include <unonames.hxx>
 
 #include <comphelper/InlineContainer.hxx>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -270,14 +271,14 @@ void lcl_AddPropertiesToVector(
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
 
     rOutProperties.push_back(
-        Property( "NumberFormat",
+        Property( CHART_UNONAME_NUMFMT,
                   PROP_AXIS_NUMBERFORMAT,
                   cppu::UnoType<sal_Int32>::get(),
                   beans::PropertyAttribute::BOUND
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
 
     rOutProperties.push_back(
-        Property( "LinkNumberFormatToSource",
+        Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT,
                   PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
                   ::getBooleanCppuType(),
                   beans::PropertyAttribute::BOUND
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index 0a4cf66..e8fc2e0 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -39,6 +39,8 @@
 #include "WrappedScaleTextProperties.hxx"
 #include "WrappedNumberFormatProperty.hxx"
 #include "WrappedTextRotationProperty.hxx"
+#include <unonames.hxx>
+
 #include <rtl/ustrbuf.hxx>
 #include <rtl/math.hxx>
 
@@ -114,7 +116,7 @@ void lcl_AddPropertiesToVector_PointProperties(
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
 
     rOutProperties.push_back(
-        Property( "NumberFormat",
+        Property( CHART_UNONAME_NUMFMT,
                   PROP_SERIES_NUMBERFORMAT,
                   cppu::UnoType<sal_Int32>::get(),
                   beans::PropertyAttribute::BOUND
@@ -153,7 +155,7 @@ void lcl_AddPropertiesToVector_SeriesOnly(
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
 
     rOutProperties.push_back(
-        Property( "LinkNumberFormatToSource",
+        Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT,
                   PROP_SERIES_LINK_NUMBERFORMAT_TO_SOURCE,
                   ::getBooleanCppuType(),
                   beans::PropertyAttribute::BOUND
diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
index ce73ee3..198dc0c 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
@@ -19,6 +19,7 @@
 
 #include "WrappedNumberFormatProperty.hxx"
 #include "macros.hxx"
+#include <unonames.hxx>
 
 using namespace ::com::sun::star;
 using ::com::sun::star::uno::Reference;
@@ -30,7 +31,7 @@ namespace wrapper
 {
 
 WrappedNumberFormatProperty::WrappedNumberFormatProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
-        : WrappedDirectStateProperty( "NumberFormat", "NumberFormat" )
+        : WrappedDirectStateProperty( CHART_UNONAME_NUMFMT, CHART_UNONAME_NUMFMT )
         , m_spChart2ModelContact(spChart2ModelContact)
         , m_pWrappedLinkNumberFormatProperty(NULL)
 {
@@ -56,7 +57,7 @@ void WrappedNumberFormatProperty::setPropertyValue( const Any& rOuterValue, cons
     m_aOuterValue = rOuterValue;
     if(xInnerPropertySet.is())
     {
-        bool bUseSourceFormat = !xInnerPropertySet->getPropertyValue( "NumberFormat" ).hasValue();
+        bool bUseSourceFormat = !xInnerPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue();
         if( bUseSourceFormat )
         {
             uno::Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
@@ -99,9 +100,9 @@ Any WrappedNumberFormatProperty::getPropertyDefault( const Reference< beans::XPr
     return uno::makeAny( sal_Int32( 0 ) );
 }
 
-WrappedLinkNumberFormatProperty::WrappedLinkNumberFormatProperty( WrappedNumberFormatProperty* pWrappedNumberFormatProperty )
-    : WrappedProperty( "LinkNumberFormatToSource", OUString() )
-        , m_pWrappedNumberFormatProperty( pWrappedNumberFormatProperty )
+WrappedLinkNumberFormatProperty::WrappedLinkNumberFormatProperty( WrappedNumberFormatProperty* pWrappedNumberFormatProperty ) :
+    WrappedProperty( CHART_UNONAME_LINK_TO_SRC_NUMFMT, OUString() ),
+    m_pWrappedNumberFormatProperty( pWrappedNumberFormatProperty )
 {
     if( m_pWrappedNumberFormatProperty )
     {
@@ -150,7 +151,7 @@ void WrappedLinkNumberFormatProperty::setPropertyValue( const Any& rOuterValue,
                 aValue <<= sal_Int32( 0 );
         }
 
-        xInnerPropertySet->setPropertyValue( "NumberFormat", aValue );
+        xInnerPropertySet->setPropertyValue(CHART_UNONAME_NUMFMT, aValue);
     }
 }
 
@@ -162,7 +163,7 @@ Any WrappedLinkNumberFormatProperty::getPropertyValue( const Reference< beans::X
         OSL_FAIL("missing xInnerPropertySet in WrappedNumberFormatProperty::getPropertyValue");
         return getPropertyDefault(0);
     }
-    bool bLink = ! xInnerPropertySet->getPropertyValue( "NumberFormat" ).hasValue();
+    bool bLink = ! xInnerPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue();
     return uno::makeAny( bLink );
 }
 
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index aafc9d3..3ff0dbc 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -32,6 +32,7 @@
 #include "ExplicitCategoriesProvider.hxx"
 
 #include "ChartModel.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/container/XIndexReplace.hpp>
 #include <com/sun/star/chart2/XAxis.hpp>
@@ -334,7 +335,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
 
             Reference< beans::XPropertySet > xSeriesProps( xSeries, uno::UNO_QUERY );
             if( xSeriesProps.is() )
-                xSeriesProps->getPropertyValue( "NumberFormat" ) >>= nSeriesNumberFormat;
+                xSeriesProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nSeriesNumberFormat;
         }
         else
         {
@@ -407,7 +408,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
                     //give the new series the same number format as the former series especially for bubble charts thus the bubble size values can be edited with same format immediately
                     Reference< beans::XPropertySet > xNewSeriesProps( xNewSeries, uno::UNO_QUERY );
                     if( xNewSeriesProps.is() )
-                        xNewSeriesProps->setPropertyValue( "NumberFormat" , uno::makeAny( nSeriesNumberFormat ) );
+                        xNewSeriesProps->setPropertyValue(CHART_UNONAME_NUMFMT , uno::makeAny(nSeriesNumberFormat));
                 }
 
                 updateFromModel();
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index ee25d44..fe8eeb5 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -29,6 +29,7 @@
 #include "AxisHelper.hxx"
 #include "CommonConverters.hxx"
 #include "ChartTypeHelper.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
 #include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
@@ -422,7 +423,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
 
         case SID_ATTR_NUMBERFORMAT_SOURCE:
         {
-            bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( "NumberFormat" ).hasValue());
+            bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue());
             rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet ));
         }
         break;
@@ -914,9 +915,9 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
                             rItemSet.Get( nWhichId )).GetValue());
 
                     aValue = uno::makeAny(nFmt);
-                    if( GetPropertySet()->getPropertyValue( "NumberFormat" ) != aValue )
+                    if (GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT) != aValue)
                     {
-                        GetPropertySet()->setPropertyValue( "NumberFormat" , aValue );
+                        GetPropertySet()->setPropertyValue(CHART_UNONAME_NUMFMT , aValue);
                         bChangedOtherwise = true;
                     }
                 }
@@ -929,7 +930,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
             bool bUseSourceFormat =
                 (static_cast< const SfxBoolItem & >(
                     rItemSet.Get( nWhichId )).GetValue() );
-            bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( "NumberFormat").hasValue());
+            bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue();
 
             bChangedOtherwise = (bUseSourceFormat == bNumberFormatIsSet);
             if( bChangedOtherwise )
@@ -957,7 +958,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
                     }
                 }
                 // else set a void Any
-                GetPropertySet()->setPropertyValue( "NumberFormat" , aValue );
+                GetPropertySet()->setPropertyValue(CHART_UNONAME_NUMFMT , aValue);
             }
         }
         break;
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index f03c410..213208d 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -30,6 +30,8 @@
 #include "DiagramHelper.hxx"
 #include "ChartModelHelper.hxx"
 #include "ChartTypeHelper.hxx"
+#include <unonames.hxx>
+
 #include <svx/chrtitem.hxx>
 #include <com/sun/star/chart2/DataPointLabel.hpp>
 #include <com/sun/star/chart2/Symbol.hpp>
@@ -96,7 +98,7 @@ bool lcl_NumberFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSe
     bool bChanged = false;
     if( !xPropertySet.is() )
         return bChanged;
-    OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? OUString( "NumberFormat" ) : OUString( "PercentageNumberFormat" );
+    OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" );
     sal_uInt16 nSourceWhich = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE;
 
     if( SFX_ITEM_SET != rItemSet.GetItemState( nSourceWhich ) )
@@ -143,7 +145,7 @@ bool lcl_UseSourceFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxIte
     bool bChanged = false;
     if( !xPropertySet.is() )
         return bChanged;
-    OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? OUString( "NumberFormat" ) : OUString( "PercentageNumberFormat" );
+    OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" );
     sal_uInt16 nFormatWhich = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE;
 
     if( SFX_ITEM_SET != rItemSet.GetItemState( nWhichId ) )
@@ -558,7 +560,7 @@ void DataPointItemConverter::FillSpecialItem(
         case SID_ATTR_NUMBERFORMAT_VALUE:
         {
             sal_Int32 nKey = 0;
-            if( !(GetPropertySet()->getPropertyValue( "NumberFormat" ) >>= nKey) )
+            if (!(GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nKey))
                 nKey = m_nNumberFormat;
             rOutItemSet.Put( SfxUInt32Item( nWhichId, nKey ));
         }
@@ -575,7 +577,7 @@ void DataPointItemConverter::FillSpecialItem(
 
         case SID_ATTR_NUMBERFORMAT_SOURCE:
         {
-            bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( "NumberFormat" ).hasValue());
+            bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue();
             rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet ));
         }
         break;
diff --git a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
index 7f9d188..4cf5baa 100644
--- a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
@@ -24,6 +24,7 @@
 #include "GraphicPropertyItemConverter.hxx"
 #include "CharacterPropertyItemConverter.hxx"
 #include "MultipleItemConverter.hxx"
+#include <unonames.hxx>
 
 #include <svl/intitem.hxx>
 #include <rtl/math.hxx>
@@ -125,9 +126,9 @@ bool RegressionEquationItemConverter::ApplySpecialItem(
             uno::Any aValue( static_cast< sal_Int32 >(
                 static_cast< const SfxUInt32Item & >(
                     rItemSet.Get( nWhichId )).GetValue()));
-            if( GetPropertySet()->getPropertyValue( "NumberFormat" ) != aValue )
+            if (GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT) != aValue)
             {
-                GetPropertySet()->setPropertyValue( "NumberFormat", aValue );
+                GetPropertySet()->setPropertyValue(CHART_UNONAME_NUMFMT, aValue);
                 bChanged = true;
             }
         }
@@ -146,7 +147,7 @@ void RegressionEquationItemConverter::FillSpecialItem(
         case SID_ATTR_NUMBERFORMAT_VALUE:
         {
             sal_Int32 nFormatKey = 0;
-            if( GetPropertySet()->getPropertyValue( "NumberFormat" ) >>= nFormatKey )
+            if (GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormatKey)
             {
                 rOutItemSet.Put( SfxUInt32Item( nWhichId, nFormatKey ));
             }
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index 151e658..90e7660 100644
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -28,6 +28,8 @@
 #include "CloneHelper.hxx"
 #include "AxisHelper.hxx"
 #include "EventListenerHelper.hxx"
+#include <unonames.hxx>
+
 #include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
 #include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
 #include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
@@ -112,7 +114,7 @@ void lcl_AddPropertiesToVector(
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
 
     rOutProperties.push_back(
-        Property( "NumberFormat",
+        Property( CHART_UNONAME_NUMFMT,
                   PROP_AXIS_NUMBER_FORMAT,
                   cppu::UnoType<sal_Int32>::get(),
                   beans::PropertyAttribute::BOUND
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index 1f6ae08..2ebfa95 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -21,6 +21,7 @@
 #include "macros.hxx"
 #include "LinePropertiesHelper.hxx"
 #include "FillProperties.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/drawing/FillStyle.hpp>
@@ -277,7 +278,7 @@ void DataPointProperties::AddPropertiesToVector(
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
 
     rOutProperties.push_back(
-        Property( "NumberFormat",
+        Property( CHART_UNONAME_NUMFMT,
                   PROP_DATAPOINT_NUMBER_FORMAT,
                   cppu::UnoType<sal_Int32>::get(),
                   beans::PropertyAttribute::BOUND
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index de109e8..b179526 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -31,6 +31,8 @@
 #include "LegendHelper.hxx"
 #include "DiagramHelper.hxx"
 #include "AxisIndexDefines.hxx"
+#include <unonames.hxx>
+
 #include <cppuhelper/component_context.hxx>
 #include <com/sun/star/chart/ChartSolidType.hpp>
 #include <com/sun/star/chart2/AxisType.hpp>
@@ -456,9 +458,9 @@ void SAL_CALL ChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram
                 if( xAxisProp.is())
                 {
                     // set number format to source format
-                    uno::Any aValue( xAxisProp->getPropertyValue("NumberFormat"));
+                    uno::Any aValue = xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT);
                     if( aValue.hasValue())
-                        xAxisProp->setPropertyValue("NumberFormat", uno::Any());
+                        xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
                 }
             }
         }
@@ -756,9 +758,9 @@ void ChartTypeTemplate::adaptAxes(
                             if( xAxisProp.is())
                             {
                                 // set number format to source format
-                                uno::Any aValue( xAxisProp->getPropertyValue("NumberFormat"));
+                                uno::Any aValue = xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT);
                                 if( aValue.hasValue())
-                                    xAxisProp->setPropertyValue("NumberFormat", uno::Any());
+                                    xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
                             }
                         }
                     }
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index df0baa4..48a3a72 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -29,6 +29,7 @@
 #include "Scaling.hxx"
 #include "ChartModelHelper.hxx"
 #include "DataSourceHelper.hxx"
+#include <unonames.hxx>
 
 #include <unotools/saveopt.hxx>
 
@@ -142,7 +143,7 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
     Reference< chart2::XChartDocument > xChartDoc( xNumberFormatsSupplier, uno::UNO_QUERY );
 
     Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
-    if( xProp.is() && !( xProp->getPropertyValue( "NumberFormat" ) >>= nNumberFormatKey ) )
+    if( xProp.is() && !( xProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey ) )
     {
         bool bFormatSet = false;
         //check whether we have a percent scale -> use percent format
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index 3b68272..11c6dd0 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -22,6 +22,8 @@
 #include "DataSource.hxx"
 #include "macros.hxx"
 #include "ContainerHelper.hxx"
+#include <unonames.hxx>
+
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/chart2/DataPointLabel.hpp>
 #include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
@@ -478,7 +480,7 @@ sal_Int32 getNumberFormatKeyFromAxis(
         Reference< beans::XPropertySet > xAxisProp(
             xCorrespondingCoordinateSystem->getAxisByDimension( nDimensionIndex, nAxisIndex ), uno::UNO_QUERY );
         if( xAxisProp.is())
-            xAxisProp->getPropertyValue( "NumberFormat") >>= nResult;
+            xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nResult;
     }
     catch( const uno::Exception & ex )
     {
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 27d3c7c..dec53af 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -32,6 +32,7 @@
 #include "RelativePositionHelper.hxx"
 #include "ControllerLockGuard.hxx"
 #include "NumberFormatterWrapper.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/chart/MissingValueTreatment.hpp>
 #include <com/sun/star/chart/XChartDocument.hpp>
@@ -1052,7 +1053,7 @@ void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, c
         if( xAxisProps.is() && xNumberFormatsSupplier.is() )
         {
             sal_Int32 nNumberFormat = -1;
-            xAxisProps->getPropertyValue( "NumberFormat" ) >>= nNumberFormat;
+            xAxisProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat;
 
             Reference< util::XNumberFormats > xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() );
             if( xNumberFormats.is() )
@@ -1077,7 +1078,7 @@ void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, c
                     Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE,  rLocaleDataWrapper.getLanguageTag().getLocale(), bCreate );
                     if( aKeySeq.getLength() )
                     {
-                        xAxisProps->setPropertyValue( "NumberFormat", uno::makeAny(aKeySeq[0]) );
+                        xAxisProps->setPropertyValue(CHART_UNONAME_NUMFMT, uno::makeAny(aKeySeq[0]));
                     }
                 }
             }
diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index a1df24a..0ef0caa 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -27,6 +27,7 @@
 #include "ContainerHelper.hxx"
 #include "macros.hxx"
 #include "NumberFormatterWrapper.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/chart2/AxisType.hpp>
 #include <com/sun/star/util/NumberFormat.hpp>
@@ -435,7 +436,7 @@ bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >& xDataS
                 bOwnData = true;
                 Reference< beans::XPropertySet > xAxisProps( xCooSysModel->getAxisByDimension(0,0), uno::UNO_QUERY );
                 sal_Int32 nAxisNumberFormat = 0;
-                if( xAxisProps.is() && (xAxisProps->getPropertyValue( "NumberFormat" ) >>= nAxisNumberFormat) )
+                if (xAxisProps.is() && (xAxisProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nAxisNumberFormat))
                 {
                     bOwnDataAnddAxisHasAnyFormat = true;
                     bOwnDataAnddAxisHasDateFormat = DiagramHelper::isDateNumberFormat( nAxisNumberFormat, xNumberFormats );
diff --git a/chart2/source/tools/RegressionEquation.cxx b/chart2/source/tools/RegressionEquation.cxx
index 8bc63a9..755b1da 100644
--- a/chart2/source/tools/RegressionEquation.cxx
+++ b/chart2/source/tools/RegressionEquation.cxx
@@ -25,6 +25,7 @@
 #include "PropertyHelper.hxx"
 #include "macros.hxx"
 #include "ContainerHelper.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/drawing/FillStyle.hpp>
@@ -88,7 +89,7 @@ void lcl_AddPropertiesToVector(
                   | beans::PropertyAttribute::MAYBEVOID ));
 
     rOutProperties.push_back(
-        Property( "NumberFormat",
+        Property( CHART_UNONAME_NUMFMT,
                   PROP_EQUATION_NUMBER_FORMAT,
                   cppu::UnoType<sal_Int32>::get(),
                   beans::PropertyAttribute::BOUND
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 57ee304..6b147b6 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -51,6 +51,7 @@
 #include "CandleStickChart.hxx"
 #include "BubbleChart.hxx"
 #include "NetChart.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/chart/ErrorBarStyle.hpp>
 #include <com/sun/star/chart/TimeUnit.hpp>
@@ -1131,7 +1132,7 @@ void VSeriesPlotter::createRegressionCurveEquationShapes(
 
         OUStringBuffer aFormula;
         sal_Int32 nNumberFormatKey = 0;
-        xEquationProperties->getPropertyValue( "NumberFormat") >>= nNumberFormatKey;
+        xEquationProperties->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey;
 
         if( bShowEquation )
         {
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index f04433b..4d4c3c8 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -959,7 +959,7 @@ void SeriesPlotterContainer::setNumberFormatsFromAxes()
                         if( xAxisProp.is())
                         {
                             sal_Int32 nNumberFormatKey(0);
-                            if( xAxisProp->getPropertyValue( "NumberFormat" ) >>= nNumberFormatKey )
+                            if( xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey )
                             {
                                 aAxesNumberFormats.setFormat( nNumberFormatKey, nDimensionIndex, nAxisIndex );
                             }
@@ -1870,8 +1870,7 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
     if( !xSeriesOrPointProp.is() )
         return nFormat;
 
-    OUString aPropName( "NumberFormat" );
-    if( !(xSeriesOrPointProp->getPropertyValue(aPropName) >>= nFormat) )
+    if (!(xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat))
     {
         uno::Reference< chart2::XChartType > xChartType( DataSeriesHelper::getChartTypeOfSeries( xSeries, xDiagram ) );
 
@@ -1879,7 +1878,7 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
         if( ChartTypeHelper::shouldLabelNumberFormatKeyBeDetectedFromYAxis( xChartType ) )
         {
             uno::Reference< beans::XPropertySet > xAttachedAxisProps( DiagramHelper::getAttachedAxis( xSeries, xDiagram ), uno::UNO_QUERY );
-            if( xAttachedAxisProps.is() && ( xAttachedAxisProps->getPropertyValue( aPropName ) >>= nFormat ) )
+            if (xAttachedAxisProps.is() && (xAttachedAxisProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat))
                 bFormatFound = true;
         }
         if( !bFormatFound )
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 6fc0676..bd087c7 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -26,6 +26,7 @@
 #include "ContainerHelper.hxx"
 #include "DataSeriesHelper.hxx"
 #include "RegressionCurveHelper.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/chart/MissingValueTreatment.hpp>
 #include <com/sun/star/chart2/Symbol.hpp>
@@ -538,7 +539,7 @@ double VDataSeries::getBubble_Size( sal_Int32 index ) const
 
 bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const
 {
-    OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString("NumberFormat");
+    OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString(CHART_UNONAME_NUMFMT);
     bool bHasNumberFormat = false;
     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( nPointIndex ));
     sal_Int32 nNumberFormat = -1;
@@ -548,7 +549,7 @@ bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPerce
 }
 sal_Int32 VDataSeries::getExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const
 {
-    OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString("NumberFormat");
+    OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString(CHART_UNONAME_NUMFMT);
     sal_Int32 nNumberFormat = -1;
     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( nPointIndex ));
     if( xPointProp.is() )
commit b1103ed29f57cc8c8d54bb996119d9d01443e825
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jun 16 19:38:39 2014 -0400

    Pass source and destination shell IDs through myriad of abstraction layers.
    
    Change-Id: I92e4507857ca64ff6bff31947f2604a4b7c29119

diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx
index bc5f494..a5984ede 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -541,6 +541,7 @@ sal_Int32 XMLFilter::impl_Export(
     const Reference< lang::XComponent > & xDocumentComp,
     const Sequence< beans::PropertyValue > & rMediaDescriptor )
 {
+    m_aMediaDescriptor = rMediaDescriptor;
     //save
 
     sal_Int32 nWarning = 0;
@@ -744,9 +745,7 @@ sal_Int32 XMLFilter::impl_ExportStream(
         if ( !xFilter.is() )
             return ERRCODE_SFX_GENERAL;
 
-        uno::Sequence < beans::PropertyValue > aMediaDesc(0);
-        //@todo? filter properties? ... url? ...
-        xFilter->filter( aMediaDesc );
+        xFilter->filter(m_aMediaDescriptor);
     }
     catch (const uno::Exception& rEx)
     {
diff --git a/chart2/source/model/inc/XMLFilter.hxx b/chart2/source/model/inc/XMLFilter.hxx
index ad316d0..4c2c8a1 100644
--- a/chart2/source/model/inc/XMLFilter.hxx
+++ b/chart2/source/model/inc/XMLFilter.hxx
@@ -151,6 +151,9 @@ private:
         ::com::sun::star::lang::XComponent >       m_xTargetDoc;
     ::com::sun::star::uno::Reference<
         ::com::sun::star::lang::XComponent >       m_xSourceDoc;
+
+    css::uno::Sequence<css::beans::PropertyValue> m_aMediaDescriptor;
+
     OUString                                m_sDocumentHandler; // when set it will be set as doc handler
 
     volatile bool                                  m_bCancelOperation;
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index 4a057f8..cbba532 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -723,12 +723,33 @@ void OCommonEmbeddedObject::SwitchDocToStorage_Impl( const uno::Reference< docum
         m_xRecoveryStorage.clear();
 }
 
+namespace {
 
-void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed::XStorage >& xStorage,
-                                                    sal_Int32 nStorageFormat,
-                                                    const OUString& aBaseURL,
-                                                    const OUString& aHierarchName,
-                                                    bool bAttachToTheStorage )
+OUString getStringPropertyValue( const uno::Sequence<beans::PropertyValue>& rProps, const OUString& rName )
+{
+    OUString aStr;
+
+    for (sal_Int32 i = 0; i < rProps.getLength(); ++i)
+    {
+        if (rProps[i].Name == rName)
+        {
+            rProps[i].Value >>= aStr;
+            break;
+        }
+    }
+
+    return aStr;
+}
+
+}
+
+void OCommonEmbeddedObject::StoreDocToStorage_Impl(
+    const uno::Reference<embed::XStorage>& xStorage,
+    const uno::Sequence<beans::PropertyValue>& rMediaArgs,
+    const uno::Sequence<beans::PropertyValue>& rObjArgs,
+    sal_Int32 nStorageFormat,
+    const OUString& aHierarchName,
+    bool bAttachToTheStorage )
 {
     SAL_WARN_IF( !xStorage.is(), "embeddedobj.common", "No storage is provided for storing!" );
 
@@ -742,6 +763,8 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed:
             xDoc = uno::Reference< document::XStorageBasedDocument >( m_pDocHolder->GetComponent(), uno::UNO_QUERY );
     }
 
+    OUString aBaseURL = GetBaseURLFrom_Impl(rMediaArgs, rObjArgs);
+
     if ( xDoc.is() )
     {
         OUString aFilterName = GetFilterName( nStorageFormat );
@@ -750,13 +773,17 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed:
         if ( aFilterName.isEmpty() )
             throw io::IOException(); // TODO:
 
-        uno::Sequence< beans::PropertyValue > aArgs( 3 );
+        uno::Sequence<beans::PropertyValue> aArgs(5);
         aArgs[0].Name = "FilterName";
         aArgs[0].Value <<= aFilterName;
-        aArgs[2].Name = "DocumentBaseURL";
-        aArgs[2].Value <<= aBaseURL;
         aArgs[1].Name = "HierarchicalDocumentName";
         aArgs[1].Value <<= aHierarchName;
+        aArgs[2].Name = "DocumentBaseURL";
+        aArgs[2].Value <<= aBaseURL;
+        aArgs[3].Name = "SourceShellID";
+        aArgs[3].Value <<= getStringPropertyValue(rObjArgs, "SourceShellID");
+        aArgs[4].Name = "DestinationShellID";
+        aArgs[4].Value <<= getStringPropertyValue(rObjArgs, "DestinationShellID");
 
         xDoc->storeToStorage( xStorage, aArgs );
         if ( bAttachToTheStorage )
@@ -1237,7 +1264,8 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed::
 
         aGuard.clear();
         // TODO/LATER: support hierarchical name for embedded objects in embedded objects
-        StoreDocToStorage_Impl( xSubStorage, nTargetStorageFormat, GetBaseURLFrom_Impl( lArguments, lObjArgs ), sEntName, false );
+        StoreDocToStorage_Impl(
+            xSubStorage, lArguments, lObjArgs, nTargetStorageFormat, sEntName, false );
         aGuard.reset();
 
         if ( bSwitchBackToLoaded )
@@ -1374,7 +1402,8 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed::
     {
         aGuard.clear();
         // TODO/LATER: support hierarchical name for embedded objects in embedded objects
-        StoreDocToStorage_Impl( xSubStorage, nTargetStorageFormat, GetBaseURLFrom_Impl( lArguments, lObjArgs ), sEntName, false );
+        StoreDocToStorage_Impl(
+            xSubStorage, lArguments, lObjArgs, nTargetStorageFormat, sEntName, false );
         aGuard.reset();
 
         if ( bSwitchBackToLoaded )
@@ -1599,7 +1628,8 @@ void SAL_CALL OCommonEmbeddedObject::storeOwn()
         }
 
         aGuard.clear();

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list