20#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
29#include <svx/svxids.hrc>
58#include <drawview.hxx>
70 void EndTextEditOnPage(sal_uInt16 nPageId)
91#define PIPETTE_RANGE 0
102 Reference<XDrawPagesSupplier> xDrawPagesSupplier(
GetDoc()->getUnoModel(), UNO_QUERY_THROW );
103 Reference<XDrawPages> xPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW );
106 std::vector<Reference<XDrawPage>> pagesToDelete;
110 for (sal_uInt16
i = 0;
i < nPageCount;
i++)
117 bool bUseSlideSorter = pVShell !=
nullptr;
122 Reference< XDrawPage > xPage( xPages->getByIndex( nPageIndex ), UNO_QUERY_THROW );
123 pagesToDelete.push_back(xPage);
126 for (
const auto &xPage: pagesToDelete)
128 xPages->remove(xPage);
143 OSL_ENSURE(
false,
"No LayerTabBar (!)");
152 assert(
false &&
"Standard layer may not be deleted.");
156 OUString aString(
SdResId(STR_ASK_DELETE_LAYER));
159 aString = aString.replaceFirst(
"$", rDisplayName);
162 VclMessageType::Question, VclButtonsType::YesNo,
164 if (xQueryBox->run() ==
RET_YES)
205 bool bDidVisitOldObject(
false);
207 while(aIter.
IsMore() && !pCandidate)
216 if(SdrInventor::Default == nInv &&
217 (SdrObjKind::TitleText == nKnd || SdrObjKind::OutlineText == nKnd || SdrObjKind::Text == nKnd)
218 && bDidVisitOldObject)
220 pCandidate = pSdrTextObj;
225 bDidVisitOldObject =
true;
238 SID_ATTR_CHAR, SfxCallMode::ASYNCHRON);
244 SID_INSERTPAGE_QUICK, SfxCallMode::ASYNCHRON);
279 if ( rRuler.GetExtraRect().Contains(rMEvt.
GetPosPixel()) )
293 eKind = SdrHelpLineKind::Point;
295 eKind = SdrHelpLineKind::Horizontal;
297 eKind = SdrHelpLineKind::Vertical;
318 rBindings.
Invalidate(SID_NAVIGATOR_STATE,
true);
370 bool bInsideOtherWindow =
false;
379 bInsideOtherWindow =
true;
388 else if ( bInsideOtherWindow )
463 static_cast<sal_uInt8>( nGreen / fDiv + .5 ),
464 static_cast<sal_uInt8>( nBlue / fDiv + .5 ) ) );
473 bool bIsSetPageOrg =
mpDrawView->IsSetPageOrg();
486 else if (rMEvt.
IsLeft() && bIsSetPageOrg)
491 mpDrawView->GetSdrPageView()->SetPageOrigin(aOrg);
519 if ( bIsOleActive && ( rCEvt.
GetCommand() == CommandEventId::ContextMenu ))
535 if( rCEvt.
GetCommand() == CommandEventId::PasteSelection && !bNativeShow )
547 if( !
mpDrawView->InsertData( aDataHelper, aPos, nDnDAction,
false ) )
551 if( ( aDataHelper.
HasFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK ) &&
552 aDataHelper.
GetINetBookmark( SotClipboardFormatId::NETSCAPE_BOOKMARK, aINetBookmark ) ) ||
553 ( aDataHelper.
HasFormat( SotClipboardFormatId::FILEGRPDESCRIPTOR ) &&
554 aDataHelper.
GetINetBookmark( SotClipboardFormatId::FILEGRPDESCRIPTOR, aINetBookmark ) ) ||
555 ( aDataHelper.
HasFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) &&
556 aDataHelper.
GetINetBookmark( SotClipboardFormatId::UNIFORMRESOURCELOCATOR, aINetBookmark ) ) )
563 else if( rCEvt.
GetCommand() == CommandEventId::ContextMenu && !bNativeShow &&
573 sal_uInt16 nHelpLine;
576 sal_uInt16 nPickId = 0;
592 else if(
mpDrawView->PickGluePoint( aMPos, pObj, nPickId, pPV ) &&
593 mpDrawView->IsGluePointMarked( pObj, nPickId ) )
595 aPopupId =
"gluepoint";
620 aMPos =
Point( 20, 20 );
624 aFieldPopup.
Execute(pParent, aRect);
626 std::unique_ptr<SvxFieldData> pField(aFieldPopup.
GetField());
652 mpDrawView->GetMarkedObjectList().GetMarkCount() == 1 )
654 pObj =
mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
698 aPopupId =
"drawtext";
708 if (nInv == SdrInventor::Default)
712 case SdrObjKind::OutlineText:
713 case SdrObjKind::Caption:
714 case SdrObjKind::TitleText:
715 case SdrObjKind::Text:
716 aPopupId =
"textbox";
719 case SdrObjKind::PathLine:
720 case SdrObjKind::PolyLine:
724 case SdrObjKind::FreehandLine:
725 case SdrObjKind::Edge:
726 aPopupId =
"connector";
729 case SdrObjKind::Line:
733 case SdrObjKind::Measure:
734 aPopupId =
"measure";
737 case SdrObjKind::Rectangle:
738 case SdrObjKind::CircleOrEllipse:
739 case SdrObjKind::FreehandFill:
740 case SdrObjKind::PathFill:
741 case SdrObjKind::Polygon:
742 case SdrObjKind::CircleSection:
743 case SdrObjKind::CircleArc:
744 case SdrObjKind::CircleCut:
745 case SdrObjKind::CustomShape:
749 case SdrObjKind::Group:
753 case SdrObjKind::Graphic:
754 aPopupId =
"graphic";
757 case SdrObjKind::OLE2:
758 aPopupId =
"oleobject";
760 case SdrObjKind::Media:
763 case SdrObjKind::Table:
769 else if( nInv == SdrInventor::E3d )
771 if(
nId == SdrObjKind::E3D_Scene )
774 aPopupId =
"3dscene";
776 aPopupId =
"3dscene2";
779 aPopupId =
"3dobject";
781 else if( nInv == SdrInventor::FmForm )
791 mpDrawView->GetMarkedObjectList().GetMarkCount() > 1 )
793 aPopupId =
"multiselect";
803 if (!aPopupId.isEmpty())
825 mpDrawView->GetMarkedObjectList().TakeBoundRect(
nullptr,aMarkRect);
829 if( aMenuPos.
X() < 0 )
831 if( aMenuPos.
Y() < 0 )
843 if (!bShouldDisableEditHyperlink)
895 pHLines[0].
nPos = rRect.Left() - nHOffs;
896 pVLines[0].
nPos = rRect.Top() - nVOffs;
898 if ( rRect.Right() != rRect.Left() || rRect.Bottom() != rRect.Top() )
900 pHLines[1].
nPos = rRect.Right() - nHOffs;
901 pVLines[1].
nPos = rRect.Bottom() - nVOffs;
917 SID_CONTEXT, SID_CONTEXT,
918 SID_ATTR_POSITION, SID_ATTR_SIZE> aSet(
GetPool());
944 SdrPageView& rPageView,
const sal_uInt16 nSnapLineIndex)
948 std::unique_ptr<weld::Menu> xMenu(xBuilder->weld_menu(
"menu"));
950 if (rHelpLine.
GetKind() == SdrHelpLineKind::Point)
952 xMenu->append(OUString::number(SID_SET_SNAPITEM),
SdResId(STR_POPUP_EDIT_SNAPPOINT));
953 xMenu->append_separator(
"separator");
954 xMenu->append(OUString::number(SID_DELETE_SNAPITEM),
SdResId(STR_POPUP_DELETE_SNAPPOINT));
958 xMenu->append(OUString::number(SID_SET_SNAPITEM),
SdResId(STR_POPUP_EDIT_SNAPLINE));
959 xMenu->append_separator(
"separator");
960 xMenu->append(OUString::number(SID_DELETE_SNAPITEM),
SdResId(STR_POPUP_DELETE_SNAPLINE));
963 const int nResult = xMenu->popup_at_rect(pParent, rRect).toInt32();
966 case SID_SET_SNAPITEM:
977 case SID_DELETE_SNAPITEM:
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
sal_uInt8 GetBlue() const
sal_uInt8 GetGreen() const
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
bool IsMouseEvent() const
vcl::Cursor * GetCursor() const
const OUString & GetDescription() const
const OUString & GetURL() const
const vcl::KeyCode & GetKeyCode() const
const Point & GetPosPixel() const
void SetSelection(const ESelection &)
void InsertField(const SvxFieldItem &rFld)
bool IsWrongSpelledWordAtPos(const Point &rPosPixel)
const SvxFieldItem * GetFieldAtSelection() const
ESelection GetSelection() const
void ExecuteSpellPopup(const Point &rPosPixel, const Link< SpellCallbackInfo &, void > &rCallBack)
Outliner * GetOutliner() const
bool IsCursorAtWrongSpelledWord()
EditView & GetEditView() const
LanguageType GetLanguage(sal_Int32 nPara, sal_Int32 nPos) const
Color GetPixel(const Point &rPt) const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
sal_uInt16 getPageId() const
SdrHelpLineKind GetKind() const
SdrLayer * GetLayer(sal_uInt16 i)
const OUString & GetName() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
void UnMarkAll(SdrPageView const *pPV=nullptr)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
const SdrLayerAdmin & GetLayerAdmin() const
virtual SdrInventor GetObjInventor() const
virtual SdrObjKind GetObjIdentifier() const
const SdrHelpLineList & GetHelpLines() const
void DeleteHelpLine(sal_uInt16 nNum)
sal_Int32 GetUpperBorder() const
sal_Int32 GetLeftBorder() const
void SetState(const SfxItemSet &rSet)
void Invalidate(sal_uInt16 nId)
vcl::Window * GetWindow() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
void ExecutePopup(const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr)
bool IsObjectInPlaceActive() const
SfxItemPool & GetPool() const
SfxViewShell * GetViewShell() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
SfxChildWindow * GetChildWindow(sal_uInt16)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
SfxInPlaceClient * GetIPClient() const
void SetColor(const Color &rColor)
const SvxFieldData * GetField() const
sal_uInt16 GetCurPageId() const
static TransferableDataHelper CreateFromPrimarySelection()
bool HasFormat(SotClipboardFormatId nFormat) const
const css::uno::Reference< css::datatransfer::XTransferable > & GetTransferable() const
bool GetINetBookmark(SotClipboardFormatId nFormat, INetBookmark &rBmk) const
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
virtual bool KeyInput(const KeyEvent &rKEvt, ::sd::Window *pWin) override
void EnableEditHyperlink()
force "Edit Hyperlink" to true, with the expectation that SID_EDIT_HYPERLINK is later Invalidated to ...
void GetStatusBarState(SfxItemSet &rSet)
void ShowSnapLineContextMenu(weld::Window *pParent, const ::tools::Rectangle &rRect, SdrPageView &rPageView, const sal_uInt16 nSnapLineIndex)
Show the context menu for snap lines and points.
bool IsSelected(sal_uInt16 nPage)
virtual void MouseButtonDown(const MouseEvent &rMEvt, ::sd::Window *pWin) override
virtual SdPage * getCurrentPage() const override
inherited from sd::ViewShell
EditMode GetEditMode() const
std::unique_ptr< DrawView > mpDrawView
const SdViewOptions & GetViewOptions() const
VclPtr< TabControl > maTabControl
virtual void ChangeEditMode(EditMode eMode, bool bIsLayerModeActive)
Set status (enabled/disabled) of menu SfxSlots.
void StartRulerDrag(const Ruler &rRuler, const MouseEvent &rMEvt)
Start with Drag from ruler (helper lines, origin)
bool mbIsLayerModeActive
This flag controls whether the layer mode is active, i.e.
bool IsInputLocked() const
SD_DLLPUBLIC LayerTabBar * GetLayerTabControl()
Return a pointer to the tab control for layers.
virtual SdPage * GetActualPage() override
virtual void MouseButtonUp(const MouseEvent &rMEvt, ::sd::Window *pWin) override
DrawView * GetDrawView() const
void ShowMousePosInfo(const ::tools::Rectangle &rRect, ::sd::Window const *pWin)
void InsertURLField(const OUString &rURL, const OUString &rText, const OUString &rTarget)
void ConfigureAppBackgroundColor(svtools::ColorConfig *pColorConfig=nullptr)
virtual void MouseMove(const MouseEvent &rMEvt, ::sd::Window *pWin) override
void SelectionHasChanged()
Called, if state of selection of view is changed.
std::optional< bool > moAtContextMenu_DisableEditHyperlink
virtual void Command(const CommandEvent &rCEvt, ::sd::Window *pWin) override
bool IsMouseButtonDown() const
bool ShouldDisableEditHyperlink() const
return true if "Edit Hyperlink" in context menu should be disabled
OUString GetLayerName(sal_uInt16 nPageId) const
static bool IsRealNameOfStandardLayer(std::u16string_view rName)
bool IsHorizontal() const
void FreshTree(const SdDrawDocument *pDoc)
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
Base class of the stacked shell hierarchy.
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
virtual bool KeyInput(const KeyEvent &rKEvt, ::sd::Window *pWin)
VclPtr< SvxRuler > mpHorizontalRuler
Horizontal ruler is not shown by default.
SdDrawDocument * GetDoc() const
virtual void MouseMove(const MouseEvent &rMEvt, ::sd::Window *pWin)
virtual void Command(const CommandEvent &rCEvt, ::sd::Window *pWin)
VclPtr< SvxRuler > mpVerticalRuler
Vertical ruler is not shown by default.
virtual void MouseButtonUp(const MouseEvent &rMEvt, ::sd::Window *pWin)
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
::sd::View * GetView() const
virtual void MouseButtonDown(const MouseEvent &rMEvt, ::sd::Window *pWin)
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
VclPtr< sd::Window > mpContentWindow
Window inside the rulers and scroll bars that shows a view of the document.
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
bool HasCurrentFunction() const
bool mbHasRulers
This flag controls whether the rulers are visible.
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
An SdWindow contains the actual working area of ViewShell.
SD_DLLPUBLIC SlideSorter & GetSlideSorter() const
const Point & GetPos() const
sal_uInt16 GetCode() const
Point LogicToPixel(const Point &rLogicPt) const
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
Sequence< PropertyValue > aArguments
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_TAB
#define LINK(Instance, Class, Member)
bool IsInPopupMenuExecute()
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
OUString SdResId(TranslateId aId)
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)