summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2000-11-24 19:07:16 +0000
committerNiklas Nebel <nn@openoffice.org>2000-11-24 19:07:16 +0000
commit56cb65e9e2458f65c49a22187f223cc438938032 (patch)
treea2d6ea6da8e98a7350eef4ce2973060d5655b032
parent56aecda329601d55df6248bcc727d01684c4fb88 (diff)
#80688# PutItemScript
-rw-r--r--sc/source/ui/inc/viewutil.hxx8
-rw-r--r--sc/source/ui/view/viewutil.cxx24
2 files changed, 28 insertions, 4 deletions
diff --git a/sc/source/ui/inc/viewutil.hxx b/sc/source/ui/inc/viewutil.hxx
index 9f5e90b73680..f35619ae0f5d 100644
--- a/sc/source/ui/inc/viewutil.hxx
+++ b/sc/source/ui/inc/viewutil.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewutil.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:45:02 $
+ * last change: $Author: nn $ $Date: 2000-11-24 20:06:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,6 +67,7 @@
#endif
class String;
+class SfxItemSet;
class SvxFontItem;
class ScChangeAction;
@@ -89,6 +90,9 @@ public:
static BOOL IsActionShown( const ScChangeAction& rAction,
const ScChangeViewSettings& rSettings,
ScDocument& rDocument );
+
+ static void PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSet,
+ USHORT nWhichId, USHORT nScript );
};
// ---------------------------------------------------------------------------
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index caede9a444b5..90696d5fe609 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewutil.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:45:10 $
+ * last change: $Author: nn $ $Date: 2000-11-24 20:07:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,6 +70,9 @@
#include "scitems.hxx"
#include <svx/charmap.hxx>
#include <svx/fontitem.hxx>
+#include <svx/scripttypeitem.hxx>
+#include <svtools/itempool.hxx>
+#include <svtools/itemset.hxx>
#include <vcl/svapp.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/wrkwin.hxx>
@@ -84,6 +87,23 @@
//==================================================================
// static
+void ScViewUtil::PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSet,
+ USHORT nWhichId, USHORT nScript )
+{
+ // take the effective item from rCoreSet according to nScript
+ // and put in rShellSet under the (base) nWhichId
+
+ SfxItemPool& rPool = *rShellSet.GetPool();
+ SvxScriptSetItem aSetItem( rPool.GetSlotId(nWhichId), rPool );
+ aSetItem.GetItemSet().Put( rCoreSet, FALSE );
+ const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
+ if (pI)
+ rShellSet.Put( *pI, nWhichId );
+ else
+ rShellSet.InvalidateItem( nWhichId );
+}
+
+// static
BOOL ScViewUtil::IsActionShown( const ScChangeAction& rAction,
const ScChangeViewSettings& rSettings,
ScDocument& rDocument )