1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: drtxtob1.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
36 //------------------------------------------------------------------------
38 #include "scitems.hxx"
39 #include <svx/eeitem.hxx>
41 #include <svx/svxdlg.hxx>
42 #include <svx/brkitem.hxx>
43 #include <svx/hyznitem.hxx>
44 #include <svx/orphitem.hxx>
45 #include <svx/outliner.hxx>
46 #include <svx/spltitem.hxx>
47 #include <svx/widwitem.hxx>
48 #include <sot/exchange.hxx>
49 #include <vcl/msgbox.hxx>
50 #include <svtools/transfer.hxx>
53 #include "drtxtob.hxx"
54 #include "drawview.hxx"
55 #include "viewdata.hxx"
56 //CHINA001 #include "textdlgs.hxx"
57 #include "scresid.hxx"
59 #include "scabstdlg.hxx" //CHINA00
60 //------------------------------------------------------------------------
62 BOOL
ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet
& rArgs
,
65 //CHINA001 ScCharDlg* pDlg = new ScCharDlg( pViewData->GetDialogParent(),
67 //CHINA001 pViewData->GetSfxDocShell() );
69 ScAbstractDialogFactory
* pFact
= ScAbstractDialogFactory::Create();
70 DBG_ASSERT(pFact
, "ScAbstractFactory create fail!");//CHINA001
72 SfxAbstractTabDialog
* pDlg
= pFact
->CreateScCharDlg( pViewData
->GetDialogParent(), &rArgs
,
73 pViewData
->GetSfxDocShell(),RID_SCDLG_CHAR
);
74 DBG_ASSERT(pDlg
, "Dialog create fail!");//CHINA001
75 BOOL bRet
= ( pDlg
->Execute() == RET_OK
);
79 const SfxItemSet
* pNewAttrs
= pDlg
->GetOutputItemSet();
81 rOutSet
.Put( *pNewAttrs
);
88 BOOL
ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet
& rArgs
,
91 SfxItemPool
* pArgPool
= rArgs
.GetPool();
92 SfxItemSet
aNewAttr( *pArgPool
,
93 EE_ITEMS_START
, EE_ITEMS_END
,
94 SID_ATTR_PARA_HYPHENZONE
, SID_ATTR_PARA_HYPHENZONE
,
95 SID_ATTR_PARA_PAGEBREAK
, SID_ATTR_PARA_PAGEBREAK
,
96 SID_ATTR_PARA_SPLIT
, SID_ATTR_PARA_SPLIT
,
97 SID_ATTR_PARA_WIDOWS
, SID_ATTR_PARA_WIDOWS
,
98 SID_ATTR_PARA_ORPHANS
, SID_ATTR_PARA_ORPHANS
,
100 aNewAttr
.Put( rArgs
);
102 // Die Werte sind erst einmal uebernommen worden, um den Dialog anzuzeigen.
103 // Muss natuerlich noch geaendert werden
104 // aNewAttr.Put( SvxParaDlgLimitsItem( 567 * 50, 5670) );
106 aNewAttr
.Put( SvxHyphenZoneItem( sal_False
, SID_ATTR_PARA_HYPHENZONE
) );
107 aNewAttr
.Put( SvxFmtBreakItem( SVX_BREAK_NONE
, SID_ATTR_PARA_PAGEBREAK
) );
108 aNewAttr
.Put( SvxFmtSplitItem( sal_True
, SID_ATTR_PARA_SPLIT
) );
109 aNewAttr
.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS
) );
110 aNewAttr
.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS
) );
112 //CHINA001 ScParagraphDlg* pDlg = new ScParagraphDlg( pViewData->GetDialogParent(),
113 //CHINA001 &aNewAttr );
115 ScAbstractDialogFactory
* pFact
= ScAbstractDialogFactory::Create();
116 DBG_ASSERT(pFact
, "ScAbstractFactory create fail!");//CHINA001
118 SfxAbstractTabDialog
* pDlg
= pFact
->CreateScParagraphDlg( pViewData
->GetDialogParent(), &aNewAttr
, RID_SCDLG_PARAGRAPH
);
119 DBG_ASSERT(pDlg
, "Dialog create fail!");//CHINA001
120 BOOL bRet
= ( pDlg
->Execute() == RET_OK
);
124 const SfxItemSet
* pNewAttrs
= pDlg
->GetOutputItemSet();
126 rOutSet
.Put( *pNewAttrs
);
133 void ScDrawTextObjectBar::ExecutePasteContents( SfxRequest
& /* rReq */ )
135 SdrView
* pView
= pViewData
->GetScDrawView();
136 OutlinerView
* pOutView
= pView
->GetTextEditOutlinerView();
137 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
138 SfxAbstractPasteDialog
* pDlg
= pFact
->CreatePasteDialog( pViewData
->GetDialogParent() );
140 pDlg
->Insert( SOT_FORMAT_STRING
, EMPTY_STRING
);
141 pDlg
->Insert( SOT_FORMAT_RTF
, EMPTY_STRING
);
143 TransferableDataHelper
aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData
->GetActiveWin() ) );
145 ULONG nFormat
= pDlg
->GetFormat( aDataHelper
.GetTransferable() );
147 //! test if outliner view is still valid
151 if (nFormat
== SOT_FORMAT_STRING
)
154 pOutView
->PasteSpecial();