28#include <osl/diagnose.h>
29#include <osl/thread.h>
30#include <rtl/strbuf.hxx>
37#include <svx/strings.hrc>
56#include <LibreOfficeKit/LibreOfficeKitEnums.h>
65#include <com/sun/star/frame/XController.hpp>
66#include <com/sun/star/view/XSelectionSupplier.hpp>
68#include <boost/property_tree/json_parser.hpp>
98 mbUnmarking(bUnmarking)
108 if (xTargetOverlay.is())
111 rStartPos, rStartPos,
false));
112 xTargetOverlay->add(*pNew);
149 if (xTargetOverlay.is())
153 std::unique_ptr<sdr::overlay::OverlaySelection> pNew =
154 std::make_unique<sdr::overlay::OverlaySelection>(
156 aHighlightColor, std::vector(rSelections),
false);
158 xTargetOverlay->add(*pNew);
167 , mpMarkedObj(nullptr)
168 , mpMarkedPV(nullptr)
173 , mbDesignMode(false)
174 , mbForceFrameHandles(false)
175 , mbPlusHdlAlways(false)
176 , mbInsPolyPoint(false)
177 , mbMarkedObjRectDirty(false)
178 , mbMrkPntDirty(false)
179 , mbMarkedPointsRectsDirty(false)
180 , mbMarkHandlesHidden(false)
201 if (rHint.
GetId() == SfxHintId::ThisIsAnSdrHint)
245 pResultSelection =
nullptr;
249 if (nTotalPaintWindows == 1)
256 if (pViewShellWindow && pViewShellWindow->
IsAncestorOf(*pWin))
260 aSelection.
Move(aLogicOffset.
getX(), aLogicOffset.
getY());
270 if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
275 pResultSelection = &aSelection;
575 for (
size_t nObjNum=0; nObjNum<nObjCount; ++nObjNum) {
607 if (nMarkCount==1 && bStdDrag && bFrmHdl)
619 if (!bStdDrag && !bFrmHdl) {
624 for (
size_t nMarkNum=0; nMarkNum<nMarkCount && bFrmHdl; ++nMarkNum) {
633 for (
size_t nMarkNum=0; nMarkNum<nMarkCount && !bFrmHdl; ++nMarkNum) {
651std::u16string_view lcl_getDragMethodServiceName( std::u16string_view rCID )
653 std::u16string_view aRet;
655 size_t nIndexStart = rCID.find( u
"DragMethod=" );
656 if( nIndexStart != std::u16string_view::npos )
658 nIndexStart = rCID.find(
'=', nIndexStart );
659 if( nIndexStart != std::u16string_view::npos )
662 size_t nNextSlash = rCID.find(
'/', nIndexStart );
663 if( nNextSlash != std::u16string_view::npos )
665 sal_Int32 nIndexEnd = nNextSlash;
666 size_t nNextColon = rCID.find(
':', nIndexStart );
667 if( nNextColon == std::u16string_view::npos || nNextColon < nNextSlash )
668 nIndexEnd = nNextColon;
669 aRet = rCID.substr(nIndexStart,nIndexEnd-nIndexStart);
676std::u16string_view lcl_getDragParameterString( std::u16string_view rCID )
678 std::u16string_view aRet;
680 size_t nIndexStart = rCID.find( u
"DragParameter=" );
681 if( nIndexStart != std::u16string_view::npos )
683 nIndexStart = rCID.find(
'=', nIndexStart );
684 if( nIndexStart != std::u16string_view::npos )
687 size_t nNextSlash = rCID.find(
'/', nIndexStart );
688 if( nNextSlash != std::u16string_view::npos )
690 sal_Int32 nIndexEnd = nNextSlash;
691 size_t nNextColon = rCID.find(
':', nIndexStart );
692 if( nNextColon == std::u16string_view::npos || nNextColon < nNextSlash )
693 nIndexEnd = nNextColon;
694 aRet = rCID.substr(nIndexStart,nIndexEnd-nIndexStart);
708 bool bConvertUnit =
false;
709 if (pOutDev->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
715 boost::property_tree::ptree elements;
716 for (
size_t nObjNum = 0; nObjNum < nObjCount; ++nObjNum)
724 bool VertexObject = !(pGPL && pGPL->
GetCount());
726 boost::property_tree::ptree object;
727 boost::property_tree::ptree points;
730 boost::property_tree::ptree node;
731 boost::property_tree::ptree
point;
740 node.add_child(
"point",
point);
741 points.push_back(std::make_pair(
"", node));
752 boost::property_tree::ptree gridOffset;
753 gridOffset.put(
"x", nSignX *
p.getX());
754 gridOffset.put(
"y",
p.getY());
755 object.add_child(
"gridoffset", gridOffset);
758 object.add_child(
"gluepoints", points);
759 elements.push_back(std::make_pair(
"",
object));
762 rTree.add_child(
"shapes", elements);
773 bool bIsChart =
false;
774 Point addLogicOffset(0, 0);
775 bool convertMapMode =
false;
779 if (nTotalPaintWindows == 1)
787 if (pViewShellWindow && pViewShellWindow->
IsAncestorOf(*pWin))
799 addLogicOffset = aLogicOffset;
800 aSelection.
Move(aLogicOffset.
getX(), aLogicOffset.
getY());
813 if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
816 convertMapMode =
true;
826 OStringBuffer aExtraInfo;
827 OString sSelectionText;
828 OString sSelectionTextView;
829 boost::property_tree::ptree aTableJsonTree;
830 boost::property_tree::ptree aGluePointsTree;
832 bool bTableSelection =
false;
833 bool bConnectorSelection =
false;
854 OString handleArrayStr;
856 aExtraInfo.append(
"{\"id\":\""
857 + OString::number(
reinterpret_cast<sal_IntPtr
>(pO))
875 aExtraInfo.append(
",\"gridOffsetX\":"
876 + OString::number(nSignX *
p.getX())
877 +
",\"gridOffsetY\":"
878 + OString::number(
p.getY()));
883 aExtraInfo.append(
", \"isWriterGraphic\": true");
888 css::uno::Reference<css::frame::XController>& xChartController = aChartHelper.
GetXController();
889 css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier( xChartController, uno::UNO_QUERY);
890 if (xSelectionSupplier.is())
892 uno::Any aSel = xSelectionSupplier->getSelection();
896 OString aObjectCID(aValue.getStr(), aValue.getLength(), osl_getThreadTextEncoding());
897 const std::vector<OString> aProps{
"Draggable",
"Resizable",
"Rotatable"};
898 for (
const auto& rProp: aProps)
900 sal_Int32
nPos = aObjectCID.indexOf(rProp);
901 if (
nPos == -1)
continue;
902 nPos += rProp.getLength() + 1;
903 if (aExtraInfo.getLength() > 2)
904 aExtraInfo.append(
", ");
905 aExtraInfo.append(
"\"is" + rProp +
"\": "
906 + OString::boolean(aObjectCID[
nPos] ==
'1'));
909 std::u16string_view sDragMethod = lcl_getDragMethodServiceName(aValue);
910 if (sDragMethod ==
u"PieSegmentDragging")
915 std::u16string_view sDragParameters = lcl_getDragParameterString(aValue);
916 if (!sDragParameters.empty())
918 aExtraInfo.append(
", \"dragInfo\": { "
920 + OUString(sDragMethod).toUtf8()
923 sal_Int32 nStartIndex = 0;
924 std::array<int, 5> aDragParameters;
925 for (
auto& rParam : aDragParameters)
927 std::u16string_view sParam =
o3tl::getToken(sDragParameters, 0,
',', nStartIndex);
934 if (aDragParameters[0] < 0)
935 aDragParameters[0] = 0;
936 else if (aDragParameters[0] > 100)
937 aDragParameters[0] = 100;
939 aExtraInfo.append(
", \"initialOffset\": "
940 + OString::number(
static_cast<sal_Int32
>(aDragParameters[0])));
943 Point aMinPos(aDragParameters[1], aDragParameters[2]);
944 Point aMaxPos(aDragParameters[3], aDragParameters[4]);
945 Point aDragDirection = aMaxPos - aMinPos;
948 aExtraInfo.append(
", \"dragDirection\": ["
956 if (aPolyPolygon.
count() == 1)
959 if (sal_uInt32 nPolySize = aPolygon.
count())
964 if (pWin && pViewShellWindow && pViewShellWindow->
IsAncestorOf(*pWin))
971 OString sPolygonElem(
"<polygon points=\\\"");
978 aPoint.
setX(-aPoint.
X());
983 sPolygonElem += R
"elem(\" style=\"stroke: none; fill: rgb(114,159,207); fill-opacity: 0.8\"/>)elem";
985 OString sSVGElem = R"elem(<svg version=\"1.2\" width=\")elem" +
986 OString::number(aSelection.GetWidth() / 100.0) +
987 R"elem(mm\" height=\")elem" +
988 OString::number(aSelection.GetHeight() / 100.0) +
989 R"elem(mm\" viewBox=\")elem" +
991 R"elem(\" preserveAspectRatio=\"xMidYMid\" xmlns=\"http://www.w3.org/2000/svg\">)elem";
993 aExtraInfo.append(", \"svg\": \""
1003 aExtraInfo.append(
"}");
1011 boost::property_tree::ptree responseJSON;
1012 boost::property_tree::ptree others;
1013 boost::property_tree::ptree
anchor;
1015 boost::property_tree::ptree poly;
1016 boost::property_tree::ptree custom;
1017 boost::property_tree::ptree nodes;
1021 boost::property_tree::ptree child;
1022 boost::property_tree::ptree
point;
1023 sal_Int32 kind =
static_cast<sal_Int32
>(pHdl->
GetKind());
1025 child.put(
"kind", kind);
1026 child.put(
"pointer",
static_cast<sal_Int32
>(pHdl->
GetPointer()));
1028 pHdlPos.
Move(addLogicOffset.
getX(), addLogicOffset.
getY());
1035 child.add_child(
"point",
point);
1036 const auto node = std::make_pair(
"", child);
1037 boost::property_tree::ptree* selectedNode =
nullptr;
1044 selectedNode = &poly;
1048 selectedNode = &custom;
1056 selectedNode = &others;
1060 selectedNode = &others;
1062 std::string sKind = std::to_string(kind);
1063 boost::optional< boost::property_tree::ptree& > kindNode = selectedNode->get_child_optional(sKind.c_str());
1066 boost::property_tree::ptree newChild;
1067 newChild.push_back(node);
1068 selectedNode->add_child(sKind.c_str(), newChild);
1071 kindNode.get().push_back(node);
1073 nodes.add_child(
"rectangle",
rectangle);
1074 nodes.add_child(
"poly", poly);
1075 nodes.add_child(
"custom", custom);
1076 nodes.add_child(
"anchor",
anchor);
1077 nodes.add_child(
"others", others);
1078 responseJSON.add_child(
"kinds", nodes);
1079 std::stringstream aStream;
1080 boost::property_tree::write_json(aStream, responseJSON,
false);
1081 handleArrayStr =
", \"handles\":";
1082 handleArrayStr = handleArrayStr + aStream.str().c_str();
1083 if (bConnectorSelection)
1086 boost::property_tree::write_json(aStream, aGluePointsTree,
false);
1087 handleArrayStr = handleArrayStr +
", \"GluePoints\":";
1088 handleArrayStr = handleArrayStr + aStream.str().c_str();
1098 sSelectionText = aNegatedRect.
toString() +
1099 ", " + OString::number(nRotAngle.
get());
1103 sSelectionText = aSelection.
toString() +
1104 ", " + OString::number(nRotAngle.
get());
1107 if (!aExtraInfo.isEmpty())
1109 sSelectionTextView = sSelectionText +
", " + aExtraInfo +
"}";
1111 if (bMediaObj && pOtherShell ==
nullptr)
1117 aExtraInfo.append(
", \"url\": \"" + mediaObj->
getTempURL().toUtf8() +
"\"");
1120 aExtraInfo.append(handleArrayStr
1122 sSelectionText +=
", " + aExtraInfo;
1126 if (sSelectionText.isEmpty())
1128 sSelectionText =
"EMPTY";
1129 sSelectionTextView =
"EMPTY";
1131 pViewShell->
NotifyOtherViews(LOK_CALLBACK_TEXT_VIEW_SELECTION,
"selection", OString());
1134 if (bTableSelection)
1136 boost::property_tree::ptree aTableRectangle;
1137 aTableRectangle.put(
"x", aSelection.
Left());
1138 aTableRectangle.put(
"y", aSelection.
Top());
1139 aTableRectangle.put(
"width", aSelection.
GetWidth());
1140 aTableRectangle.put(
"height", aSelection.
GetHeight());
1141 aTableJsonTree.push_back(std::make_pair(
"rectangle", aTableRectangle));
1143 std::stringstream aStream;
1144 boost::property_tree::write_json(aStream, aTableJsonTree);
1156 if (pViewShell != pOtherShell)
1174 bool bSaveOldFocus(
false);
1175 sal_uInt32 nSavePolyNum(0), nSavePointNum(0);
1182 && pSaveOldFocusHdl->
GetObj()
1186 bSaveOldFocus =
true;
1187 nSavePolyNum = pSaveOldFocusHdl->
GetPolyNum();
1189 pSaveObj = pSaveOldFocusHdl->
GetObj();
1190 eSaveKind = pSaveOldFocusHdl->
GetKind();
1209 bool bSingleTextObjMark=
false;
1210 bool bLimitedRotation(
false);
1218 bSingleTextObjMark =
1233 for (
size_t nMarkNum=0; nMarkNum<nMarkCount && (
mpMarkedPV!=
nullptr || !bFrmHdl); ++nMarkNum)
1263 if (!bTiledRendering)
1291 if( bSingleTextObjMark )
1297 const bool bWdt0(aRect.
Left() == aRect.
Right());
1298 const bool bHgt0(aRect.
Top() == aRect.
Bottom());
1304 else if (!bStdDrag && (bWdt0 || bHgt0))
1311 if (!bWdt0 && !bHgt0)
1316 if (!bLimitedRotation && !bHgt0)
1321 if (!bWdt0 && !bHgt0)
1326 if (!bLimitedRotation && !bWdt0)
1332 if (!bWdt0 && !bHgt0)
1337 if (!bLimitedRotation && !bHgt0)
1342 if (!bWdt0 && !bHgt0)
1362 for (
size_t i=nSiz0;
i<nSiz1; ++
i)
1386 for (
size_t i=nSiz0;
i<nSiz1; ++
i)
1399 for (
size_t nMarkNum=0; nMarkNum<nMarkCount; ++nMarkNum)
1409 for (
size_t i=nSiz0;
i<nSiz1; ++
i)
1418 bool bSelected= rMrkPnts.
find( sal_uInt16(
i-nSiz0) ) != rMrkPnts.
end();
1425 for (sal_uInt32 nPlusNum=0; nPlusNum<nPlusHdlCnt; nPlusNum++)
1441 for (
size_t nMarkNum=0; nMarkNum<nMarkCount; ++nMarkNum)
1451 for (sal_uInt16
nId : rMrkGlue)
1460 pGlueHdl->SetObj(pObj);
1461 pGlueHdl->SetPageView(pPV);
1462 pGlueHdl->SetObjHdlNum(
nId);
1469 if(!bLimitedRotation)
1481 if (bTiledRendering && pViewShell)
1495 && pCandidate->
GetObj() == pSaveObj
1496 && pCandidate->
GetKind() == eSaveKind
1542 pHdl1->SetObjHdlNum(1);
1543 pHdl2->SetObjHdlNum(2);
1544 pHdl3->SetObjHdlNum(3);
1582 aNewSet.
Put(aNewItem);
1598 std::unique_ptr<SdrHdlGradient> pGradHdl(
new SdrHdlGradient(aTmpPos1, aTmpPos2,
false));
1599 DBG_ASSERT(pColHdl1 && pColHdl2 && pGradHdl,
"Could not get all necessary handles!");
1602 pGradHdl->SetColorHandles(pColHdl1.get(), pColHdl2.get());
1603 pGradHdl->SetObj(pObj);
1624 if(eFillStyle == drawing::FillStyle_GRADIENT)
1629 Size aHdlSize(15, 15);
1637 std::unique_ptr<SdrHdlColor> pColHdl1(
new SdrHdlColor(aTmpPos1, aGradTransVector.
aCol1, aHdlSize,
false));
1638 std::unique_ptr<SdrHdlColor> pColHdl2(
new SdrHdlColor(aTmpPos2, aGradTransVector.
aCol2, aHdlSize,
false));
1639 std::unique_ptr<SdrHdlGradient> pGradHdl(
new SdrHdlGradient(aTmpPos1, aTmpPos2,
true));
1640 DBG_ASSERT(pColHdl1 && pColHdl2 && pGradHdl,
"Could not get all necessary handles!");
1643 pGradHdl->SetColorHandles(pColHdl1.get(), pColHdl2.get());
1644 pGradHdl->SetObj(pObj);
1670 SdrHdl* pMouseOverHdl =
nullptr;
1680 for(
size_t nHdl = 0; nHdl < nHdlCount; ++nHdl)
1685 if( pCurrentHdl != pMouseOverHdl )
1710 for (
size_t nHdl = 0; nHdl < nHdlCount; ++nHdl)
1744 if (
pOut!=
nullptr) {
1746 nMinLen=
pOut->PixelToLogic(
Size(0,50)).Height();
1748 nObjDst=
pOut->PixelToLogic(
Size(0,20)).Height();
1752 nOutMin=-
pOut->GetMapMode().GetOrigin().Y();
1753 nOutMax=
pOut->GetOutputSize().Height()-1+nOutMin;
1757 if (nOutMax-nOutMin<nDst) {
1760 nOutMin-=(nDst+1)/2;
1761 nOutMax=nOutMin+nDst;
1763 nOutHgt=nOutMax-nOutMin;
1766 if (nTemp>nMinLen) nMinLen=nTemp;
1773 if (nHgt<nMinLen) nHgt=nMinLen;
1778 if (
pOut!=
nullptr && nMinLen>nOutHgt) nMinLen=nOutHgt;
1780 if (
pOut!=
nullptr) {
1783 if (nY2<nY1+nMinLen) nY2=nY1+nMinLen;
1787 if (nY1>nY2-nMinLen) nY1=nY2-nMinLen;
1894 bool bEdge0=
static_cast<SdrCreateView*
>(
this)->IsEdgeTool();
1898 bool bEdge1=
static_cast<SdrCreateView*
>(
this)->IsEdgeTool();
1947 SdrObject* pObj =
PickObj(rPnt,
static_cast<sal_uInt16
>(nTol), pPV, nOptions);
1952 return pObj !=
nullptr;
1966 size_t nChgMarkNum = SAL_MAX_SIZE;
1967 size_t nSearchObjNum = bPrev ? 0 : SAL_MAX_SIZE;
1968 if (nMarkCount!=0) {
1969 nChgMarkNum=bPrev ? 0 : nMarkCount-1;
1971 OSL_ASSERT(pM!=
nullptr);
1978 const size_t nObjCount = pSearchObjList->
GetObjCount();
1980 if (nSearchObjNum>nObjCount) nSearchObjNum=nObjCount;
1981 while (pMarkObj==
nullptr && ((!bPrev && nSearchObjNum>0) || (bPrev && nSearchObjNum<nObjCount)))
1990 pMarkObj=pSearchObj;
1993 if (bPrev) nSearchObjNum++;
2002 if (nChgMarkNum!=SAL_MAX_SIZE)
2016 size_t nTopMarkHit=0;
2017 size_t nBtmMarkHit=0;
2020 for (
size_t nm=nMarkCount; nm>0 && pTopMarkHit==
nullptr;) {
2030 if (pTopMarkHit==
nullptr)
return MarkObj(rPnt,sal_uInt16(nTol));
2037 for (
size_t nm=0; nm<nMarkCount && pBtmMarkHit==
nullptr; ++nm) {
2046 if (pBtmMarkHit==
nullptr) { pBtmMarkHit=pTopMarkHit; nBtmMarkHit=nTopMarkHit; }
2050 size_t nSearchBeg(0);
2052 SdrObject* pObjHit(bPrev ? pBtmObjHit : pTopObjHit);
2058 bRemap =
nullptr != pScene;
2063 sal_uInt32 nOrdNumBtm(pBtmObjHit->
GetOrdNum());
2070 nSearchBeg = nOrdNumBtm + 1;
2074 sal_uInt32 nOrdNumTop(pTopObjHit->
GetOrdNum());
2081 nSearchBeg = nOrdNumTop;
2084 size_t no=nSearchBeg;
2086 while (pFndObj==
nullptr && ((!bPrev && no>0) || (bPrev && no<nObjCount))) {
2096 pObj = pObjList->
GetObj(no);
2109 if (pFndObj!=
nullptr)
2116 return pFndObj!=
nullptr;
2132 for (
size_t nO=0; nO<nObjCount; ++nO) {
2144 if (
nPos!=SAL_MAX_SIZE)
2162void collectUIInformation(
const SdrObject* pObj)
2165 aDescription.
aAction =
"SELECT";
2166 aDescription.
aParent =
"MainWindow";
2167 aDescription.
aKeyWord =
"CurrentApp";
2169 if (!pObj->
GetName().isEmpty())
2180 std::vector<basegfx::B2DRectangle> && rSubSelections)
2182 if (!(pObj!=
nullptr && pPV!=
nullptr &&
IsObjMarkable(pObj, pPV)))
2189 collectUIInformation(pObj);
2194 if (
nPos!=SAL_MAX_SIZE)
2202 if (!bDoNoSetMarkHdl) {
2232 if(
nullptr == pObj ||
nullptr == pPV)
2239 if(
nullptr == pOutputDevice)
2246 if(
nullptr == pSdrPageWindow)
2278 if(
nullptr == pOutputDevice)
2285 if(
nullptr == pSdrPageWindow)
2311 const bool bOLE(
dynamic_cast< const SdrOle2Obj*
>(pObj) !=
nullptr);
2313 const bool bTXT(pTextObj && pTextObj->IsTextFrame());
2330 if(bOLE || bTXT || pObj==
static_cast<const SdrObjEditView*
>(
this)->GetTextEditObject())
2352 if (
auto pVirtObj =
dynamic_cast<const SdrVirtObj*
>( pObj) )
2354 Point aOffset = pVirtObj->GetOffset();
2355 aPnt.
Move( -aOffset.
X(), -aOffset.
Y() );
2370 if (!bDeep && pRet!=
nullptr)
2380 return (*this).CheckSingleSdrObjectHit(rPnt,nTol,pOL,pPV,nOptions,pMVisLay,rpRootObj,
nullptr);
2390 size_t nObjNum(nObjCount);
2392 while (pRet==
nullptr && nObjNum>0)
2403 pObj = pOL->
GetObj(nObjNum);
2407 if (pMarkList!=
nullptr)
2409 if ((*pMarkList).FindObject(pObj)!=SAL_MAX_SIZE)
2416 if (pRet!=
nullptr) rpRootObj=pObj;
2423 return PickObj(rPnt, nTol, rpPV, nOptions,
nullptr);
2429 if (ppRootObj!=
nullptr) *ppRootObj=
nullptr;
2430 if (pbHitPassDirect!=
nullptr) *pbHitPassDirect=
true;
2442 if (
static_cast<const SdrObjEditView*
>(
this)->IsTextEditFrameHit(rPnt)) {
2443 pObj=
static_cast<const SdrObjEditView*
>(
this)->GetTextEditObject();
2445 pPV=
static_cast<const SdrObjEditView*
>(
this)->GetTextEditPageView();
2449 size_t nMrkNum=nMrkCnt;
2450 while (pHitObj==
nullptr && nMrkNum>0) {
2465 sal_uInt16 nPgCount=1;
2472 bool bExtraPassForWholePage=bWholePage && pPage!=pPV->
GetObjList();
2473 if (bExtraPassForWholePage) nPgCount++;
2474 sal_uInt16 nPgNum=nPgCount;
2475 while (pHitObj==
nullptr && nPgNum>0) {
2480 if (pbHitPassDirect!=
nullptr) *pbHitPassDirect =
true;
2481 if (nPgNum>=nPgCount-1 || (bExtraPassForWholePage && nPgNum>=nPgCount-2))
2484 if (bExtraPassForWholePage && nPgNum==nPgCount-2) {
2486 if (pbHitPassDirect!=
nullptr) *pbHitPassDirect =
false;
2494 pObjList = &rMasterPage;
2496 if (pbHitPassDirect!=
nullptr) *pbHitPassDirect =
false;
2503 if (pHitObj!=
nullptr) {
2504 if (ppRootObj!=
nullptr) *ppRootObj=pObj;
2519 if (pObj!=
nullptr) {
2534 for (
size_t nMarkNum=nMarkCount; nMarkNum>0;) {
2545 if (bBoundCheckOn2ndPass) {
2546 for (
size_t nMarkNum=nMarkCount; nMarkNum>0;) {
2629 if (aRect.
IsEmpty()) aRect=aR1;
2630 else aRect.
Union(aR1);
2647 if (aRect.
IsEmpty()) aRect=aR1;
2648 else aRect.
Union(aR1);
2658 OUString sStr =
SvxResId(pStrCacheID);
2659 const sal_Int32
nPos = sStr.indexOf(
"%1");
2677 return sStr.replaceFirst(
"%2",
"0");
2715 bool bOneEdgeMarked=
false;
basegfx::B2DPoint maSecondPosition
static bool GetLayoutRTL()
sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const
basegfx::BGradient aGradient
basegfx::B2DPoint maPositionA
basegfx::B2DPoint maPositionB
void SetSecondPosition(const basegfx::B2DPoint &rNewPosition)
ImplMarkingOverlay(const SdrPaintView &rView, const basegfx::B2DPoint &rStartPos, bool bUnmarking)
sdr::overlay::OverlayObjectList maObjects
basegfx::B2DPoint maSecondPosition
css::uno::Reference< css::frame::XController > & GetXController()
sdr::overlay::OverlayObjectList maObjects
MarkingSubSelectionOverlay(const SdrPaintView &rView, std::vector< basegfx::B2DRectangle > const &rSelections)
bool IsLeaveWindow() const
const Point & GetPosPixel() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
OutDevType GetOutDevType() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void Move(tools::Long nHorzMove, tools::Long nVertMove)
TOOLS_DLLPUBLIC rtl::OString toString() const
void setY(tools::Long nY)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
void NextMove(const Point &rPnt)
const Point & GetStart() const
bool CheckMinMoved(const Point &rPnt)
const Point & GetNow() const
void SetMinMove(sal_uInt16 nDist)
bool IsInsObjPoint() const
sal_uInt16 FindGluePoint(sal_uInt16 nId) const
sal_uInt16 GetCount() const
Point GetAbsolutePos(const SdrObject &rObj) const
void SetDistortShear(bool bOn)
void SetFocusHdl(SdrHdl *pNew)
void MoveTo(SdrHdlList &rOther)
size_t GetHdlCount() const
void SetHdlSize(sal_uInt16 nSiz)
sal_uInt16 GetHdlSize() const
void SetRotateShear(bool bOn)
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
SdrHdl * IsHdlListHit(const Point &rPnt) const
SdrHdl * GetFocusHdl() const
SdrHdl * GetHdl(size_t nNum) const
void SetMoveOutside(bool bOn)
void SetSelected(bool bJa=true)
virtual void onHelpRequest()
is called when help is requested for the area of this handle
SdrHdlKind GetKind() const
sal_uInt32 GetObjHdlNum() const
virtual void onMouseEnter(const MouseEvent &rMEvt)
is called when the mouse enters the area of this handle.
void SetPos(const Point &rPnt)
virtual PointerStyle GetPointer() const
sal_uInt32 GetPolyNum() const
void SetPlusHdl(bool bOn)
SdrObject * GetObj() const
void SetObj(SdrObject *pNewObj)
virtual void onMouseLeave()
is called when the mouse leaves the area of this handle.
const Point & GetPos() const
sal_uInt32 GetPointNum() const
void SetObjHdlNum(sal_uInt32 nNum)
void SetPageView(SdrPageView *pNewPV)
SdrHintKind GetKind() const
bool IsSet(SdrLayerID a) const
bool TakeBoundRect(SdrPageView const *pPageView, tools::Rectangle &rRect) const
bool DeletePageView(const SdrPageView &rPV)
void InsertEntry(const SdrMark &rMark, bool bChkSort=true)
void DeleteMark(size_t nNum)
void SetDragMode(SdrDragMode eMode)
std::unique_ptr< ImplMarkingOverlay > mpMarkGluePointsOverlay
static constexpr sal_uInt16 mnFrameHandlesLimit
virtual SfxViewShell * GetSfxViewShell() const
Get access to the view shell owning this draw view, if any.
SdrHdl * PickHandle(const Point &rPnt) const
virtual void SetMarkHandles(SfxViewShell *pOtherShell)
OUString ImpGetDescriptionString(TranslateId pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const
void SetMarkHandlesForLOKit(tools::Rectangle const &rRect, const SfxViewShell *pOtherShell)
bool IsObjMarked(SdrObject const *pObj) const
bool IsMarkPoints() const
tools::Rectangle GetMarkedObjBoundRect() const
void MovMarkObj(const Point &rPnt)
bool ImpIsFrameHandles() const
const SdrMarkList & GetMarkedObjectList() const
bool IsMarkedObjHit(const Point &rPnt, short nTol=-2) const
void AddDragModeHdl(SdrDragMode eMode)
void modelHasChangedLOKit()
bool AreObjectsMarked() const
void SortMarkedObjects() const
virtual void EndAction() override
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
std::unique_ptr< ImplMarkingOverlay > mpMarkPointsOverlay
virtual SdrObject * CheckSingleSdrObjectHit(const Point &rPnt, sal_uInt16 nTol, SdrObject *pObj, SdrPageView *pPV, SdrSearchOptions nOptions, const SdrLayerIDSet *pMVisLay) const
bool BegMarkGluePoints(const Point &rPnt, bool bUnmark=false)
OUString const & GetDescriptionOfMarkedPoints() const
bool BegMarkPoints(const Point &rPnt, bool bUnmark=false)
std::unique_ptr< MarkingSubSelectionOverlay > mpMarkingSubSelectionOverlay
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
bool mbMarkedPointsRectsDirty
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
SdrMarkList & GetMarkedObjectListWriteAccess()
virtual bool IsAction() const override
void SetRef1(const Point &rPt)
bool IsMarkGluePoints() const
size_t GetMarkedObjectCount() const
virtual void ClearPageView() override
std::unique_ptr< ImplMarkingOverlay > mpMarkObjOverlay
void SetMoveOutside(bool bOn)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
bool MarkableObjectsExceed(int n) const
virtual void BckAction() override
tools::Rectangle maMarkedObjRect
SdrMark * GetSdrMarkByIndex(size_t nNum) const
SdrMarkView(SdrModel &rSdrModel, OutputDevice *pOut)
virtual void MovAction(const Point &rPnt) override
sal_uInt16 GetMarkHdlSizePixel() const
virtual void HideSdrPage() override
virtual void ModelHasChanged() override
void UndirtyMrkPnt() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
void MovMarkPoints(const Point &rPnt)
OUString const & GetDescriptionOfMarkedObjects() const
virtual void BrkAction() override
void SetDesignMode(bool bOn=true)
bool getPossibleGridOffsetForPosition(basegfx::B2DVector &rOffset, const basegfx::B2DPoint &rPoint, const SdrPageView *pPV) const
virtual ~SdrMarkView() override
virtual bool HasMarkablePoints() const
void MarkAllObj(SdrPageView *pPV=nullptr)
void SetMarkHdlSizePixel(sal_uInt16 nSiz)
virtual void MarkListHasChanged()
SdrViewEditMode meEditMode
std::vector< basegfx::B2DRectangle > maSubSelectionList
bool getPossibleGridOffsetForSdrObject(basegfx::B2DVector &rOffset, const SdrObject *pObj, const SdrPageView *pPV) const
SdrPageView * GetSdrPageViewOfMarkedByIndex(size_t nNum) const
const tools::Rectangle & GetMarkedObjRect() const
void MovMarkGluePoints(const Point &rPnt)
size_t TryToFindMarkedObject(const SdrObject *pObj) const
bool HasMarkableGluePoints() const
void SetRef2(const Point &rPt)
bool UnmarkAllGluePoints()
SdrViewEditMode meEditMode0
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
bool PickMarkedObj(const Point &rPnt, SdrObject *&rpObj, SdrPageView *&rpPV, SdrSearchOptions nOptions) const
bool MarkGluePoints(const tools::Rectangle *pRect, bool bUnmark)
SdrHdl * GetHdl(size_t nHdlNum) const
virtual bool RequestHelp(const HelpEvent &rHEvt) override
void SetFrameHandles(bool bOn)
bool mbMarkedObjRectDirty
bool areMarkHandlesHidden() const
bool IsGluePointEditMode() const
virtual bool MarkPoints(const tools::Rectangle *pRect, bool bUnmark)
virtual void TakeActionRect(tools::Rectangle &rRect) const override
virtual void AddCustomHdl()
sdr::ViewSelection maSdrViewSelection
bool IsObjMarkable(SdrObject const *pObj, SdrPageView const *pPV) const
bool MarkNextObj(bool bPrev=false)
virtual bool MouseMove(const MouseEvent &rMEvt, OutputDevice *pWin) override
handle mouse over effects for handles
void SetEditMode(SdrViewEditMode eMode)
bool dumpGluePointsToJSON(boost::property_tree::ptree &rTree)
OUString const & GetDescriptionOfMarkedGluePoints() const
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
Everything a View needs to know about a selected object.
SdrPageView * GetPageView() const
SdrObject * GetMarkedSdrObj() const
const SdrUShortCont & GetMarkedGluePoints() const
const SdrUShortCont & GetMarkedPoints() const
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
const SfxItemPool & GetItemPool() const
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
bool IsUndoEnabled() const
returns true if undo is currently enabled This returns false if undo was disabled using EnableUndo( f...
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
SdrObject * GetObjectForNavigationPosition(const sal_uInt32 nNavigationPosition) const
Return the object for the given navigation position.
virtual SdrObject * getSdrObjectFromSdrObjList() const
const SdrPageView * pPageView
const SdrLayerIDSet * pVisiLayer
virtual Degree100 GetRotateAngle() const
virtual basegfx::B2DPolyPolygon TakeXorPoly() const
The Xor-Polygon is required by the View to drag the object.
virtual SdrInventor GetObjInventor() const
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
virtual SdrObjList * GetSubList() const
virtual bool IsPolyObj() const
virtual bool HasLimitedRotation() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
SdrObjList * getParentSdrObjListFromSdrObject() const
virtual const tools::Rectangle & GetSnapRect() const
virtual const OUString & GetName() const
virtual bool HasTextEdit() const
bool IsGroupObject() const
sdr::contact::ViewContact & GetViewContact() const
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
virtual SdrObjKind GetObjIdentifier() const
sal_uInt32 GetNavigationPosition() const
virtual const SdrGluePointList * GetGluePointList() const
const SfxItemSet & GetMergedItemSet() const
bool IsMacroHit(const SdrObjMacroHitRec &rRec) const
SdrObject * getParentSdrObjectFromSdrObject() const
bool IsMarkProtect() const
virtual SdrLayerID GetLayer() const
virtual void AddToHdlList(SdrHdlList &rHdlList) const
virtual bool hasSpecialDrag() const
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
virtual void addCropHandles(SdrHdlList &rTarget) const
bool IsNotVisibleAsMaster() const
virtual bool HasMacro() const
virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const
virtual void AddToPlusHdlList(SdrHdlList &rHdlList, SdrHdl &rHdl) const
virtual const tools::Rectangle & GetLogicRect() const
bool isInplaceActive() const
void SetDesignMode(bool _bDesignMode) const
Sets all elements in the view which support a design and an alive mode into the given mode.
const SdrLayerIDSet & GetVisibleLayers() const
bool IsObjMarkable(SdrObject const *pObj) const
At least one member must be visible for the Group object and it must not be locked.
SdrObjList * GetObjList() const
Return current List.
void SetHasMarkedObj(bool bOn)
const tools::Rectangle & MarkBound() const
const SdrLayerIDSet & GetLockedLayers() const
const tools::Rectangle & MarkSnap() const
SdrPage * GetPage() const
SdrPageWindow * FindPageWindow(const SdrPaintWindow &rPaintWindow) const
bool EnterGroup(SdrObject *pObj)
Entering (editing) an object group After that, we have direct access to all member objects of the gro...
const sdr::contact::ObjectContact & GetObjectContact() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
SdrPage & TRG_GetMasterPage() const
bool TRG_HasMasterPage() const
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
void ImpSetGlueVisible4(bool bOn)
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
OutputDevice * GetFirstOutputDevice() const
virtual void ClearPageView()
virtual bool RequestHelp(const HelpEvent &)
virtual bool MouseMove(const MouseEvent &, OutputDevice *)
virtual bool IsTextEdit() const
SdrModel & getSdrModelFromSdrView() const
sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice *pOut) const
sal_uInt32 PaintWindowCount() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual void HideSdrPage()
void ImpSetGlueVisible3(bool bOn)
SdrPageView * GetSdrPageView() const
SdrModel & GetModel() const
void FlushComeBackTimer() const
virtual void ModelHasChanged()
void ImpSetGlueVisible2(bool bOn)
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
virtual bool IsAction() const override
virtual void TakeActionRect(tools::Rectangle &rRect) const override
virtual void EndAction() override
virtual void BrkAction() override
virtual void BckAction() override
virtual void MovAction(const Point &rPnt) override
bool IsInEditMode() const
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
FIXME: The virtual object is not yet fully implemented and tested.
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
static void notifyInvalidation(SfxViewShell const *pThisView, tools::Rectangle const *)
static void notifyOtherView(const SfxViewShell *pThisView, SfxViewShell const *pOtherView, int nType, std::string_view rKey, const OString &rPayload)
static void notifyOtherViews(const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload)
virtual vcl::Window * GetEditWindowForActiveOLEObj() const override
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
void NotifyOtherViews(int nType, const OString &rKey, const OString &rPayload) override
constexpr tools::Long Width() const
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
void SetEnabled(bool bEnable)
void SetGradientValue(const basegfx::BGradient &rNew)
const basegfx::BGradient & GetGradientValue() const
B2DPolygon const & getB2DPolygon(sal_uInt32 nIndex) const
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
void SetEndIntens(sal_uInt16 nNewIntens)
void SetStartIntens(sal_uInt16 nNewIntens)
const_iterator find(const Value &x) const
const_iterator end() const
void append(std::unique_ptr< OverlayObject > pOverlayObject)
OverlayObject & getOverlayObject(sal_uInt32 nIndex) const
void setSecondPosition(const basegfx::B2DPoint &rNew)
bool createTableEdgesJson(boost::property_tree::ptree &rJsonRoot)
tools::Long GetOutOffXPixel() const
Point GetOffsetPixelFrom(const vcl::Window &rWindow) const
virtual bool IsChart() const
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
bool IsAncestorOf(const vcl::Window &rWindow) const
#define DBG_ASSERT(sCon, aError)
OUString SvxResId(TranslateId aId)
#define LINK(Instance, Class, Member)
B2IRange fround(const B2DRange &rRange)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, const basegfx::B2DVector &rHitTolerance, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer)
std::map< OUString, OUString > aParameters
UNDERLYING_TYPE get() const
#define SDRGLUEPOINT_NOTFOUND
#define SDR_HANDLE_COLOR_SIZE_NORMAL
ImpGetDescriptionOptions
options for ImpGetDescriptionString()
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
E3dScene * DynCastE3dScene(SdrObject *pObj)
@ Measure
object that represents a SdrPage
@ Caption
connector object
@ PathFill
open Bezier-curve
@ CustomShape
Universal Network Object packed into SvDraw object.
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)