summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRelease Engineers <releng@openoffice.org>2009-05-06 10:59:57 +0000
committerRelease Engineers <releng@openoffice.org>2009-05-06 10:59:57 +0000
commit5b43eb8f020c12b36a73aaf8326a681136d7b5b8 (patch)
treea3eac2adc35b37410c6caa9842210cc63eb84140
parent85b71054e7decb3a9aec0e86fa37b19fba5c10e0 (diff)
CWS-TOOLING: integrate CWS mba32issues01
2009-05-05 18:23:27 +0200 mba r271547 : apply diffs from m45->m47 for all files moved from dialog to cui 2009-05-05 18:22:02 +0200 mba r271545 : apply diffs from m45->m47 for all files moved from dialog to cui 2009-05-05 18:16:42 +0200 mba r271544 : apply diffs from m45->m47 for all files moved from dialog to cui 2009-04-29 19:35:58 +0200 mba r271392 : #i73672#: unify commands for inserting special characters 2009-04-29 18:01:27 +0200 mba r271391 : #i101337#: missing string resources 2009-04-29 18:01:10 +0200 mba r271390 : #i101337#: missing string resources 2009-04-29 15:42:47 +0200 mba r271380 : concurrency problem in multithreaded dmake due to missing dependency 2009-04-28 17:36:03 +0200 tbo r271336 : #i99432# 2009-04-28 13:57:52 +0200 mba r271322 : #i101302#: ctor might be called with pSet=0 2009-04-22 19:32:39 +0200 tbo r271138 : #i99432# 2009-04-09 14:46:03 +0200 mba r270709 : make sendreportw32.cxx compile with pch 2009-04-06 16:05:07 +0200 mba r270568 : #i99432#: some tweaks for build order 2009-04-06 15:38:52 +0200 mba r270558 : typo 2009-04-06 13:36:19 +0200 mba r270542 : #i99432#: split of localization also 2009-04-06 13:19:06 +0200 mba r270539 : #i99432#: split up srs files also 2009-04-03 17:57:59 +0200 mba r270513 : #i99432#: split dialog folder into two 2009-04-03 17:56:46 +0200 mba r270512 : #i99432#: split dialog folder into two 2009-04-01 22:15:00 +0200 mba r270364 : warnings on Linux 2009-04-01 22:10:44 +0200 mba r270363 : warnings on Linux 2009-04-01 21:43:54 +0200 mba r270362 : warning fixed 2009-04-01 21:41:27 +0200 mba r270361 : warning on Linux fixed 2009-04-01 21:35:44 +0200 mba r270360 : warning fixed 2009-04-01 20:19:59 +0200 mba r270358 : warning found on Linux fixed 2009-04-01 19:23:38 +0200 mba r270354 : warning due to missing eof 2009-04-01 18:56:25 +0200 mba r270352 : linking problem fixed that appeared only on mac 2009-04-01 18:41:30 +0200 mba r270350 : warnings discovered on Linux fixed 2009-04-01 18:34:28 +0200 mba r270349 : some fixes for warnings and include problems discoverd after resync and build on mac 2009-04-01 14:08:22 +0200 mba r270328 : CWS-TOOLING: rebase CWS mba32issues01 to trunk@270033 (milestone: DEV300:m45) 2009-03-04 18:13:35 +0100 mba r268858 : #i99432#: more dialogs moved to cui 2009-03-04 17:47:41 +0100 mba r268854 : #i99432#: more dialogs moved to cui 2009-03-04 17:32:39 +0100 mba r268851 : warning fixed 2009-03-04 12:59:26 +0100 mba r268814 : #i99432#: more dialogs moved to cui 2009-03-04 11:49:03 +0100 mba r268802 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:46:00 +0100 mba r268795 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:43:50 +0100 mba r268794 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:00:29 +0100 mba r268792 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:00:03 +0100 mba r268791 : #i99432#: CharmapDialog moved to cui 2009-03-04 09:59:43 +0100 mba r268790 : #i99432#: CharmapDialog moved to cui 2009-03-04 09:58:51 +0100 mba r268789 : #i99432#: CharmapDialog moved to cui 2009-03-04 09:58:16 +0100 mba r268788 : #i99432#: CharmapDialog moved to cui 2009-03-03 16:33:14 +0100 mba r268763 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:32:28 +0100 mba r268762 : #i99432#: some tabpages moved to cui 2009-03-03 16:32:09 +0100 mba r268761 : #i99432#: some tabpages moved to cui 2009-03-03 16:29:40 +0100 mba r268760 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:29:08 +0100 mba r268759 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:28:41 +0100 mba r268758 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:28:18 +0100 mba r268757 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:27:36 +0100 mba r268756 : #i99465#: replace FN_SYMBOL by SID_CHARMAP 2009-03-03 16:27:02 +0100 mba r268755 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:26:23 +0100 mba r268754 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:25:30 +0100 mba r268753 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:24:49 +0100 mba r268752 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:24:35 +0100 mba r268751 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:23:20 +0100 mba r268750 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:23:04 +0100 mba r268749 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:21:56 +0100 mba r268748 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:18:39 +0100 mba r268747 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:13:14 +0100 mba r268745 : #i99465#: replace FN_SYMBOL by SID_CHARMAP 2009-03-03 16:02:54 +0100 mba r268738 : #i99432#: moved MacroAssignment TabPage from sfx2 2009-03-03 14:57:58 +0100 mba r268729 : #i99465#: transport return value via ItemSet 2009-03-03 00:08:10 +0100 mba r268701 : #i99432#: move acccfg to cuilib 2009-03-03 00:07:32 +0100 mba r268700 : #i99432#: move acccfg to cuilib 2009-03-03 00:02:01 +0100 mba r268699 : #i99432#: move acccfg to cuilib 2009-03-03 00:01:38 +0100 mba r268698 : #i99432#: move acccfg to cuilib 2009-03-03 00:01:11 +0100 mba r268697 : #i99432#: move acccfg to cuilib 2009-03-03 00:00:40 +0100 mba r268696 : #i99432#: move acccfg to cuilib 2009-03-03 00:00:06 +0100 mba r268695 : #i99432#: replace SfxAbstractSingleTabDialog by SfxAbstractDialog 2009-03-02 23:59:22 +0100 mba r268694 : #i99432#: move acccfg to cuilib 2009-03-02 23:57:19 +0100 mba r268693 : #i99432#: move acccfg to svx 2009-03-02 23:56:14 +0100 mba r268692 : #i99432#: replace SfxAbstractSingleTabDialog by SfxAbstractDialog 2009-03-02 23:49:37 +0100 mba r268691 : #i99785#: consolidate dialogs library 2009-03-02 17:26:40 +0100 mba r268683 : #i99785#: consolidate dialogs library 2009-03-02 17:24:28 +0100 mba r268682 : i99465#: consolidate slot for InsertSymbol command 2009-03-02 17:22:29 +0100 mba r268681 : #i99785#: consolidate dialogs library 2009-03-02 17:18:11 +0100 mba r268680 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 17:08:30 +0100 mba r268679 : #i99785#: consolidate dialogs library 2009-03-02 17:06:57 +0100 mba r268678 : #i99785#: consolidate dialogs library 2009-03-02 17:06:30 +0100 mba r268677 : #i99785#: consolidate dialogs library 2009-03-02 17:05:02 +0100 mba r268676 : #i99785#: consolidate dialogs library 2009-03-02 17:04:35 +0100 mba r268675 : #i99785#: consolidate dialogs library 2009-03-02 16:47:53 +0100 mba r268673 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:45:17 +0100 mba r268671 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:39:59 +0100 mba r268670 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:38:59 +0100 mba r268668 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:38:28 +0100 mba r268667 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:36:06 +0100 mba r268666 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:29:50 +0100 mba r268663 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:24:00 +0100 mba r268659 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:23:31 +0100 mba r268658 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:22:41 +0100 mba r268657 : i99432#: move accelconfig and macroassignment to cui 2009-02-25 16:57:26 +0100 mba r268453 : obsolete 2009-02-17 10:50:51 +0100 mba r267846 : obsolete 2009-02-12 16:33:54 +0100 mba r267676 : #i96834#: warning fixed 2009-02-11 19:28:47 +0100 mba r267626 : #i91978#: unused code 2009-02-11 18:37:47 +0100 mba r267625 : metafile output, fixes for 3 layer office 2009-02-11 12:56:28 +0100 mba r267593 : selective trees; incomplete build lists; metafile output
-rw-r--r--chart2/source/controller/main/ChartController_TextEdit.cxx25
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx27
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx27
-rw-r--r--sc/source/ui/inc/viewutil.hxx2
-rw-r--r--sc/source/ui/view/cellsh1.cxx80
-rw-r--r--sc/source/ui/view/editsh.cxx48
-rw-r--r--sc/source/ui/view/viewutil.cxx35
7 files changed, 167 insertions, 77 deletions
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index a0c1b5c41..16304d916 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -39,11 +39,10 @@
#include "macros.hxx"
#include "ControllerLockGuard.hxx"
#include "AccessibleTextHelper.hxx"
+#include "chartview/DrawModelWrapper.hxx"
#include <svx/svdotext.hxx>
-// header for class SvxCharacterMap
-#include <svx/charmap.hxx>
// header for define RET_OK
#include <vcl/msgbox.hxx>
// header for class SdrOutliner
@@ -55,6 +54,8 @@
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <svtools/stritem.hxx>
+#include <svx/fontitem.hxx>
//.............................................................................
namespace chart
@@ -174,16 +175,26 @@ void SAL_CALL ChartController::executeDispatch_InsertSpecialCharacter()
SvxAbstractDialogFactory * pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT( pFact, "No dialog factory" );
- AbstractSvxCharacterMap * pDlg = pFact->CreateSvxCharacterMap( m_pChartWindow, RID_SVXDLG_CHARMAP, FALSE );
- DBG_ASSERT( pDlg, "Couldn't create SvxCharacterMap dialog" );
+
+ SfxAllItemSet aSet( m_pDrawModelWrapper->GetItemPool() );
+ aSet.Put( SfxBoolItem( FN_PARAM_1, FALSE ) );
//set fixed current font
- pDlg->SetFont( m_pDrawViewWrapper->getOutliner()->GetRefDevice()->GetFont() );
- pDlg->DisableFontSelection(); //maybe not necessary in future
+ aSet.Put( SfxBoolItem( FN_PARAM_2, TRUE ) ); //maybe not necessary in future
+
+ Font aCurFont = m_pDrawViewWrapper->getOutliner()->GetRefDevice()->GetFont();
+ aSet.Put( SvxFontItem( aCurFont.GetFamily(), aCurFont.GetName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), SID_ATTR_CHAR_FONT ) );
+ SfxAbstractDialog * pDlg = pFact->CreateSfxDialog( m_pChartWindow, aSet, getFrame(), RID_SVXDLG_CHARMAP );
+ DBG_ASSERT( pDlg, "Couldn't create SvxCharacterMap dialog" );
if( pDlg->Execute() == RET_OK )
{
- String aString( pDlg->GetCharacters() );
+ const SfxItemSet* pSet = pDlg->GetOutputItemSet();
+ const SfxPoolItem* pItem=0;
+ String aString;
+ if ( pSet && pSet->GetItemState( SID_CHARMAP, TRUE, &pItem) == SFX_ITEM_SET &&
+ pItem->ISA(SfxStringItem) )
+ aString = dynamic_cast<const SfxStringItem*>(pItem)->GetValue();
OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner();
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 344adbfe5..db2d72bb9 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -71,9 +71,11 @@
#include "userdat.hxx"
#include <sfx2/objsh.hxx>
-#include <sfx2/macropg.hxx>
#include <svtools/macitem.hxx>
+#include <sfx2/evntconf.hxx>
+#include <sfx2/viewsh.hxx>
#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
//------------------------------------------------------------------
@@ -325,25 +327,31 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, Window* pWin )
aTab.Insert( SFX_EVENT_MOUSECLICK_OBJECT, new SvxMacro( sMacro, String() ) );
aItem.SetMacroTable( aTab );
}
+
// create empty itemset for macro-dlg
- SfxItemSet* pItemSet = new SfxItemSet(SFX_APP()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM );
+ SfxItemSet* pItemSet = new SfxItemSet(SFX_APP()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 );
pItemSet->Put ( aItem, SID_ATTR_MACROITEM );
- SfxMacroAssignDlg aDlg( pWin, GetObjectShell(), *pItemSet );
- SfxMacroTabPage *pMacroPage = (SfxMacroTabPage*) aDlg.GetTabPage();
- pMacroPage->AddEvent( ScResId(RID_SCSTR_ONCLICK),
- SFX_EVENT_MOUSECLICK_OBJECT);
+ SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
+ aNamesItem.AddEvent( ScResId(RID_SCSTR_ONCLICK), String(), SFX_EVENT_MOUSECLICK_OBJECT );
+ pItemSet->Put( aNamesItem, SID_EVENTCONFIG );
+
+ com::sun::star::uno::Reference < com::sun::star::frame::XFrame > xFrame;
+ if (GetViewShell())
+ xFrame = GetViewShell()->GetViewFrame()->GetFrame()->GetFrameInterface();
- if ( RET_OK == aDlg.Execute() )
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ SfxAbstractDialog* pMacroDlg = pFact->CreateSfxDialog( pWin, *pItemSet, xFrame, SID_EVENTCONFIG );
+ if ( pMacroDlg && pMacroDlg->Execute() == RET_OK )
{
- const SfxItemSet* pOutSet = aDlg.GetOutputItemSet();
+ const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pOutSet->GetItemState( SID_ATTR_MACROITEM, FALSE, &pItem ))
{
rtl::OUString sMacro;
SvxMacro* pMacro = ((SvxMacroItem*)pItem)->GetMacroTable().Get( SFX_EVENT_MOUSECLICK_OBJECT );
if ( pMacro )
- sMacro = pMacro->GetMacName();
+ sMacro = pMacro->GetMacName();
if ( pObj->IsGroupObject() )
{
@@ -361,6 +369,7 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, Window* pWin )
}
}
+ delete pMacroDlg;
delete pItemSet;
}
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 9db0d5237..f6638d8c7 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -221,7 +221,32 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
String aString;
SvxFontItem aNewItem( EE_CHAR_FONTINFO );
- if (ScViewUtil::ExecuteCharMap( rItem, aNewItem, aString ))
+ const SfxItemSet *pArgs = rReq.GetArgs();
+ const SfxPoolItem* pItem = 0;
+ if( pArgs )
+ pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), FALSE, &pItem);
+
+ if ( pItem )
+ {
+ aString = ((const SfxStringItem*)pItem)->GetValue();
+ const SfxPoolItem* pFtItem = NULL;
+ pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), FALSE, &pFtItem);
+ const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ if ( pFontItem )
+ {
+ String aFontName(pFontItem->GetValue());
+ Font aFont(aFontName, Size(1,1)); // Size nur wg. CTOR
+ aNewItem = SvxFontItem( aFont.GetFamily(), aFont.GetName(),
+ aFont.GetStyleName(), aFont.GetPitch(),
+ aFont.GetCharSet(), ATTR_FONT );
+ }
+ else
+ aNewItem = rItem;
+ }
+ else
+ ScViewUtil::ExecuteCharMap( rItem, *pViewData->GetViewShell()->GetViewFrame(), aNewItem, aString );
+
+ if ( aString.Len() )
{
SfxItemSet aSet( pOutliner->GetEmptyItemSet() );
aSet.Put( aNewItem );
diff --git a/sc/source/ui/inc/viewutil.hxx b/sc/source/ui/inc/viewutil.hxx
index b581beb19..7130f4d6b 100644
--- a/sc/source/ui/inc/viewutil.hxx
+++ b/sc/source/ui/inc/viewutil.hxx
@@ -39,6 +39,7 @@ class SfxItemSet;
class SfxBindings;
class SvxFontItem;
class SfxViewShell;
+class SfxViewFrame;
class ScChangeAction;
class ScChangeViewSettings;
@@ -55,6 +56,7 @@ class ScViewUtil // static Methoden
{
public:
static BOOL ExecuteCharMap( const SvxFontItem& rOldFont,
+ SfxViewFrame& rFrame,
SvxFontItem& rNewFont,
String& rString );
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index fd1ea0140..8785b84e4 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -66,7 +66,6 @@
#include <sot/formats.hxx>
#include <svx/postattr.hxx>
#include <svx/fontitem.hxx>
-#include <svx/charmap.hxx>
#include <svx/clipfmtitem.hxx>
#include <sfx2/passwd.hxx>
#include <svx/hlnkitem.hxx>
@@ -1996,52 +1995,67 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case SID_CHARMAP:
if( pReqArgs != NULL )
{
- const SvxFontItem& rFontItem = (const SvxFontItem&) rReq.GetArgs()->Get(SID_CHARMAP);
- const SfxStringItem& rStringItem = (const SfxStringItem&) rReq.GetArgs()->Get(SID_ATTR_SECIALCHAR);
- Font aFont;
-
- aFont.SetName( rFontItem.GetFamilyName() );
- aFont.SetStyleName( rFontItem.GetStyleName() );
- aFont.SetFamily( rFontItem.GetFamily() );
- aFont.SetPitch( rFontItem.GetPitch() );
- aFont.SetCharSet( rFontItem.GetCharSet() );
+ String aChars, aFontName;
+ const SfxItemSet *pArgs = rReq.GetArgs();
+ const SfxPoolItem* pItem = 0;
+ if ( pArgs )
+ pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), FALSE, &pItem);
+ if ( pItem )
+ {
+ const SfxStringItem* pStringItem = PTR_CAST( SfxStringItem, pItem );
+ if ( pStringItem )
+ aChars = pStringItem->GetValue();
+ const SfxPoolItem* pFtItem = NULL;
+ pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), FALSE, &pFtItem);
+ const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ if ( pFontItem )
+ aFontName = pFontItem->GetValue();
+ }
- pTabViewShell->InsertSpecialChar( rStringItem.GetValue(), aFont );
- if( ! rReq.IsAPI() )
- rReq.Done();
+ if ( aChars.Len() )
+ {
+ Font aFont;
+ pTabViewShell->GetSelectionPattern()->GetFont( aFont, SC_AUTOCOL_BLACK, NULL, NULL, NULL,
+ pTabViewShell->GetSelectionScriptType() );
+ if ( aFontName.Len() )
+ aFont = Font( aFontName, Size(1,1) );
+ pTabViewShell->InsertSpecialChar( aChars, aFont );
+ if( ! rReq.IsAPI() )
+ rReq.Done();
+ }
}
else
{
//CHINA001 SvxCharacterMap* pDlg = new SvxCharacterMap( pTabViewShell->GetDialogParent(), FALSE );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
- AbstractSvxCharacterMap* pDlg = pFact->CreateSvxCharacterMap( pTabViewShell->GetDialogParent(), RID_SVXDLG_CHARMAP, FALSE);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
- Font aCurFont;
// font color doesn't matter here
+ Font aCurFont;
pTabViewShell->GetSelectionPattern()->GetFont( aCurFont, SC_AUTOCOL_BLACK, NULL, NULL, NULL,
pTabViewShell->GetSelectionScriptType() );
- pDlg->SetCharFont( aCurFont );
- if ( pDlg->Execute() == RET_OK )
- {
- Font aNewFont( pDlg->GetCharFont() );
+ SfxAllItemSet aSet( GetPool() );
+ aSet.Put( SfxBoolItem( FN_PARAM_1, FALSE ) );
+ aSet.Put( SvxFontItem( aCurFont.GetFamily(), aCurFont.GetName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), GetPool().GetWhich(SID_ATTR_CHAR_FONT) ) );
- pTabViewShell->InsertSpecialChar( pDlg->GetCharacters(), aNewFont );
+ SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( pTabViewShell->GetDialogParent(), aSet,
+ pTabViewShell->GetViewFrame()->GetFrame()->GetFrameInterface(), RID_SVXDLG_CHARMAP );
- SfxStringItem aStringItem( SID_ATTR_SECIALCHAR,
- pDlg->GetCharacters() );
- SvxFontItem aFontItem( aNewFont.GetFamily(),
- aNewFont.GetName(),
- aNewFont.GetStyleName(),
- aNewFont.GetPitch(),
- aNewFont.GetCharSet(),
- SID_CHARMAP );
+ if ( pDlg->Execute() == RET_OK )
+ {
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP, FALSE );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, FALSE );
- rReq.AppendItem( aFontItem );
- rReq.AppendItem( aStringItem );
- rReq.Done();
+ if ( pItem && pFontItem )
+ {
+ Font aNewFont( pFontItem->GetFamilyName(), pFontItem->GetStyleName(), Size(1,1) );
+ aNewFont.SetCharSet( pFontItem->GetCharSet() );
+ aNewFont.SetPitch( pFontItem->GetPitch() );
+ pTabViewShell->InsertSpecialChar( pItem->GetValue(), aNewFont );
+ rReq.AppendItem( *pFontItem );
+ rReq.AppendItem( *pItem );
+ rReq.Done();
+ }
}
delete pDlg;
}
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 2441e2008..60fe6e00e 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -69,6 +69,7 @@
#include <vcl/sound.hxx>
#include <sot/formats.hxx>
#include <svtools/transfer.hxx>
+#include <svtools/stritem.hxx>
#define _EDITSH_CXX
#include "editsh.hxx"
@@ -332,16 +333,41 @@ void ScEditShell::Execute( SfxRequest& rReq )
String aString;
SvxFontItem aNewItem( EE_CHAR_FONTINFO );
- BOOL bOk = ScViewUtil::ExecuteCharMap( rItem, aNewItem, aString );
+ const SfxItemSet *pArgs = rReq.GetArgs();
+ const SfxPoolItem* pItem = 0;
+ if( pArgs )
+ pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), FALSE, &pItem);
- // while the dialog was open, edit mode may have been stopped
- if (!SC_MOD()->IsInputMode())
+ if ( pItem )
{
- Sound::Beep();
- return;
+ aString = ((const SfxStringItem*)pItem)->GetValue();
+ const SfxPoolItem* pFtItem = NULL;
+ pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), FALSE, &pFtItem);
+ const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
+ if ( pFontItem )
+ {
+ String aFontName(pFontItem->GetValue());
+ Font aFont(aFontName, Size(1,1)); // Size nur wg. CTOR
+ aNewItem = SvxFontItem( aFont.GetFamily(), aFont.GetName(),
+ aFont.GetStyleName(), aFont.GetPitch(),
+ aFont.GetCharSet(), ATTR_FONT );
+ }
+ else
+ aNewItem = rItem;
+ }
+ else
+ {
+ ScViewUtil::ExecuteCharMap( rItem, *pViewData->GetViewShell()->GetViewFrame(), aNewItem, aString );
+
+ // while the dialog was open, edit mode may have been stopped
+ if (!SC_MOD()->IsInputMode())
+ {
+ Sound::Beep();
+ return;
+ }
}
- if (bOk)
+ if ( aString.Len() )
{
// if string contains WEAK characters, set all fonts
BYTE nSetScript;
@@ -361,6 +387,14 @@ void ScEditShell::Execute( SfxRequest& rReq )
pTableView->InsertText(aString);
if (pTopView)
pTopView->InsertText(aString);
+
+ SfxStringItem aStringItem( SID_CHARMAP, aString );
+ SfxStringItem aFontItem( SID_ATTR_SPECIALCHAR, aNewItem.GetFamilyName() );
+ rReq.AppendItem( aFontItem );
+ rReq.AppendItem( aStringItem );
+ rReq.Done();
+
+
}
if (pTopView)
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index 677d6cb47..91a3d4855 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -50,6 +50,10 @@
#include <vcl/svapp.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/wrkwin.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/objsh.hxx>
+#include <svtools/stritem.hxx>
+#include <svtools/eitem.hxx>
#include <com/sun/star/i18n/TransliterationModules.hpp>
@@ -359,35 +363,26 @@ void ScViewUtil::HideDisabledSlot( SfxItemSet& rSet, SfxBindings& rBindings, USH
//==================================================================
BOOL ScViewUtil::ExecuteCharMap( const SvxFontItem& rOldFont,
+ SfxViewFrame& rFrame,
SvxFontItem& rNewFont,
String& rString )
{
BOOL bRet = FALSE;
-
- Font aFont;
- aFont.SetName ( rOldFont.GetFamilyName() );
- aFont.SetStyleName( rOldFont.GetStyleName() );
- aFont.SetFamily ( rOldFont.GetFamily() );
- aFont.SetCharSet ( rOldFont.GetCharSet() );
- aFont.SetPitch ( rOldFont.GetPitch() );
-
- //CHINA001 SvxCharacterMap* pDlg = new SvxCharacterMap( NULL, FALSE );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- AbstractSvxCharacterMap* pDlg = pFact->CreateSvxCharacterMap( NULL, RID_SVXDLG_CHARMAP, FALSE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
-
- pDlg->SetCharFont( aFont );
-
+ SfxAllItemSet aSet( rFrame.GetObjectShell()->GetPool() );
+ aSet.Put( SfxBoolItem( FN_PARAM_1, FALSE ) );
+ aSet.Put( SvxFontItem( rOldFont.GetFamily(), rOldFont.GetFamilyName(), rOldFont.GetStyleName(), rOldFont.GetPitch(), rOldFont.GetCharSet(), aSet.GetPool()->GetWhich( SID_ATTR_CHAR_FONT ) ) );
+ SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( &rFrame.GetWindow(), aSet, rFrame.GetFrame()->GetFrameInterface(), RID_SVXDLG_CHARMAP );
if ( pDlg->Execute() == RET_OK )
{
- rString = pDlg->GetCharacters();
- aFont = pDlg->GetCharFont();
- rNewFont = SvxFontItem( aFont.GetFamily(), aFont.GetName(),
- aFont.GetStyleName(), aFont.GetPitch(),
- aFont.GetCharSet(), ATTR_FONT );
-
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pItem, SfxStringItem, SID_CHARMAP, FALSE );
+ SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, FALSE );
+ if ( pItem )
+ rString = pItem->GetValue();
+ if ( pFontItem )
+ rNewFont = SvxFontItem( pFontItem->GetFamily(), pFontItem->GetFamilyName(), pFontItem->GetStyleName(), pFontItem->GetPitch(), pFontItem->GetCharSet(), rNewFont.Which() );
bRet = TRUE;
}
delete pDlg;