20 #include <com/sun/star/i18n/WordType.hpp>
22 #include <editeng/editeng.hxx>
60 #include <svx/strings.hrc>
71 , pTextEditPV(nullptr)
72 , pTextEditOutlinerView(nullptr)
73 , pTextEditWin(nullptr)
74 , pTextEditCursorBuffer(nullptr)
79 , bTextEditDontDelete(false)
80 , bTextEditOnlyOneView(false)
81 , bTextEditNewObj(false)
82 , bQuickTextEditMode(true)
84 , mpOldTextEditUndoManager(nullptr)
135 for (
SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView())
137 if (pView ==
this || !pView->IsTextEdit())
149 OutlinerView* pOutlinerView = pView->ImpMakeOutlinerView(
152 pView->GetTextEditOutliner()->InsertView(pOutlinerView);
175 for (
SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView())
180 SdrOutliner* pOutliner = pView->GetTextEditOutliner();
181 for (
size_t nView = 0; nView < pOutliner->
GetViewCount(); ++nView)
184 if (pOutlinerView->
GetWindow() != pOutputDevice)
188 delete pOutlinerView;
220 if (rHint.
GetId() != SfxHintId::ThisIsAnSdrHint)
245 if (pTextObj !=
nullptr)
248 bool bAreaChg =
false;
249 bool bAnchorChg =
false;
250 bool bColorChg =
false;
261 pTextObj->
TakeTextEditArea(&aPaperMin1, &aPaperMax1, &aEditArea1, &aMinArea1);
271 aEditArea1 += aOffset;
272 aMinArea1 += aOffset;
275 aEditArea1.
Move(aPvOfs.X(), aPvOfs.Y());
276 aMinArea1.
Move(aPvOfs.X(), aPvOfs.Y());
278 aNewArea.
Union(aEditArea1);
294 nStat |= EEControlBits::AUTOPAGESIZE;
306 for (
size_t nOV = 0; nOV < nOutlViewCnt; nOV++)
313 nStat |= EVControlBits::AUTOSIZE;
327 bAnchorChg = eOldAnchor != eNewAnchor;
330 bColorChg = aOldColor != aNewColor;
347 if (bContourFrame || bAreaChg || bAnchorChg || bColorChg)
349 for (
size_t nOV = 0; nOV < nOutlViewCnt; nOV++)
411 bool mbVisualizeSurroundingFrame : 1;
419 bool bVisualizeSurroundingFrame);
420 virtual ~TextEditOverlayObject()
override;
424 const OutlinerView& getOutlinerView()
const {
return mrOutlinerView; }
433 void checkSelectionChange();
437 TextEditOverlayObject::createOverlayObjectPrimitive2DSequence()
442 if (mbVisualizeSurroundingFrame)
446 const sal_uInt16 nPixSiz(getOutlinerView().GetInvalidateMore() - 1);
449 maRange, getBaseColor().getBColor(), fTransparence, std::max(6, nPixSiz - 2),
455 aRetval.
append(maTextPrimitives);
460 TextEditOverlayObject::TextEditOverlayObject(
const Color& rColor,
OutlinerView& rOutlinerView,
461 bool bVisualizeSurroundingFrame)
462 : OverlayObject(rColor)
463 , mpOverlaySelection(nullptr)
464 , mrOutlinerView(rOutlinerView)
468 , maLastTextPrimitives()
469 , mbVisualizeSurroundingFrame(bVisualizeSurroundingFrame)
472 allowAntiAliase(
false);
476 const std::vector<basegfx::B2DRange> aEmptySelection{};
478 rColor, aEmptySelection,
true);
481 TextEditOverlayObject::~TextEditOverlayObject()
483 if (getOverlaySelection())
485 delete mpOverlaySelection;
486 mpOverlaySelection =
nullptr;
489 if (getOverlayManager())
491 getOverlayManager()->remove(*
this);
496 TextEditOverlayObject::getOverlayObjectPrimitive2DSequence()
const
498 if (!getPrimitive2DSequence().empty())
500 if (!
maRange.equal(maLastRange) || maLastTextPrimitives != maTextPrimitives)
503 const_cast<TextEditOverlayObject*
>(
this)->resetPrimitive2DSequence();
507 if (getPrimitive2DSequence().empty())
510 const_cast<TextEditOverlayObject*
>(
this)->maLastRange = maRange;
511 const_cast<TextEditOverlayObject*
>(
this)->maLastTextPrimitives = maTextPrimitives;
515 return OverlayObject::getOverlayObjectPrimitive2DSequence();
518 void TextEditOverlayObject::checkDataChange(
const basegfx::B2DRange& rMinTextEditArea)
520 bool bObjectChange(
false);
525 aNewRange.expand(rMinTextEditArea);
527 if (aNewRange != maRange)
530 bObjectChange =
true;
548 const bool bVerticalWriting(pSdrOutliner->
IsVertical());
550 const double fStartInX(bVerticalWriting && bTopToBottom
551 ? aOutArea.Right() - aVisArea.Left()
552 : aOutArea.Left() - aVisArea.Left());
553 const double fStartInY(bVerticalWriting && !bTopToBottom
554 ? aOutArea.Bottom() - aVisArea.Top()
555 : aOutArea.Top() - aVisArea.Top());
557 aNewTransformB.
translate(fStartInX, fStartInY);
564 aNewTextPrimitives, *pSdrOutliner, aNewTransformA, aNewTransformB, aClipRange);
566 if (aNewTextPrimitives != maTextPrimitives)
568 maTextPrimitives = aNewTextPrimitives;
569 bObjectChange =
true;
581 checkSelectionChange();
585 void TextEditOverlayObject::checkSelectionChange()
587 if (!(getOverlaySelection() && getOverlayManager()))
590 std::vector<tools::Rectangle> aLogicRects;
591 std::vector<basegfx::B2DRange> aLogicRanges;
592 const Size aLogicPixel(getOverlayManager()->getOutputDevice().PixelToLogic(
Size(1, 1)));
595 getOutlinerView().GetSelectionRectangles(aLogicRects);
597 aLogicRanges.reserve(aLogicRects.size());
598 for (
const auto& aRect : aLogicRects)
602 aLogicRanges.emplace_back(
603 aRect.Left() - aLogicPixel.Width(), aRect.Top() - aLogicPixel.Height(),
604 aRect.Right() + aLogicPixel.Width(), aRect.Bottom() + aLogicPixel.Height());
607 mpOverlaySelection->setRanges(aLogicRanges);
627 TextEditOverlayObject* pCandidate
632 pCandidate->checkDataChange(aMinTextRange);
647 TextEditOverlayObject* pCandidate
652 pCandidate->checkSelectionChange();
700 const sal_uInt32 nViewCount(pActiveOutliner->
GetViewCount());
707 for (sal_uInt32
i(0);
i < nViewCount;
i++)
737 bool bFitToSize(
pTextEditOutliner->GetControlWord() & EEControlBits::STRETCHING);
752 rOutlView.
Paint(aBlankRect, &rTargetDevice);
759 if (bTextFrame && !bFitToSize)
763 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D>
xProcessor(
765 aViewInformation2D));
778 aRange, aHilightColor.getBColor(), fTransparence,
779 std::max(6, nPixSiz - 2),
785 xProcessor->process(aSequence);
804 if (!bTextFrame || bFitToSize)
813 aPixRect.AdjustTop(-1);
814 aPixRect.AdjustRight(1);
815 aPixRect.AdjustBottom(1);
824 if (aPixRect.Left() < -a)
825 aPixRect.SetLeft(-a);
826 if (aPixRect.Top() < -a)
828 if (aPixRect.Right() > nMaxX)
829 aPixRect.SetRight(nMaxX);
830 if (aPixRect.Bottom() > nMaxY)
831 aPixRect.SetBottom(nMaxY);
852 bool bTextFrame = pText !=
nullptr && pText->
IsTextFrame();
858 if (pOutlView ==
nullptr)
872 nStat |= EVControlBits::AUTOSIZE;
876 nStat |= EVControlBits::INVONEMORE;
889 if (pText !=
nullptr)
904 if (pTextEditOutliner)
921 if (pTextObj && pOLV)
947 std::unique_ptr<SdrUndoObjSetText> pTxtUndo;
950 dynamic_cast<SdrUndoObjSetText*>(
GetModel()
951 ->GetSdrUndoFactory()
952 .CreateUndoObjectSetText(*pTextObj, nText)
960 pTxtUndo->AfterSetText();
961 if (!pTxtUndo->IsDifferent())
979 SAL_INFO(
"svx.chaining",
"[OnChaining] No Edit Outliner View");
988 ImpChainingEventHdl();
990 ImpMoveCursorAfterChainingEvent(&aCursorManager);
1016 OUString& rStr = pFI->GetRepresentation();
1019 if (pTextObj !=
nullptr)
1021 std::optional<Color> pTxtCol;
1022 std::optional<Color> pFldCol;
1023 bOk = pTextObj->
CalcFieldValue(pFI->GetField(), pFI->GetPara(), pFI->GetPos(),
true,
1024 pTxtCol, pFldCol, rStr);
1029 pFI->SetTextColor(*pTxtCol);
1033 pFI->SetFieldColor(*pFldCol);
1041 Outliner& rDrawOutl = mpModel->GetDrawOutliner(pTextObj);
1043 if (!bOk && aDrawOutlLink.IsSet())
1045 aDrawOutlLink.Call(pFI);
1046 bOk = !rStr.isEmpty();
1050 aOldCalcFieldValueLink.Call(pFI);
1064 OutlinerView* pGivenOutlinerView,
bool bDontDeleteOutliner,
1065 bool bOnlyOneView,
bool bGrabFocus)
1078 if (bGrabFocus && pWin)
1093 for (i = 0; i < nWinCount && !pWin; i++)
1129 OSL_FAIL(
"SdrObjEditView::SdrBeginTextEdit(): Old Outliner still exists.");
1141 pGivenOutliner =
nullptr;
1167 DBG_ASSERT(pTextObj,
"svx::SdrObjEditView::BegTextEdit(), no text object?");
1194 aTextRect = aAnchorRect;
1232 const bool bTextFrame(pText && pText->IsTextFrame());
1234 & EEControlBits::STRETCHING);
1235 const bool bVisualizeSurroundingFrame(bTextFrame && !bFitToSize);
1250 std::unique_ptr<TextEditOverlayObject> pNewTextEditOverlayObject(
1252 bVisualizeSurroundingFrame));
1254 xManager->add(*pNewTextEditOverlayObject);
1255 xManager->add(const_cast<sdr::overlay::OverlaySelection&>(
1256 *pNewTextEditOverlayObject->getOverlaySelection()));
1267 for (i2 = 0; i2 < nCount; i2++)
1282 for (i = 0; i < nWinCount; i++)
1301 for (
SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView())
1306 for (sal_uInt32 nViewPaintWindow = 0;
1307 nViewPaintWindow < pView->PaintWindowCount(); ++nViewPaintWindow)
1309 SdrPaintWindow* pPaintWindow = pView->GetPaintWindow(nViewPaintWindow);
1315 static_cast<vcl::Window*>(&rOutDev),
nullptr);
1317 static_cast<vcl::Window*
>(&rOutDev)->SetCursor(
nullptr);
1353 && !
GetModel()->GetDisableTextEditUsesCommonUndoManager())
1357 if (pSdrUndoManager)
1370 "The document undo manager is not derived from SdrUndoManager (!)");
1389 if (!bDontDeleteOutliner)
1391 delete pGivenOutliner;
1392 if (pGivenOutlinerView !=
nullptr)
1394 delete pGivenOutlinerView;
1395 pGivenOutlinerView =
nullptr;
1417 bool bNeedToUndoSavedRedoTextEdit(
false);
1420 && !
GetModel()->GetDisableTextEditUsesCommonUndoManager())
1431 if (pSdrUndoManager && dynamic_cast<SdrUndoManager*>(pOriginal) == pSdrUndoManager)
1438 pUndoEditUndoManager = pSdrUndoManager;
1444 while (pSdrUndoManager->GetRedoActionCount())
1446 bNeedToUndoSavedRedoTextEdit =
true;
1447 pSdrUndoManager->
Redo();
1457 OSL_ENSURE(
false,
"Got UndoManager back in SdrEndTextEdit which is NOT the "
1458 "expected document UndoManager (!)");
1490 if (pTEOutliner !=
nullptr)
1493 if (pTEOutlinerView !=
nullptr)
1497 if (pTEObj !=
nullptr)
1501 std::unique_ptr<SdrUndoObjSetText> pTxtUndo;
1506 for (nText = 0; nText < pTEObj->
getTextCount(); ++nText)
1511 dynamic_cast<SdrUndoObjSetText*>(
GetModel()
1512 ->GetSdrUndoFactory()
1513 .CreateUndoObjectSetText(*pTEObj, nText)
1517 "svx::SdrObjEditView::EndTextEdit(), could not create undo action!");
1538 if (pTxtUndo !=
nullptr)
1540 pTxtUndo->AfterSetText();
1541 if (!pTxtUndo->IsDifferent())
1547 std::unique_ptr<SdrUndoAction> pDelUndo;
1548 bool bDelObj =
false;
1570 if (pDelUndo !=
nullptr)
1578 "SdrObjEditView::SdrEndTextEdit(): Fatal: Object edited doesn't have an "
1621 aRect.AdjustLeft(-nMorePix);
1622 aRect.AdjustTop(-nMorePix);
1623 aRect.AdjustRight(nMorePix);
1624 aRect.AdjustBottom(nMorePix);
1634 pTEOutliner->
Clear();
1635 if (pTEWin !=
nullptr)
1652 if (pUndoEditUndoManager)
1654 if (bNeedToUndoSavedRedoTextEdit)
1659 pUndoEditUndoManager->
Undo();
1664 pUndoEditUndoManager->
Undo();
1678 if (pWin ==
nullptr)
1684 for (
size_t i = 0;
i < nWinCount && pNewView ==
nullptr;
i++)
1720 if (pOLV !=
nullptr)
1751 if (pText !=
nullptr && pText->
IsTextFrame() && pWin !=
nullptr)
1771 std::unique_ptr<TextChainCursorManager>
1774 *bOutHandled =
false;
1783 std::unique_ptr<TextChainCursorManager> pCursorManager(
1785 if (pCursorManager->HandleKeyEvent(rKEvt))
1789 *bOutHandled =
true;
1792 return pCursorManager;
1801 bool bHandled =
false;
1802 std::unique_ptr<TextChainCursorManager> xCursorManager(
1838 if (pWin !=
nullptr)
1850 if (aPixPos.X() < aR.
Left())
1851 aPixPos.setX(aR.
Left());
1852 if (aPixPos.X() > aR.
Right())
1853 aPixPos.setX(aR.
Right());
1854 if (aPixPos.Y() < aR.
Top())
1855 aPixPos.setY(aR.
Top());
1856 if (aPixPos.Y() > aR.
Bottom())
1857 aPixPos.setY(aR.
Bottom());
1882 if (pWin !=
nullptr)
1888 if (bPostIt && pWin)
1892 if (aPixPos.X() < aR.Left())
1893 aPixPos.setX(aR.Left());
1894 if (aPixPos.X() > aR.Right())
1895 aPixPos.setX(aR.Right());
1896 if (aPixPos.Y() < aR.Top())
1897 aPixPos.setY(aR.Top());
1898 if (aPixPos.Y() > aR.Bottom())
1899 aPixPos.setY(aR.Bottom());
1917 bool bPostIt = bSelMode;
1935 if (aPixPos.X() < aR.Left())
1936 aPixPos.setX(aR.Left());
1937 if (aPixPos.X() > aR.Right())
1938 aPixPos.setX(aR.Right());
1939 if (aPixPos.Y() < aR.Top())
1940 aPixPos.setY(aR.Top());
1941 if (aPixPos.Y() > aR.Bottom())
1942 aPixPos.setY(aR.Bottom());
1960 if (rCEvt.
GetCommand() == CommandEventId::StartDrag)
1966 if (pWin !=
nullptr)
1978 if (aPixPos.X() < aR.
Left())
1979 aPixPos.setX(aR.
Left());
1980 if (aPixPos.X() > aR.
Right())
1981 aPixPos.setX(aR.
Right());
1982 if (aPixPos.Y() < aR.
Top())
1983 aPixPos.setY(aR.
Top());
1984 if (aPixPos.Y() > aR.
Bottom())
1985 aPixPos.setY(aR.
Bottom());
2023 if (aESel.nStartPara == 0 && aESel.nStartPos == 0 && aESel.nEndPara == (nParaCnt - 1))
2029 if (!bRet && aESel.nEndPara == 0 && aESel.nEndPos == 0
2030 && aESel.nStartPara == (nParaCnt - 1))
2049 if (pCsr !=
nullptr)
2052 if (!aSiz.IsEmpty())
2076 for (
size_t i = 0;
i < nMarkCount; ++
i)
2087 if (nScriptType == SvtScriptType::NONE)
2088 nScriptType = SvtScriptType::LATIN;
2102 "SdrObjEditView::GetAttributes(): pTextEditOutlinerView=NULL");
2104 "SdrObjEditView::GetAttributes(): pTextEditOutliner=NULL");
2153 bool bHasEEFeatureItems =
false;
2160 sal_uInt16 nW = pItem->Which();
2162 bHasEEFeatureItems =
true;
2166 if (bHasEEFeatureItems)
2169 nullptr, VclMessageType::Info, VclButtonsType::Ok,
2170 "SdrObjEditView::SetAttributes(): Setting EE_FEATURE items "
2171 "at the SdrView does not make sense! It only leads to "
2172 "overhead and unreadable documents."));
2182 if (bAllTextSelected || bNoEEItems)
2213 else if (!bOnlyEEItems)
2218 std::unique_ptr<sal_uInt16[]> pNewWhichTable
2221 pNewWhichTable.reset();
2228 if (eState == SfxItemState::SET)
2311 for (sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
2348 lcl_RemoveTextEditOutlinerViews(
this,
GetSdrPageView(), pOldWin);
2362 if (pObj !=
nullptr && pPV !=
nullptr && pWin !=
nullptr && pObj->
HasMacro())
2380 aHitRec.
aPos = rUpPos;
2394 aHitRec.
aPos = rDownPos;
2409 aHitRec.
aPos = rPnt;
2470 css::uno::Reference<css::text::XText> xText(pObj->
getUnoShape(), css::uno::UNO_QUERY);
2473 SvxUnoTextBase* pRange = comphelper::getUnoTunnelImplementation<SvxUnoTextBase>(xText);
2505 SdrView* pView(dynamic_cast<SdrView*>(
this));
2509 && (pObj->GetObjIdentifier() ==
OBJ_TABLE))
2524 OnEndPasteOrDrop(pInfo);
2529 OnBeginPasteOrDrop(pInfo);
2544 sal_uInt16 nLevel = 0xFFFF;
2548 "SdrObjEditView::GetAttributes(): pTextEditOutlinerView=NULL");
2550 "SdrObjEditView::GetAttributes(): pTextEditOutliner=NULL");
2559 for (sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++)
2561 sal_uInt16 nParaDepth
2563 if (!(nLevel & nParaDepth))
2564 nLevel += nParaDepth;
2578 sal_uInt16 nObjectIdentifier)
2582 switch (nObjectIdentifier)
2646 return &gRanges[bTextOnly ? 10 : 0];
2665 const bool bOnlyHardAttr =
false;
2684 bool bNoCharacterFormats,
bool bNoParagraphFormats)
2690 sal_uInt16 nWhich = *pRanges++;
2691 const sal_uInt16 nLastWhich = *pRanges++;
2699 for (; nWhich < nLastWhich; nWhich++)
2704 if ((pSourceItem && !pTargetItem)
2705 || (pSourceItem && pTargetItem && *pSourceItem != *pTargetItem))
2707 aPaintSet.
Put(*pSourceItem);
2715 SdrText* pText,
bool bNoCharacterFormats,
2716 bool bNoParagraphFormats)
2730 for (sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
2732 if (!bNoCharacterFormats)
2737 bNoCharacterFormats, bNoParagraphFormats));
2741 std::unique_ptr<OutlinerParaObject> pTemp = rOutliner.
CreateParaObject(0, nParaCount);
2748 bool bNoParagraphFormats)
2752 bNoParagraphFormats))
2769 const sal_uInt16* pRanges = rFormatSet.
GetRanges();
2770 bool bTextOnly =
true;
2785 rFormatSet, rShapeSet, bNoCharacterFormats,
2786 bNoParagraphFormats));
2796 while (--nText >= 0)
2800 bNoParagraphFormats);
2812 if (!aSel.HasRange())
2815 const bool bRemoveParaAttribs = !bNoParagraphFormats;
2819 rFormatSet, aSet, bNoCharacterFormats,
2820 bNoParagraphFormats));
bool MouseButtonDown(const MouseEvent &)
#define LINK(Instance, Class, Member)
void setEditViewCallbacks(EditViewCallbacks *pEditViewCallbacks)
virtual void ModelHasChanged() override
OutDevType GetOutDevType() const
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
bool IsTextEditInSelectionMode() const
bool IsMacroHit(const SdrObjMacroHitRec &rRec) const
void ImpPaintOutlinerView(OutlinerView &rOutlView, const tools::Rectangle &rRect, OutputDevice &rTargetDevice) const
virtual void OnEndPasteOrDrop(PasteOrDropInfos *pInfo)
Point GetPointerPosPixel()
constexpr sal_uInt16 XATTR_LINE_LAST(XATTR_LINECAP)
bool SearchOutlinerItems(const SfxItemSet &rSet, bool bInklDefaults, bool *pbOnlyEE)
Search an ItemSet for Outliner/EditEngine Items.
virtual bool MouseButtonUp(const MouseEvent &, OutputDevice *)
constexpr sal_uInt16 SDRATTR_SHADOW_FIRST(XATTR_END+1)
OUString GetWord(sal_Int32 nPara, sal_Int32 nIndex)
SdrHintKind GetKind() const
size_t GetMarkCount() const
virtual void DeleteWindowFromPaintView(OutputDevice *pOldWin) override
virtual const tools::Rectangle & GetCurrentBoundRect() const
static void impDecomposeBlockTextPrimitiveDirect(drawinglayer::primitive2d::Primitive2DContainer &rTarget, SdrOutliner &rOutliner, const basegfx::B2DHomMatrix &rNewTransformA, const basegfx::B2DHomMatrix &rNewTransformB, const basegfx::B2DRange &rClipRange)
Polygon/PolyPolygon represented by SdrPathObj.
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false)
constexpr sal_uInt16 SDRATTR_TABLE_FIRST(SDRATTR_CUSTOMSHAPE_LAST+1)
virtual void EditViewInputContext(const InputContext &rInputContext) override
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
virtual void BrkAction() override
std::unique_ptr< SdrOutliner > pTextEditOutliner
virtual SdrObjKind GetObjIdentifier() const override
sal_uInt16 GetTransparentSelectionPercent() const
void RemoveAttribsKeepLanguages(bool bRemoveParaAttribs)
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void SetNotPersistAttrToMarked(const SfxItemSet &rAttr)
abstract object (SdrObject)
rtl::Reference< sdr::SelectionController > mxLastSelectionController
virtual void TakeTextEditArea(Size *pPaperMin, Size *pPaperMax, tools::Rectangle *pViewInit, tools::Rectangle *pViewMin) const
rectangle (round corners optional)
virtual SdrText * getText(sal_Int32 nIndex) const override
returns the nth available text.
virtual void DeleteWindowFromPaintView(OutputDevice *pOldWin)
SfxStyleSheet * GetStyleSheet() const
tools::Rectangle const & GetOutputArea() const
tools::Rectangle aMinTextEditArea
SdrTextObj * GetTextEditObject() const
bool IsUndoEnabled() const
void ShowCursor(bool bGotoCursor=true, bool bActivate=false)
ESelection const & GetPostChainingSel(const SdrTextObj *)
MouseEventModifiers GetMode() const
void ImpMakeTextCursorAreaVisible()
void ImpChainingEventHdl()
void FlushComeBackTimer() const
virtual bool Undo() override
react depending on edit mode and if no more undo is possible
void HideSdrPage() override
bool IsMapModeEnabled() const
rtl::Reference< sdr::SelectionController > CreateTableController(SdrView &rView, const SdrTableObj &rObj, const rtl::Reference< sdr::SelectionController > &xRefController)
bool MouseButtonUp(const MouseEvent &)
virtual void BckAction() override
bool bTextEditOnlyOneView
std::unique_ptr< sal_uInt16[]> RemoveWhichRange(const sal_uInt16 *pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd)
static SfxItemSet CreatePaintSet(const sal_uInt16 *pRanges, SfxItemPool &rPool, const SfxItemSet &rSourceSet, const SfxItemSet &rTargetSet, bool bNoCharacterFormats, bool bNoParagraphFormats)
void SetPreChainingSel(const SdrTextObj *, ESelection const &)
constexpr sal_uInt16 XATTR_LINE_FIRST(XATTR_START)
const MapMode & GetMapMode() const
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
void ImpSetContourPolygon(SdrOutliner &rOutliner, tools::Rectangle const &rAnchorRect, bool bLineWidth) const
static const sal_uInt16 * GetFormatRangeImpl(bool bTextOnly)
const SfxBroadcaster * GetBroadcaster() const
SdrMark * GetMark(size_t nNum) const
constexpr sal_uInt16 EE_PARA_END(EE_PARA_START+18)
sal_Int32 GetParagraphCount() const
void append(std::unique_ptr< OverlayObject > pOverlayObject)
virtual OUString TakeObjNameSingul() const override
virtual SfxItemSet & GetItemSet()
void SetControlWord(EVControlBits nWord)
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
handle mouse over effects for handles
void EnableMapMode(bool bEnable=true)
virtual void BrkAction() override
virtual SdrObjKind GetObjIdentifier() const
tools::Rectangle GetBoundRect() const
constexpr sal_uInt16 SDRATTR_MISC_LAST(SDRATTR_TEXT_CHAINNEXTNAME)
virtual bool Redo() override
OutlinerView * ImpFindOutlinerView(vcl::Window const *pWin) const
virtual bool MouseButtonDown(const MouseEvent &, OutputDevice *)
css::uno::Reference< css::text::XTextCursor > createTextCursorBySelection(const ESelection &rSel)
virtual void EndTextEdit(SdrOutliner &rOutl)
virtual void MarkListHasChanged() override
virtual bool HasText() const override
std::unique_ptr< BaseProcessor2D > createProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
OutputDevice * GetRefDevice() const
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
handle mouse over effects for handles
virtual std::unique_ptr< SdrUndoAction > CreateUndoDeleteObject(SdrObject &rObject, bool bOrdNumDirect=false)
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
TextChain * GetTextChain() const
EVControlBits GetControlWord() const
sal_uInt16 GetClicks() const
Color const & GetBackgroundColor() const
void SetAttrToMarked(const SfxItemSet &rAttr, bool bReplaceAll)
const Size & GetSize() const
const SfxPoolItem * NextItem()
bool IsTextEditFrameHit(const Point &rHit) const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
virtual css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget() override
SvtScriptType GetScriptType() const
virtual css::uno::Reference< css::uno::XInterface > getUnoShape()
sal_uInt16 GetButtons() const
sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice *pOut) const
tools::Rectangle aTextEditArea
SdrPage * getSdrPageFromSdrObject() const
OUString SvxResId(const char *pId)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
OutlinerView * GetView(size_t nIndex) const
OutputDevice & GetTargetOutputDevice()
bool OutputToWindow() const
virtual bool CalcFieldValue(const SvxFieldItem &rField, sal_Int32 nPara, sal_uInt16 nPos, bool bEdit, std::optional< Color > &rpTxtColor, std::optional< Color > &rpFldColor, OUString &rRet) const
EEAnchorMode GetAnchorMode() const
bool IsMouseEvent() const
static void ApplyFormatPaintBrushToText(SfxItemSet const &rFormatSet, SdrTextObj &rTextObj, SdrText *pText, bool bNoCharacterFormats, bool bNoParagraphFormats)
helper function for selections with multiple SdrText for one SdrTextObj (f.e.
static SfxViewShell * Current()
SfxStyleSheet * GetStyleSheet() const
void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich=0)
virtual void ModelHasChanged() override
virtual void onEditOutlinerStatusEvent(EditStatus *pEditStatus)
called from the SdrObjEditView during text edit when the status of the edit outliner changes ...
SdrPageView * ShowSdrPage(SdrPage *pPage) override
const Point & GetTextEditOffset() const
SfxItemSet const & GetParaAttribs(sal_Int32 nPara)
OutputDevice * GetFirstOutputDevice() const
sal_uInt16 GetHdlSize() const
bool HasSelection() const
void SetNilChainingEvent(const SdrTextObj *, bool)
void BegMacroObj(const Point &rPnt, short nTol, SdrObject *pObj, SdrPageView *pPV, vcl::Window *pWin)
virtual SvtScriptType GetScriptType() const
virtual void SetChanged(bool bFlg=true)
SfxStyleSheet * GetStyleSheet() const
void SetAttributes(const SfxItemSet &rSet, bool bReplaceAll)
B2IRange fround(const B2DRange &rRange)
virtual Point EditViewPointerPosPixel() const override
void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &)
EditView & GetEditView() const
sal_uInt32 PaintWindowCount() const
virtual void BckAction() override
const Point & GetPos() const
IMPL_LINK_NOARG(SdrObjEditView, ImpAfterCutOrPasteChainingEventHdl, LinkParamNone *, void)
void TextEditDrawing(SdrPaintWindow &rPaintWindow)
Polyline represented by SdrPathObj.
virtual bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin)
sdr::overlay::OverlayObjectList maTEOverlayGroup
SdrObject * GetMarkedSdrObj() const
const SdrLayerIDSet & GetVisibleLayers() const
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
void SetBeginPasteOrDropHdl(const Link< PasteOrDropInfos *, void > &rLink)
const EditTextObject & GetTextObject() const
const SdrOutliner * GetTextEditOutliner() const
VclPtr< vcl::Window > pTextEditWin
virtual void MarkListHasChanged() override
void SetInputContext(const InputContext &rInputContext)
constexpr sal_uInt16 SDRATTR_GRAF_LAST(SDRATTR_GRAFCROP)
void SetText(const OutlinerParaObject &)
void SetAttribs(const SfxItemSet &)
tools::WeakReference< SdrTextObj > mxTextEditObj
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
SfxUndoManager * GetSdrUndoManager() const
void RegisterViewShell(OutlinerViewShell *pViewShell)
virtual void EditViewSelectionChange() override
void getTextSelection(css::uno::Any &rSelection)
fills the given any with a XTextCursor for the current text selection.
constexpr sal_uInt16 EE_PARA_START(EE_ITEMS_START+0)
bool IsFitToSize() const
returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false!
virtual bool BegTextEdit(SdrOutliner &rOutl)
VclPtr< vcl::Window > pMacroWin
CursorChainingEvent const & GetCursorEvent(const SdrTextObj *)
OutlinerView * ImpMakeOutlinerView(vcl::Window *pWin, OutlinerView *pGivenView, SfxViewShell *pViewShell=nullptr) const
virtual void MovAction(const Point &rPnt) override
virtual void TakeActionRect(tools::Rectangle &rRect) const override
size_t GetMarkedObjectCount() const
void MergeNotPersistAttrFromMarked(SfxItemSet &rAttr) const
virtual void EndAction() override
SdrPageView * pTextEditPV
void HandleCursorEventAfterChaining(const CursorChainingEvent aCurEvt, const ESelection &aNewSel)
virtual void MakeVisible(const tools::Rectangle &rRect, vcl::Window &rWin)
static bool SupportsFormatPaintbrush(SdrInventor nObjectInventor, sal_uInt16 nObjectIdentifier)
returns true if the shape identified by its inventor and identifier supports format paint brush opera...
virtual bool IsAction() const override
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget()
const SdrMarkList & GetMarkedObjectList() const
virtual bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
void CompleteOnlineSpelling()
bool IsTextEditHit(const Point &rHit) const
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true)
OutlineText, special text object for StarDraw.
void ActionChanged() const
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 EE_ITEMS_START(OWN_ATTR_VALUE_END+1)
CommandEventId GetCommand() const
Link< EditFieldInfo *, void > aOldCalcFieldValueLink
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
void SetCalcFieldValueHdl(const Link< EditFieldInfo *, void > &rLink)
SvtScriptType GetSelectedScriptType() const
constexpr sal_uInt16 EE_CHAR_START(EE_PARA_END+1)
void SetEndTextEditHdl(const Link< SdrUndoManager *, void > &rLink)
SdrModel & getSdrModelFromSdrObject() const
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
virtual void TakeTextAnchorRect(::tools::Rectangle &rAnchorRect) const
virtual void append(const Primitive2DReference &) override
virtual bool HasMacro() const
void SetMoveOutside(bool bOn)
constexpr sal_uInt16 SDRATTR_GRAF_FIRST(SDRATTR_NOTPERSIST_LAST+1)
const OutlinerView * GetTextEditOutlinerView() const
const vcl::Region & GetRedrawRegion() const
vcl::Cursor * GetCursor() const
virtual SdrPageView * ShowSdrPage(SdrPage *pPage)
Outliner * GetOutliner() const
bool ImpIsTextEditAllSelected() const
Size GetOutputSizePixel() const
MapUnit GetMapUnit() const
virtual bool Command(const CommandEvent &, vcl::Window *)
bool IsTopToBottom() const
bool GetNilChainingEvent(const SdrTextObj *)
virtual void AddWindowToPaintView(OutputDevice *pNewWin, vcl::Window *pWindow)
virtual SdrText * getActiveText() const
returns the currently active text.
virtual drawinglayer::primitive2d::Primitive2DContainer getOverlayObjectPrimitive2DSequence() const
constexpr sal_uInt16 EE_CHAR_END(EE_CHAR_START+32)
void ImpInvalidateOutlinerView(OutlinerView const &rOutlView) const
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
virtual void PaintMacro(OutputDevice &rOut, const tools::Rectangle &rDirtyRect, const SdrObjMacroHitRec &rRec) const
constexpr sal_uInt16 EE_FEATURE_START(EE_CHAR_END+1)
bool MouseMove(const MouseEvent &)
bool IsContourTextFrame() const
sal_uInt16 GetModifier() const
const SdrLayerIDSet * pVisiLayer
void HideCursor(bool bDeactivate=false)
size_t GetViewCount() const
virtual SfxViewShell * GetSfxViewShell() const
Get access to the view shell owning this draw view, if any.
bool getPossibleGridOffsetForSdrObject(basegfx::B2DVector &rOffset, const SdrObject *pObj, const SdrPageView *pPV) const
SfxItemPool * GetPool() const
virtual SdrObject * RemoveObject(size_t nObjNum)
const EditEngine & GetEditEngine() const
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
void SetCursorRect(const tools::Rectangle *pRect=nullptr, tools::Long nExtTextInputWidth=0)
void ImpMacroDown(const Point &rDownPos)
virtual bool MouseButtonDown(const MouseEvent &rMEvt, OutputDevice *pWin) override
virtual SdrInventor GetObjInventor() const
void RemoveAttribs(bool bRemoveParaAttribs, bool bKeepLanguages=false)
SdrTextObj * GetNextLinkInChain() const
virtual SdrLayerID GetLayer() const
virtual Degree100 GetRotateAngle() const override
const Point & GetMousePosPixel() const
sal_uInt16 GetInvalidateMore() const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
ESelection GetSelection() const
natural cubic Spline (ni)
const SdrLayerIDSet & GetLockedLayers() const
sal_uInt16 GetSelectionLevel() const
void MovMacroObj(const Point &rPnt)
bool IsSet(SdrLayerID a) const
std::unique_ptr< TextChainCursorManager > ImpHandleMotionThroughBoxesKeyInput(const KeyEvent &rKEvt, bool *bOutHandled)
void SetCursorEvent(const SdrTextObj *, CursorChainingEvent const &)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr sal_uInt16 SDRATTR_SHADOW_LAST(SDRATTR_SHADOWBLUR)
virtual SdrUndoManager * getSdrUndoManagerForEnhancedTextEdit() const
std::unique_ptr< OutlinerParaObject > CreateParaObject(sal_Int32 nStartPara=0, sal_Int32 nParaCount=EE_PARA_ALL) const
virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence()
void Broadcast(const SfxHint &rHint)
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
constexpr sal_uInt16 SDRATTR_TABLE_LAST(SDRATTR_TABLE_TEXT_ROTATION)
void SetSelection(const ESelection &)
constexpr TypedWhichId< XFillAttrSetItem > XATTRSET_FILL(XATTR_FILL_LAST+1)
void SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
OverlayObject & getOverlayObject(sal_uInt32 nIndex) const
void ImpMoveCursorAfterChainingEvent(TextChainCursorManager *pCursorManager)
virtual bool IsTextEdit() const final override
virtual void TakeTextRect(SdrOutliner &rOutliner, tools::Rectangle &rTextRect, bool bNoEditText, tools::Rectangle *pAnchorRect, bool bLineWidth=true) const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
vcl::Window * GetWindow() const
#define SAL_WARN_IF(condition, area, stream)
SdrPageView * GetTextEditPageView() const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
SdrPage * GetPage() const
void SetAnchorMode(EEAnchorMode eMode)
void SetCursor(vcl::Cursor *pCursor)
OUString ImpGetDescriptionString(const char *pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
object that represents a SdrPage
void SetEndCutPasteLinkHdl(const Link< LinkParamNone *, void > &rLink)
virtual void TakeActionRect(tools::Rectangle &rRect) const override
vcl::Cursor * pTextEditCursorBuffer
void NbcSetOutlinerParaObjectForText(std::unique_ptr< OutlinerParaObject > pTextObject, SdrText *pText)
Color GetTextEditBackgroundColor(const SdrObjEditView &rView)
#define SAL_INFO(area, stream)
OutlinerView * pTextEditOutlinerView
virtual ~SdrObjEditView() override
const SfxItemSet & GetMergedItemSet() const
virtual bool Command(const CommandEvent &rCEvt, vcl::Window *pWin) override
virtual void EditViewInvalidate(const tools::Rectangle &rRect) override
std::unique_ptr< SdrOutliner > SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel &rModel)
Create an Outliner with the engine-global default settings on the heap.
bool PostKeyEvent(const KeyEvent &rKEvt, vcl::Window const *pFrameWin=nullptr)
void SetEndPasteOrDropHdl(const Link< PasteOrDropInfos *, void > &rLink)
void SetBackgroundColor(const Color &rColor)
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
SdrPaintWindow & GetPaintWindow() const
void SetTextEditWin(vcl::Window *pWin)
SfxItemSet GetAttrFromMarked(bool bOnlyHardAttr) const
vcl::Window * GetWindow() const
const SfxStyleSheet * GetStyleSheet() const
bool isEndTextEditTriggeredFromUndo() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
void onChainingEvent()
called from the SdrObjEditView during text edit when a chain of boxes is to be updated ...
void SetOutputArea(const tools::Rectangle &rRect)
virtual void AddWindowToPaintView(OutputDevice *pNewWin, vcl::Window *pWindow) override
SfxUndoManager * mpOldTextEditUndoManager
const Point & GetPosPixel() const
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
void SetUpdateMode(bool bUpdate)
void translate(double fX, double fY)
constexpr TypedWhichId< SdrTextFixedCellHeightItem > SDRATTR_TEXT_USEFIXEDCELLHEIGHT(SDRATTR_MISC_FIRST+23)
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
SdrPageView * GetSdrPageView() const
const Link< EditFieldInfo *, void > & GetCalcFieldValueHdl() const
Universal Network Object packed into SvDraw object.
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll)
SdrObjEditView(SdrModel &rSdrModel, OutputDevice *pOut)
constexpr sal_uInt16 EE_FEATURE_END(EE_FEATURE_FIELD+0)
const sal_uInt16 * GetRanges() const
virtual sal_Int32 getTextCount() const override
returns the number of texts available for this object.
const SfxItemPool & GetItemPool() const
bool GetIsAutomaticFontColor() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
virtual bool DoMacro(const SdrObjMacroHitRec &rRec)
continuously activated OLE (PlugIn-Frame or similar)
SdrObjList * getParentSdrObjListFromSdrObject() const
OutlinerParaObject * GetOutlinerParaObject() const
void SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
virtual void OnBeginPasteOrDrop(PasteOrDropInfos *pInfo)
virtual void InvalidateOneWin(OutputDevice &rWin)
If the View should not call Invalidate() on the windows, override the following 2 methods and do some...
bool IsInvalidItem(const SfxPoolItem *pItem)
void ApplyFormatPaintBrush(SfxItemSet &rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats)
applies a format paint brush set from the current selection.
TitleText, special text object for StarDraw.
constexpr sal_uInt16 SDRATTR_MISC_FIRST(SDRATTR_CAPTION_LAST+1)
void ImpMacroUp(const Point &rUpPos)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
rtl::Reference< sdr::SelectionController > mxSelectionController
bool Command(const CommandEvent &rCEvt)
IMPL_LINK(SdrObjEditView, ImpOutlinerStatusEventHdl, EditStatus &, rEditStat, void)
periodic cubic Spline (ni)
virtual void HideSdrPage() override
foreign graphic (StarView Graphic)
SdrMarkList & GetMarkedObjectListWriteAccess()
SdrTextObj * GetPrevLinkInChain() const
SdrModel * GetModel() const
virtual void EditViewCursorRect(const tools::Rectangle &rRect, int nExtTextInputWidth) override
virtual OutlinerParaObject * GetOutlinerParaObject() const
SdrOutliner & ImpGetDrawOutliner() const
OutputDevice & GetOutputDevice() const
static bool HasTextImpl(SdrOutliner const *pOutliner)
returns false if the given pointer is NULL or if the given SdrOutliner contains no text...
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
const SdrPageView * pPageView
virtual EEAnchorMode GetOutlinerViewAnchorMode() const
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
void SetInvalidateMore(sal_uInt16 nPixel)
virtual void EndAction() override
virtual bool IsFontwork() const
const SfxPoolItem * GetCurItem() const
sal_uInt16 GetDefaultTabulator() const
virtual void MovAction(const Point &rPnt) override
void SetTextAnimationAllowed(bool bNew)
void RemoveView(OutlinerView const *pView)
virtual bool IsAction() const override
Color getHilightColor() const
void TakeFormatPaintBrush(std::shared_ptr< SfxItemSet > &rFormatSet)
returns a format paint brush set from the current selection
sal_uInt32 PageWindowCount() const
virtual OutputDevice & EditViewOutputDevice() const override
void SetWindow(vcl::Window *pWindow)
::rtl::Reference< IEventProcessor > xProcessor
bool IsEmptyPresObj() const
void Paint(const tools::Rectangle &rRect, OutputDevice *pTargetDevice=nullptr)