summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/ChartModel.cxx0
-rw-r--r--sc/inc/docpool.hxx1
-rw-r--r--sc/source/core/data/docpool.cxx20
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/documen2.cxx0
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/dpobject.cxx16
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/drwlayer.cxx0
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/makefile.mk0
-rwxr-xr-x[-rw-r--r--]sc/source/filter/excel/xichart.cxx0
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx6
-rw-r--r--sc/source/ui/undo/undostyl.cxx4
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx8
-rw-r--r--sc/source/ui/view/formatsh.cxx4
-rw-r--r--[-rwxr-xr-x]sc/source/ui/view/gridwin3.cxx0
-rw-r--r--[-rwxr-xr-x]sc/source/ui/view/printfun.cxx0
14 files changed, 56 insertions, 3 deletions
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 950169395c95..950169395c95 100644..100755
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
diff --git a/sc/inc/docpool.hxx b/sc/inc/docpool.hxx
index d366ef1ec25a..59bd70592725 100644
--- a/sc/inc/docpool.hxx
+++ b/sc/inc/docpool.hxx
@@ -65,6 +65,7 @@ public:
static void CheckRef( const SfxPoolItem& );
void StyleDeleted( ScStyleSheet* pStyle ); // Loeschen von Vorlagen im Organizer
+ void CellStyleCreated( const String& rName );
virtual SfxItemPresentation GetPresentation(
const SfxPoolItem& rItem,
SfxItemPresentation ePresentation,
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index cd763cfc0787..8b2f48d8a2cc 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -651,6 +651,26 @@ void ScDocumentPool::StyleDeleted( ScStyleSheet* pStyle )
}
}
+void ScDocumentPool::CellStyleCreated( const String& rName )
+{
+ // If a style was created, don't keep any pattern with its name string in the pool,
+ // because it would compare equal to a pattern with a pointer to the new style.
+ // Calling StyleSheetChanged isn't enough because the pool may still contain items
+ // for undo or clipboard content.
+
+ sal_uInt16 nCount = GetItemCount(ATTR_PATTERN);
+ for (sal_uInt16 i=0; i<nCount; i++)
+ {
+ ScPatternAttr* pPattern = (ScPatternAttr*)GetItem(ATTR_PATTERN, i);
+ if ( pPattern && pPattern->GetStyleSheet() == NULL )
+ {
+ const String* pStyleName = pPattern->GetStyleName();
+ if ( pStyleName && *pStyleName == rName )
+ pPattern->UpdateStyleSheet(); // find and store style pointer
+ }
+ }
+}
+
SfxItemPool* __EXPORT ScDocumentPool::Clone() const
{
return new SfxItemPool (*this, TRUE);
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index e8ea10f7cf52..e8ea10f7cf52 100755..100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index a2a10329cf68..7ca41d47f79d 100755..100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -73,6 +73,7 @@
#include <comphelper/processfactory.hxx>
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <svl/zforlist.hxx> // IsNumberFormat
#include <vector>
@@ -85,6 +86,8 @@ using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::lang::XComponent;
using ::com::sun::star::sheet::DataPilotTableHeaderData;
using ::com::sun::star::sheet::DataPilotTablePositionData;
using ::com::sun::star::beans::XPropertySet;
@@ -215,6 +218,7 @@ ScDPObject::~ScDPObject()
delete pImpDesc;
delete pServDesc;
mnCacheId = -1; // Wang Xu Ming - DataPilot migration
+ InvalidateSource();
}
ScDataObject* ScDPObject::Clone() const
@@ -530,6 +534,18 @@ void ScDPObject::InvalidateData()
void ScDPObject::InvalidateSource()
{
+ Reference< XComponent > xObjectComp( xSource, UNO_QUERY );
+ if ( xObjectComp.is() )
+ {
+ try
+ {
+ xObjectComp->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
xSource = NULL;
mpTableData.reset();
}
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 4df709768279..4df709768279 100755..100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
diff --git a/sc/source/core/data/makefile.mk b/sc/source/core/data/makefile.mk
index 95ce6bcec179..95ce6bcec179 100755..100644
--- a/sc/source/core/data/makefile.mk
+++ b/sc/source/core/data/makefile.mk
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 7cbd74a836d2..7cbd74a836d2 100644..100755
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 52aae575b7d7..6e7cfed9d95c 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -392,7 +392,7 @@ void ScMenuFloatingWindow::Paint(const Rectangle& /*rRect*/)
{
SetClipRegion();
bNativeDrawn = DrawNativeControl(
- CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Region(aCtrlRect), CTRL_STATE_ENABLED,
+ CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED,
ImplControlValue(), OUString());
}
else
@@ -755,7 +755,7 @@ void ScMenuFloatingWindow::highlightMenuItem(size_t nPos, bool bSelected)
Point aPos;
Size aSize;
getMenuItemPosSize(nPos, aPos, aSize);
- Region aRegion(Rectangle(aPos,aSize));
+ Rectangle aRegion(aPos,aSize);
if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL))
{
@@ -763,7 +763,7 @@ void ScMenuFloatingWindow::highlightMenuItem(size_t nPos, bool bSelected)
IntersectClipRegion(Rectangle(aPos, aSize));
Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel());
DrawNativeControl(
- CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Region(aCtrlRect), CTRL_STATE_ENABLED,
+ CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED,
ImplControlValue(), OUString());
Pop();
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index 67a91baa38ee..b4ea7f35448c 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -37,6 +37,7 @@
#include "undostyl.hxx"
#include "docsh.hxx"
+#include "docpool.hxx"
#include "stlpool.hxx"
#include "printfun.hxx"
#include "scmod.hxx"
@@ -166,6 +167,9 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const String& rName,
{
// create style (with new name)
pStyle = &pStlPool->Make( aNewName, eStyleFamily, SFXSTYLEBIT_USERDEF );
+
+ if ( eStyleFamily == SFX_STYLE_FAMILY_PARA )
+ pDoc->GetPool()->CellStyleCreated( aNewName );
}
if ( pStyle )
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 1ceaa424ecd6..50aecbe7f2e3 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -68,6 +68,7 @@
#include "docsh.hxx"
#include "attrib.hxx"
#include "stlpool.hxx"
+#include "docpool.hxx"
#include "unoguard.hxx"
#include "miscuno.hxx"
#include "convuno.hxx"
@@ -830,6 +831,9 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const rtl::OUString& aName, const
{
(void)pStylePool->Make( aNameStr, eFamily, SFXSTYLEBIT_USERDEF );
+ if ( eFamily == SFX_STYLE_FAMILY_PARA && !pDoc->IsImportingXML() )
+ pDoc->GetPool()->CellStyleCreated( aNameStr );
+
pStyleObj->InitDoc( pDocShell, aNameStr ); // Objekt kann benutzt werden
pDocShell->SetDocumentModified(); // verwendet wird der neue Style noch nicht
@@ -1287,6 +1291,10 @@ void SAL_CALL ScStyleObj::setName( const rtl::OUString& aNewName )
{
aStyleName = aString; //! notify other objects for this style?
+ ScDocument* pDoc = pDocShell->GetDocument();
+ if ( eFamily == SFX_STYLE_FAMILY_PARA && !pDoc->IsImportingXML() )
+ pDoc->GetPool()->CellStyleCreated( aString );
+
// Zellvorlagen = 2, Seitenvorlagen = 4
UINT16 nId = ( eFamily == SFX_STYLE_FAMILY_PARA ) ?
SID_STYLE_FAMILY2 : SID_STYLE_FAMILY4;
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index e364705f90b6..12a1bb87211b 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -551,6 +551,8 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( bConvertBack )
// Namen zu Style-Pointer
pDoc->UpdStlShtPtrsFrmNms();
+ else
+ pDoc->GetPool()->CellStyleCreated( aStyleName );
// Attribute uebernehmen und Style anwenden
pStyleSheet->GetItemSet().Put( aAttrSet );
@@ -839,6 +841,8 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
rNewSet.Put( SvxLanguageItem(
pNew->GetLanguage(), ATTR_LANGUAGE_FORMAT ) );
}
+
+ pDoc->GetPool()->CellStyleCreated( pStyleSheet->GetName() );
}
else
{
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index f16c2fe1ada7..f16c2fe1ada7 100755..100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 378ea1233cf9..378ea1233cf9 100755..100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx