27#include <com/sun/star/lang/XMultiServiceFactory.hpp>
28#include <com/sun/star/linguistic2/XThesaurus.hpp>
35#include <officecfg/Office/Impress.hxx>
36#include <svx/svxids.hrc>
78#include <drawview.hxx>
88#include <stlsheet.hxx>
102 ::std::unique_ptr<SvxClipboardFormatItem> pResult (
106 for (sal_uInt32
i=0;
i<nFormatCount;
i++)
112 bool bDuplicate (
false);
113 for (sal_uInt32 j=0; j<
i; j++)
115 if (nTestFormat == rDataHelper.
GetFormat(j))
128 case SotClipboardFormatId::EMBED_SOURCE:
134 SotClipboardFormatId::OBJECTDESCRIPTOR, aDescriptor))
138 if (!
sName.isEmpty())
139 pResult->AddClipbrdFormat(nTestFormat,
sName);
141 pResult->AddClipbrdFormat(nTestFormat);
147 case SotClipboardFormatId::LINK_SOURCE:
148 case SotClipboardFormatId::DRAWING:
149 case SotClipboardFormatId::SVXB:
150 case SotClipboardFormatId::GDIMETAFILE:
151 case SotClipboardFormatId::BITMAP:
152 case SotClipboardFormatId::NETSCAPE_BOOKMARK:
153 case SotClipboardFormatId::STRING:
154 case SotClipboardFormatId::HTML:
155 case SotClipboardFormatId::RTF:
156 case SotClipboardFormatId::RICHTEXT:
157 case SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT:
158 pResult->AddClipbrdFormat(nTestFormat);
167 bool bHasFormat (rDataHelper.
HasFormat(nFormat));
170 bHasFormat = rDataHelper.
HasFormat(nFormat);
177 pResult->AddClipbrdFormat (nFormat,
sName);
187 mbPastePossible = ( pDataHelper->GetFormatCount() != 0 );
198 if (mpDrawView ==
nullptr)
200 mpCurrentClipboardFormats = std::move(pFormats);
202 SfxBindings& rBindings = GetViewFrame()->GetBindings();
205 rBindings.
Invalidate( SID_PASTE_UNFORMATTED );
206 rBindings.
Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
255 case SID_ATTR_PAGE_LRSPACE:
261 SID_ATTR_PAGE_LRSPACE );
266 case SID_ATTR_PAGE_ULSPACE:
272 SID_ATTR_PAGE_ULSPACE );
290 if (
mpDrawView->GetMarkedObjectList().GetMarkCount() != 1)
293 bool bDisableEditHyperlink =
true;
297 bDisableEditHyperlink =
false;
303 if ( pUnoCtrl && SdrInventor::FmForm == pUnoCtrl->
GetObjInventor() )
305 const uno::Reference< awt::XControlModel >& xControlModel( pUnoCtrl->
GetUnoControlModel() );
306 if( xControlModel.is() )
308 uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
311 uno::Reference< beans::XPropertySetInfo > xPropInfo( xPropSet->getPropertySetInfo() );
312 if( xPropInfo.is() && xPropInfo->hasPropertyByName(
"TargetURL") )
314 bDisableEditHyperlink =
false;
320 return bDisableEditHyperlink;
335 if ( bDisableVerticalText )
343 bool bConvertToPathPossible =
mpDrawView->IsConvertToPathObjPossible();
348 if( nMarkCount == 1 )
350 bool bDisable =
true;
352 if(
auto pGrafObj =
dynamic_cast<const SdrGrafObj*
>( pObj) )
353 if( pGrafObj->getQrCode() )
379 bool bDisable =
true;
399 bool bDisable =
true;
438 bool bDisable =
true;
462 bool bDisable =
true;
484 bool bDisable =
true;
487 for( sal_uInt16
i = 0;
i <
nCount && bDisable;
i++ )
495 if( bDisable ||
GetDocSh()->IsPreview())
554 eState =
mpDrawView->IsMarkedGluePointsEscDir( SdrEscapeDirection::LEFT );
560 eState =
mpDrawView->IsMarkedGluePointsEscDir( SdrEscapeDirection::RIGHT );
566 eState =
mpDrawView->IsMarkedGluePointsEscDir( SdrEscapeDirection::TOP );
572 eState =
mpDrawView->IsMarkedGluePointsEscDir( SdrEscapeDirection::BOTTOM );
596 if( !
mpDrawView->IsMirrorAllowed(
true,
true ) )
632 if ( !bConvertToPathPossible &&
719 else if( SfxItemState::DEFAULT ==
rSet.
GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) )
726 if ( !bConvertToPathPossible )
748 if ( !
mpDrawView->IsConvertTo3DObjPossible() )
757 if (
GetDoc()->GetLinkCount() == 0 )
916 OSL_ENSURE(
false,
"No LayerTabBar (!)");
928 bool bHasOutliner =
false;
929 bool bHasOther =
false;
930 for(
size_t nNum = 0; nNum < nMarkCount; ++nNum)
950 if( bHasOther && bHasOutliner )
1008 bool bDisableSdremoteForGood =
false;
1009#ifndef ENABLE_SDREMOTE
1010 bDisableSdremoteForGood =
true;
1012 bDisableSdremoteForGood |= ! (
1013 officecfg::Office::Impress::Misc::Start::EnableSdremote::get() );
1017 if ( bDisableSdremoteForGood )
1026 sal_uInt16 nCurrentSId = SID_ATTR_CHAR;
1032 if( nCurrentSId != SID_TEXT_FITTOSIZE &&
1033 nCurrentSId != SID_TEXT_FITTOSIZE_VERTICAL &&
1034 nCurrentSId != SID_ATTR_CHAR_VERTICAL )
1035 nCurrentSId = SID_ATTR_CHAR;
1046 if (
GetDoc()->GetOnlineSpell())
1057 OUString aActiveLayer =
mpDrawView->GetActiveLayer();
1059 if ( ( !aActiveLayer.isEmpty() && pPV && ( pPV->
IsLayerLocked(aActiveLayer) ||
1061 SD_MOD()->GetWaterCan() )
1279 if ( !aActiveLayer.isEmpty() && pPV )
1322 if( xSlideshow.is() && xSlideshow->isRunning() )
1361 bool bSingleGraphicSelected =
false;
1373 bool bFoundBitmap =
false;
1374 bool bFoundMetafile =
false;
1375 bool bFoundObjNoArea =
false;
1376 bool bFoundNoGraphicObj =
false;
1377 bool bFoundAny =
false;
1378 bool bFoundTable =
false;
1381 for (
size_t i=0;
i < nMarkCount && !bFoundAny; ++
i)
1387 if(nInv == SdrInventor::Default)
1392 case SdrObjKind::PathLine :
1393 case SdrObjKind::PolyLine :
1394 case SdrObjKind::Line:
1395 case SdrObjKind::FreehandLine :
1396 case SdrObjKind::Edge:
1397 case SdrObjKind::CircleArc :
1398 bFoundObjNoArea =
true;
1399 bFoundNoGraphicObj =
true;
1401 case SdrObjKind::OLE2 :
1403 bSingleGraphicSelected = nMarkCount == 1;
1404 bFoundBitmap =
true;
1405 bFoundMetafile =
true;
1407 case SdrObjKind::Graphic :
1409 bSingleGraphicSelected = nMarkCount == 1;
1414 const Size aCurrentSizeofObj = aRect.GetSize();
1419 if(aCurrentSizeofObj == aOriginalSizeofObj )
1424 case GraphicType::Bitmap :
1425 bFoundBitmap =
true;
1428 bFoundMetafile =
true;
1431 case GraphicType::GdiMetafile :
1432 bFoundMetafile =
true;
1439 case SdrObjKind::Table:
1446 else if(nInv == SdrInventor::E3d)
1459 if( bFoundObjNoArea )
1462 if( bFoundBitmap && !bFoundMetafile && !bFoundNoGraphicObj )
1464 else if( !bFoundBitmap && bFoundMetafile && !bFoundNoGraphicObj )
1466 else if( !bFoundBitmap && !bFoundMetafile && !bFoundNoGraphicObj )
1474 if( !bSingleGraphicSelected )
1482 bool bDisableEditHyperlink;
1500 static const sal_uInt16 nCSTbArray[] = { SID_DRAWTBX_CS_BASIC, SID_DRAWTBX_CS_SYMBOL,
1501 SID_DRAWTBX_CS_ARROW, SID_DRAWTBX_CS_FLOWCHART,
1502 SID_DRAWTBX_CS_CALLOUT, SID_DRAWTBX_CS_STAR };
1505 for (sal_uInt16
i : nCSTbArray)
1517 if ( bDisableEditHyperlink )
1526 bool bDisableShowNextLevel =
true;
1527 bool bDisableHideLastLevel =
true;
1538 if (nDepth != sal_uInt16(-1))
1543 bDisableShowNextLevel =
false;
1546 bDisableHideLastLevel =
false;
1551 if (bDisableShowNextLevel)
1554 if (bDisableHideLastLevel)
1558#if defined(_WIN32) || defined UNX
1569 if (
rSet.
GetItemState(SID_DISPLAY_MASTER_BACKGROUND) == SfxItemState::DEFAULT
1573 if (pPage !=
nullptr &&
GetDoc() !=
nullptr)
1580 aVisibleLayers.
IsSet(aBackgroundId)));
1582 aVisibleLayers.
IsSet(aObjectId)));
1588 bool bDisableSaveBackground =
true;
1590 if (pPage !=
nullptr &&
GetDoc() !=
nullptr)
1597 bDisableSaveBackground =
false;
1600 if (bDisableSaveBackground)
1679 if (
GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)
1709 if (pPage ==
nullptr ||
GetDoc() ==
nullptr)
1723 drawing::FillStyle eXFS = pFillStyle->GetValue();
1725 aFillStyleItem.SetWhich( SID_ATTR_PAGE_FILLSTYLE );
1730 case drawing::FillStyle_SOLID:
1733 Color aColor = pColorItem->GetColorValue();
1735 aFillColorItem.SetWhich( SID_ATTR_PAGE_COLOR );
1740 case drawing::FillStyle_GRADIENT:
1744 rSet.
Put( aFillGradientItem );
1748 case drawing::FillStyle_HATCH:
1752 aFillHatchItem.SetWhich( SID_ATTR_PAGE_HATCH );
1757 case drawing::FillStyle_BITMAP:
1761 aFillBitmapItem.SetWhich( SID_ATTR_PAGE_BITMAP );
1776 sal_uInt16 nSlotId = rReq.
GetSlot();
1781 if ( ( nSlotId >= SID_ATTR_PAGE_COLOR ) && ( nSlotId <= SID_ATTR_PAGE_FILLSTYLE ) )
1795 case SID_ATTR_PAGE_FILLSTYLE:
1798 drawing::FillStyle eXFS = aFSItem.GetValue();
1800 if ( eXFS == drawing::FillStyle_NONE )
1805 case SID_ATTR_PAGE_COLOR:
1815 case SID_ATTR_PAGE_GRADIENT:
1817 if (SfxItemState::SET == pArgs->
GetItemState(SID_FILL_GRADIENT_JSON,
false, &pItem))
1824 aMigrateSet.
Put( aGradientItem );
1836 aMigrateSet.
Put( aGradientItem );
1845 case SID_ATTR_PAGE_HATCH:
1849 rPageProperties.
PutItem( aHatchItem );
1853 case SID_ATTR_PAGE_BITMAP:
1857 rPageProperties.
PutItem( aBitmapItem );
1872 sal_Int32 nLeft = -1, nRight = -1, nUpper = -1, nLower = -1;
1873 bool bScaleAll =
true;
1881 case SID_ATTR_PAGE_LRSPACE:
1883 true,&pPoolItem) == SfxItemState::SET )
1892 SetPageSizeAndBorder(ePageKind, aNewSize, nLeft, nRight, nUpper, nLower, bScaleAll, eOrientation, nPaperBin, bFullSize );
1896 case SID_ATTR_PAGE_ULSPACE:
1898 true,&pPoolItem) == SfxItemState::SET )
1907 SetPageSizeAndBorder(ePageKind, aNewSize, nLeft, nRight, nUpper, nLower, bScaleAll, eOrientation, nPaperBin, bFullSize );
1926 case SID_SEARCH_ITEM:
1927 case SID_SEARCH_OPTIONS:
1933 SAL_WARN(
"sd",
"DrawViewShell::GetState(): can not handle which id " << nWhich);
1950 case SID_SEARCH_ITEM:
1956 case SID_SPELL_DIALOG:
1959 if (rReq.
GetArgs() !=
nullptr)
1972 SAL_WARN(
"sd",
"DrawViewShell::Execute(): can not handle slot " << rReq.
GetSlot());
const OUString & GetValue() const
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
static css::uno::Reference< css::linguistic2::XThesaurus > GetThesaurus()
OUString const & GetName() const
ESelection GetSelection() const
Outliner * GetOutliner() const
OUString GetSelected() const
sal_Int16 GetDepth(sal_Int32 nPara) const
sal_Int32 GetParagraphCount() const
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
SAL_DLLPRIVATE LanguageType GetLanguage(const sal_uInt16 nId) const
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
SdrObject * GetPresObj(PresObjKind eObjKind, int nIndex=1, bool bFuzzySearch=false)
returns the nIndex'th object from the given PresObjKind, index starts with 1
virtual Orientation GetOrientation() const override
SdStyleSheet * getPresentationStyle(sal_uInt32 nHelpId) const
returns the presentation style with the given helpid from this masterpage or this slides masterpage
PageKind GetPageKind() const
sal_uInt16 GetPaperBin() const
AutoLayout GetAutoLayout() const
GraphicType GetGraphicType() const
bool isEmbeddedVectorGraphicData() const
Size getOriginalSize() const
SdrLayerID GetLayerID(const OUString &rName) const
bool IsSet(SdrLayerID a) const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrObject * GetMarkedSdrObj() const
const SdrLayerAdmin & GetLayerAdmin() const
static void MigrateItemSet(const SfxItemSet *pSourceSet, SfxItemSet *pDestSet, SdrModel *pNewModel)
size_t GetObjCount() const
virtual SdrInventor GetObjInventor() const
bool IsEmptyPresObj() const
virtual SdrObjKind GetObjIdentifier() const
virtual const tools::Rectangle & GetLogicRect() const
const SfxItemSet & GetItemSet() const
void PutItemSet(const SfxItemSet &rSet)
void PutItem(const SfxPoolItem &rItem)
void ClearItem(const sal_uInt16 nWhich=0)
SdrObjList * GetObjList() const
bool IsLayerVisible(const OUString &rName) const
SdrPage * GetPage() const
bool IsLayerLocked(const OUString &rName) const
SdrPage & TRG_GetMasterPage() const
bool IsMasterPage() const
sal_Int32 GetUpperBorder() const
sal_Int32 GetRightBorder() const
sal_Int32 GetLeftBorder() const
SdrPageProperties & getSdrPageProperties()
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
bool IsBackgroundFullSize() const
sal_Int32 GetLowerBorder() const
bool CanCreateEditOutlinerParaObject() const
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
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
SfxItemSet CloneAsValue(bool bItems=true, SfxItemPool *pToPool=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
void InvalidateItem(sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
SfxViewFrame * GetFrame() const
virtual SfxObjectShell * GetObjectShell()
void ToggleChildWindow(sal_uInt16)
SfxBindings & GetBindings()
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
static bool GetEmbeddedName(const TransferableDataHelper &rData, OUString &_rName, OUString &_rSource, SotClipboardFormatId const &_nFormat)
void SetLandscape(bool bL)
sal_uInt16 GetCurPageId() const
sal_uInt32 GetFormatCount() const
bool GetTransferableObjectDescriptor(SotClipboardFormatId nFormat, TransferableObjectDescriptor &rDesc)
SotClipboardFormatId GetFormat(sal_uInt32 nFormat) const
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
bool HasFormat(SotClipboardFormatId nFormat) const
static bool IsCursorAtURLField(const EditView &pEditView)
const GraphicObject & GetGraphicObject() const
const basegfx::BGradient & GetGradientValue() const
const XHatch & GetHatchValue() const
static BGradient fromJSON(std::u16string_view rJSON)
void Execute(SfxRequest &rReq)
Handles SFX-Requests.
void GetState(SfxItemSet &)
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
virtual SdPage * getCurrentPage() const override
inherited from sd::ViewShell
css::uno::Reference< css::scanner::XScannerManager2 > mxScannerManager
std::unique_ptr< DrawView > mpDrawView
bool IsLayerModeActive() const
rtl::Reference< TransferableClipboardListener > mxClipEvtLstnr
void GetMenuStateSel(SfxItemSet &rSet)
Set state (Enabled/Disabled) of Menu-SfxSlots.
VclPtr< TabControl > maTabControl
void GetDrawAttrState(SfxItemSet &rSet)
void Execute(SfxRequest &rReq)
void SetChildWindowState(SfxItemSet &rSet)
void GetState(SfxItemSet &rSet)
void GetPageProperties(SfxItemSet &rSet)
void GetMarginProperties(SfxItemSet &rSet)
::std::unique_ptr< SvxClipboardFormatItem > mpCurrentClipboardFormats
This item contains the clipboard formats of the current clipboard content that are supported both by ...
SD_DLLPUBLIC LayerTabBar * GetLayerTabControl()
Return a pointer to the tab control for layers.
virtual SdPage * GetActualPage() override
void GetModeSwitchingMenuState(SfxItemSet &rSet)
Set the items of the given item set that are related to switching the editing mode to the correct val...
void SetPageProperties(SfxRequest &rReq)
::Outliner * GetOutlinerForMasterPageOutlineTextObj(ESelection &rSel)
void GetMenuState(SfxItemSet &rSet)
PageKind GetPageKind() const
std::optional< bool > moAtContextMenu_DisableEditHyperlink
bool ShouldDisableEditHyperlink() const
return true if "Edit Hyperlink" in context menu should be disabled
static void GetSlotState(SfxItemSet &rSet, ViewShell const *pViewShell, SfxViewFrame *pViewFrame)
const OUString & GetShapeType() const
OUString GetLayerName(sal_uInt16 nPageId) const
static bool IsRealNameOfStandardLayer(std::u16string_view rName)
This view shell is responsible for showing the presentation of an Impress document.
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
static rtl::Reference< SlideShow > GetSlideShow(SdDrawDocument const *pDocument)
std::shared_ptr< ViewShellManager > const & GetViewShellManager() const
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
const rtl::Reference< FuPoor > & GetCurrentFunction() const
SdDrawDocument * GetDoc() const
void GetMenuState(SfxItemSet &rSet)
set state (enabled/disabled) of Menu SfxSlots
std::unique_ptr< ZoomList > mpZoomList
void SetPageSizeAndBorder(PageKind ePageKind, const Size &rNewSize, ::tools::Long nLeft, ::tools::Long nRight, ::tools::Long nUpper, ::tools::Long nLower, bool bScaleAll, Orientation eOrient, sal_uInt16 nPaperBin, bool bBackgroundFullSize)
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
::tools::Long GetZoom() const
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
bool HasCurrentFunction() const
SD_DLLPUBLIC ShellType GetShellType() const
Return the type of the shell.
static void getState(SdrView const *pSdrView, SfxItemSet &rSet)
static void getState(SdrView const *pSdrView, SfxItemSet &rSet)
#define DBG_ASSERT(sCon, aError)
static ::std::unique_ptr< SvxClipboardFormatItem > GetSupportedClipboardFormats(TransferableDataHelper &rDataHelper)
Create a list of clipboard formats that are supported both from the current clipboard content and the...
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
#define LINK(Instance, Class, Member)
#define SAL_WARN(area, stream)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
bool IsVerticalTextEnabled()
IMPL_LINK(SdCharHeightPropertyBox, implMenuSelectHdl, const OUString &, rIdent, void)
void MergePageBackgroundFilling(SdPage *pPage, SdStyleSheet *pStyleSheet, bool bMasterPage, SfxItemSet &rMergedAttr)
Merge the background properties together and deposit the result in rMergeAttr.
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
constexpr OUStringLiteral sUNO_LayerName_background_objects
constexpr OUStringLiteral sUNO_LayerName_background
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)