LibreOffice Module sd (master) 1
fuchar.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 <fuchar.hxx>
21#include <sfx2/viewfrm.hxx>
22#include <sfx2/sfxdlg.hxx>
23
24#include <svx/svxids.hrc>
25#include <editeng/eeitem.hxx>
26#include <editeng/colritem.hxx>
27#include <editeng/brushitem.hxx>
28#include <sfx2/bindings.hxx>
29#include <sfx2/request.hxx>
30#include <View.hxx>
31#include <drawdoc.hxx>
32#include <ViewShell.hxx>
33#include <DrawDocShell.hxx>
34#include <sdabstdlg.hxx>
35
36namespace sd {
37
38
40 ViewShell* pViewSh,
41 ::sd::Window* pWin,
42 ::sd::View* pView,
43 SdDrawDocument* pDoc,
44 SfxRequest& rReq)
45 : FuPoor(pViewSh, pWin, pView, pDoc, rReq)
46{
47}
48
50{
51 rtl::Reference<FuPoor> xFunc( new FuChar( pViewSh, pWin, pView, pDoc, rReq ) );
52 xFunc->DoExecute(rReq);
53 return xFunc;
54}
55
57{
58 const SfxItemSet* pArgs = rReq.GetArgs();
59
60 if( !pArgs )
61 {
62 SfxItemSet aEditAttr( mpDoc->GetPool() );
63 mpView->GetAttributes( aEditAttr );
64
66 aNewAttr.Put( aEditAttr, false );
67
70 if (rReq.GetSlot() == SID_CHAR_DLG_EFFECT)
71 {
72 pDlg->SetCurPageId("RID_SVXPAGE_CHAR_EFFECTS");
73 }
74
75 sal_uInt16 nResult = pDlg->Execute();
76
77 if( nResult != RET_OK )
78 return;
79
80 const SfxItemSet* pOutputSet = pDlg->GetOutputItemSet();
81 SfxItemSet aOtherSet( *pOutputSet );
82
83 // and now the reverse process
84 const SvxBrushItem* pBrushItem = aOtherSet.GetItem<SvxBrushItem>( SID_ATTR_BRUSH_CHAR );
85
86 if ( pBrushItem )
87 {
88 SvxColorItem aBackColorItem( pBrushItem->GetColor(), EE_CHAR_BKGCOLOR );
89 aOtherSet.ClearItem( SID_ATTR_BRUSH_CHAR );
90 aOtherSet.Put( aBackColorItem );
91 }
92
93 rReq.Done( aOtherSet );
94 pArgs = rReq.GetArgs();
95 }
96 mpView->SetAttributes(*pArgs);
97
98 // invalidate the Slots which are in DrTxtObjBar
99 static const sal_uInt16 SidArray[] = {
100 SID_ATTR_CHAR_FONT,
101 SID_ATTR_CHAR_POSTURE,
102 SID_ATTR_CHAR_WEIGHT,
103 SID_ATTR_CHAR_SHADOWED,
104 SID_ATTR_CHAR_STRIKEOUT,
105 SID_ATTR_CHAR_UNDERLINE,
106 SID_ATTR_CHAR_FONTHEIGHT,
107 SID_ATTR_CHAR_COLOR,
108 SID_ATTR_CHAR_KERNING,
109 SID_ATTR_CHAR_CASEMAP,
110 SID_SET_SUPER_SCRIPT,
111 SID_SET_SUB_SCRIPT,
112 SID_ATTR_CHAR_BACK_COLOR,
113 0 };
114
116
117 if( mpDoc->GetOnlineSpell() )
118 {
119 if( SfxItemState::SET == pArgs->GetItemState(EE_CHAR_LANGUAGE, false ) ||
120 SfxItemState::SET == pArgs->GetItemState(EE_CHAR_LANGUAGE_CJK, false ) ||
121 SfxItemState::SET == pArgs->GetItemState(EE_CHAR_LANGUAGE_CTL, false ) )
122 {
125 }
126 }
127}
128
130{
131}
132
134{
135}
136
137} // end of namespace sd
138
139/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual VclPtr< SfxAbstractTabDialog > CreateSdTabCharDialog(weld::Window *pWindow, const SfxItemSet *pAttr, SfxObjectShell *pDocShell)=0
static SD_DLLPUBLIC SdAbstractDialogFactory * Create()
Definition: sdabstdlg.cxx:38
SAL_DLLPRIVATE void StopOnlineSpelling()
Definition: drawdoc4.cxx:717
SAL_DLLPRIVATE SfxItemPool & GetPool()
Definition: drawdoc.hxx:237
SAL_DLLPRIVATE bool GetOnlineSpell() const
Definition: drawdoc.hxx:431
SAL_DLLPRIVATE void StartOnlineSpelling(bool bForceSpelling=true)
Definition: drawdoc4.cxx:729
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
Definition: drawdoc.hxx:242
void Invalidate(sal_uInt16 nId)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
SfxBindings & GetBindings()
const Color & GetColor() const
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuchar.cxx:49
virtual void DoExecute(SfxRequest &rReq) override
Definition: fuchar.cxx:56
virtual void Activate() override
activates the function
Definition: fuchar.cxx:129
FuChar(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuchar.cxx:39
virtual void Deactivate() override
deactivates the function
Definition: fuchar.cxx:133
Base class for all functions.
Definition: fupoor.hxx:48
SdDrawDocument * mpDoc
Definition: fupoor.hxx:148
ViewShell * mpViewShell
Definition: fupoor.hxx:145
::sd::View * mpView
Definition: fupoor.hxx:144
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
Definition: viewshel.cxx:1582
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
virtual bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false, bool bSlide=false, bool bMaster=false)
Definition: sdview.cxx:509
virtual void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
Definition: sdview.cxx:515
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_BKGCOLOR(EE_CHAR_START+32)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
const sal_uInt16 SidArray[]
Definition: fuoltext.cxx:43
RET_OK