LibreOffice Module sc (master) 1
drtxtob1.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <editeng/eeitem.hxx>
21
22#include <svx/svxdlg.hxx>
25#include <editeng/orphitem.hxx>
26#include <editeng/outliner.hxx>
27#include <editeng/spltitem.hxx>
28#include <editeng/widwitem.hxx>
29#include <editeng/editids.hrc>
30#include <svx/svxids.hrc>
31#include <vcl/transfer.hxx>
32
33#include <drtxtob.hxx>
34#include <drawview.hxx>
35#include <viewdata.hxx>
36#include <gridwin.hxx>
37
38#include <scabstdlg.hxx>
39
41 SfxItemSet& rOutSet , sal_uInt16 nSlot)
42{
46 mrViewData.GetSfxDocShell(), true));
47 if (nSlot == SID_CHAR_DLG_EFFECT)
48 {
49 pDlg->SetCurPageId("fonteffects");
50 }
51 bool bRet = ( pDlg->Execute() == RET_OK );
52
53 if ( bRet )
54 {
55 const SfxItemSet* pNewAttrs = pDlg->GetOutputItemSet();
56 if ( pNewAttrs )
57 rOutSet.Put( *pNewAttrs );
58 }
59
60 return bRet;
61}
62
64 SfxItemSet& rOutSet )
65{
66 SfxItemPool* pArgPool = rArgs.GetPool();
69 SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_WIDOWS> aNewAttr(*pArgPool);
70 aNewAttr.Put( rArgs );
71
72 // Values have been taken over once to show the dialog.
73 // Has to be changed
74 // aNewAttr.Put( SvxParaDlgLimitsItem( 567 * 50, 5670) );
75
76 aNewAttr.Put( SvxHyphenZoneItem( false, SID_ATTR_PARA_HYPHENZONE ) );
77 aNewAttr.Put( SvxFormatBreakItem( SvxBreak::NONE, SID_ATTR_PARA_PAGEBREAK ) );
78 aNewAttr.Put( SvxFormatSplitItem( true, SID_ATTR_PARA_SPLIT) );
79 aNewAttr.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS) );
80 aNewAttr.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS) );
81
83
85 mrViewData.GetDialogParent(), &aNewAttr));
86 bool bRet = ( pDlg->Execute() == RET_OK );
87
88 if ( bRet )
89 {
90 const SfxItemSet* pNewAttrs = pDlg->GetOutputItemSet();
91 if ( pNewAttrs )
92 rOutSet.Put( *pNewAttrs );
93 }
94
95 return bRet;
96}
97
99{
101 OutlinerView* pOutView = pView->GetTextEditOutlinerView();
103 ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(mrViewData.GetDialogParent()));
104
105 pDlg->Insert( SotClipboardFormatId::STRING, OUString() );
106 pDlg->Insert( SotClipboardFormatId::RTF, OUString() );
107 pDlg->Insert( SotClipboardFormatId::RICHTEXT, OUString() );
108
110
111 SotClipboardFormatId nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() );
112
114
115 if (nFormat != SotClipboardFormatId::NONE)
116 {
117 if (nFormat == SotClipboardFormatId::STRING)
118 pOutView->Paste();
119 else
120 pOutView->PasteSpecial();
121 }
122}
123
124/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void PasteSpecial()
void Paste(bool bUseSpecial=false)
virtual VclPtr< SfxAbstractTabDialog > CreateScParagraphDlg(weld::Window *pParent, const SfxItemSet *pAttr)=0
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
Definition: scabstdlg.cxx:37
virtual VclPtr< SfxAbstractTabDialog > CreateScCharDlg(weld::Window *pParent, const SfxItemSet *pAttr, const SfxObjectShell *pDocShell, bool bDrawText)=0
void ExecutePasteContents(SfxRequest &rReq)
Definition: drtxtob1.cxx:98
ScViewData & mrViewData
Definition: drtxtob.hxx:37
bool ExecuteCharDlg(const SfxItemSet &rArgs, SfxItemSet &rOutSet, sal_uInt16 nSlot)
Definition: drtxtob1.cxx:40
bool ExecuteParaDlg(const SfxItemSet &rArgs, SfxItemSet &rOutSet)
Definition: drtxtob1.cxx:63
ScGridWindow * GetActiveWin()
Definition: viewdata.cxx:3162
weld::Window * GetDialogParent()
Definition: viewdata.cxx:3156
SfxObjectShell * GetSfxDocShell() const
Definition: viewdata.hxx:358
ScDrawView * GetScDrawView()
Definition: viewdata.cxx:3174
const OutlinerView * GetTextEditOutlinerView() const
SfxItemPool * GetPool() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static SvxAbstractDialogFactory * Create()
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
const css::uno::Reference< css::datatransfer::XTransferable > & GetTransferable() const
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
constexpr sal_uInt16 EE_ITEMS_START(OWN_ATTR_VALUE_END+1)
SotClipboardFormatId
RET_OK