21 #include <com/sun/star/embed/Aspects.hpp>
26 #include <com/sun/star/drawing/XShape.hpp>
61 #include <drawdoc.hxx>
73 #include <com/sun/star/i18n/XBreakIterator.hpp>
74 #include <com/sun/star/lang/XServiceInfo.hpp>
82 #include <com/sun/star/beans/XPropertySet.hpp>
83 #include <com/sun/star/form/XFormComponent.hpp>
88 #include <sfx2/sfxsids.hrc>
97 using ::editeng::SvxBorderLine;
101 using ::com::sun::star::beans::XPropertySet;
102 using ::com::sun::star::drawing::XShape;
107 bool bRelUrl =
false;
108 SfxMedium * pMedium = rWrt.GetWriter().GetMedia();
117 SfxMedium * pMedium = rWrt.GetWriter().GetMedia();
129 return sDocUrl.copy(0, sDocUrl.lastIndexOf(
'/') + 1);
134 OUString aDosName(
INetURLObject( rUrl ).getFSysPath( FSysStyle::Dos ) );
141 OUString aTmpName( aDosName );
151 else if (aDosName.startsWith(
"./"))
153 aDosName = aDosName.copy(2);
157 while (aDosName.startsWith(
"../"))
160 aDosName = aDosName.copy(3);
169 if ( !pINetFormatArg )
return;
172 0xD0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE, 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B };
173 const sal_uInt8 aGuidUrlMoniker[ 16 ] = {
174 0xE0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE, 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B };
176 const sal_uInt8 aGuidFileMoniker[ 16 ] = {
177 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 };
179 0xFF, 0xFF, 0xAD, 0xDE, 0x00, 0x00, 0x00, 0x00,
180 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
181 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
184 constexpr sal_uInt32 WW8_HLINK_BODY = 0x00000001;
185 constexpr sal_uInt32 WW8_HLINK_ABS = 0x00000002;
187 constexpr sal_uInt32 WW8_HLINK_MARK = 0x00000008;
188 constexpr sal_uInt32 WW8_HLINK_FRAME = 0x00000080;
191 OUString tmpTextMark;
193 OUString rUrl = pINetFormatArg->
GetURL();
195 sal_uInt32 nFlags = 0;
201 if (!rTarFrame.isEmpty())
208 nFlags |= WW8_HLINK_FRAME;
212 if (eProtocol == INetProtocol::File || (eProtocol == INetProtocol::NotValid && rUrl[0] !=
'#'))
216 OUString aFileName( BuildFileName( nLevel, bRel, rUrl ));
219 nFlags |= WW8_HLINK_ABS;
221 nFlags |= WW8_HLINK_BODY;
223 tmpStrm.
WriteBytes(aGuidFileMoniker,
sizeof(aGuidFileMoniker));
227 tmpStrm.
WriteBytes(aGuidFileTail,
sizeof(aGuidFileTail));
235 else if( eProtocol != INetProtocol::NotValid )
237 tmpStrm.
WriteBytes(aGuidUrlMoniker,
sizeof(aGuidUrlMoniker));
241 nFlags |= WW8_HLINK_BODY | WW8_HLINK_ABS;
243 else if (rUrl[0] ==
'#' )
245 OUString aTextMark(rUrl.copy( 1 ));
246 aTextMark = aTextMark.replaceFirst(
".",
"!");
247 tmpTextMark = aTextMark;
250 if (tmpTextMark.isEmpty() && aUrlObj.
HasMark())
252 tmpTextMark = aUrlObj.
GetMark();
255 if (!tmpTextMark.isEmpty())
260 nFlags |= WW8_HLINK_MARK;
270 std::unique_ptr<sal_uInt8[]> pBuffer(
new sal_uInt8[ nLen ] );
283 if (!pINetFormat || pINetFormat->
GetURL().isEmpty())
287 WriteHyperlinkWithinFly( aStrm, pINetFormat );
290 OUString aNamestr = pINetFormat->
GetName();
291 if (!aNamestr.isEmpty())
317 class CompareDrawObjs
323 explicit CompareDrawObjs(
const WW8Export& rWrt) : wrt(rWrt) {};
326 sal_uLong aSort = lcl_getSdrOrderNumber(wrt, a);
327 sal_uLong bSort = lcl_getSdrOrderNumber(wrt, b);
328 return aSort < bSort;
336 void lcl_makeZOrderArray(
const WW8Export& rWrt,
337 std::vector<DrawObj> &rSrcArr,
338 std::vector<DrawObj*> &rDstArr)
341 rDstArr.reserve(rSrcArr.size());
344 rDstArr.push_back( &i );
346 std::sort(rDstArr.begin(), rDstArr.end(), CompareDrawObjs(rWrt));
362 uno::Reference< awt::XControlModel > xControlModel =
364 uno::Reference< lang::XServiceInfo > xInfo(xControlModel,
366 uno::Reference<beans::XPropertySet> xPropSet(xControlModel, uno::UNO_QUERY);
370 if (xInfo->supportsService(
"com.sun.star.form.component.ComboBox"))
372 DoComboBox(xPropSet);
382 uno::Sequence<OUString> aListItems;
383 xPropSet->getPropertyValue(
"StringItemList") >>= aListItems;
384 if (aListItems.hasElements())
386 uno::Any aTmp = xPropSet->getPropertyValue(
"DefaultText");
387 auto pStr = o3tl::tryAccess<OUString>(aTmp);
394 uno::Any aTmp = xPropSet->getPropertyValue(
"Name");
395 auto pStr = o3tl::tryAccess<OUString>(aTmp);
405 uno::Any aTmp = xPropSet->getPropertyValue(
"HelpText");
406 auto pStr = o3tl::tryAccess<OUString>(aTmp);
410 catch(
const uno::Exception& )
416 uno::Any aTmp = xPropSet->getPropertyValue(
"Name");
417 auto pStr = o3tl::tryAccess<OUString>(aTmp);
422 DoComboBox(sName, sHelp, sToolTip, sSelected, aListItems);
426 const OUString &rHelp,
427 const OUString &rToolTip,
428 const OUString &rSelected,
429 const uno::Sequence<OUString> &rListItems)
435 m_pChpPlc->AppendFkpEntry( Strm().Tell() );
449 m_pChpPlc->AppendFkpEntry(Strm().Tell(),
sizeof(aArr1), aArr1);
461 sal_uInt32 nListItems = rListItems.getLength();
463 for (sal_uInt32 i = 0;
i < nListItems;
i++)
465 if (i < 0x20 && rSelected == rListItems[i])
466 aFFData.
setResult(::sal::static_int_cast<sal_uInt8>(i));
470 aFFData.
Write(pDataStrm);
479 m_pChpPlc->AppendFkpEntry( Strm().Tell() );
492 m_pChpPlc->AppendFkpEntry(Strm().Tell(),
493 sizeof( aArr1 ), aArr1 );
501 aFFData.
Write(pDataStrm);
505 const OUString fieldStr( pField->
ExpandField(
true,
nullptr) );
513 pDataAdr = aArr2 + 2;
515 m_pChpPlc->AppendFkpEntry(Strm().Tell(),
516 sizeof( aArr2 ), aArr2 );
530 sal_Int16 eHoriOri, sal_Int16 eHoriRel,
SwTwips nPageLeft,
536 if (eHoriRel == text::RelOrientation::PAGE_FRAME)
538 rLeft = nPageSize - rLeft;
542 (eHoriRel == text::RelOrientation::PAGE_PRINT_AREA) ||
543 (eHoriRel == text::RelOrientation::FRAME) ||
544 (eHoriRel == text::RelOrientation::PRINT_AREA)
547 rLeft = nPageSize - nPageLeft - nPageRight - rLeft;
557 sal_Int16 eHoriOri, sal_Int16 eHoriRel,
SwTwips nPageLeft,
563 if (eHoriRel == text::RelOrientation::PAGE_FRAME)
565 rLeft = nPageSize + rLeft;
569 (eHoriRel == text::RelOrientation::PAGE_PRINT_AREA) ||
570 (eHoriRel == text::RelOrientation::FRAME) ||
571 (eHoriRel == text::RelOrientation::PRINT_AREA)
574 rLeft = nPageSize - nPageLeft - nPageRight + rLeft;
588 SwTwips nWidth = rRight - rLeft;
590 SwTwips nPageSize = CurrentPageWidth(nPageLeft, nPageRight);
613 rRight = rLeft + nWidth;
618 if (8 > rWrt.
pFib->m_nVersion)
623 if (maDrawObjs.empty())
628 WW8_CP nCpOffs = GetCpOffset(rFib);
630 for (
const auto& rDrawObj : maDrawObjs)
636 for (
const auto& rDrawObj : maDrawObjs)
639 const ww8::Frame &rFrameFormat = rDrawObj.maContent;
648 const bool bPosConverted =
652 bool bHasHeightWidthSwapped(
false);
658 if( aLayRect.IsEmpty() )
666 if ( aSizeRect.Width() > aLayRect.Width() )
667 aLayRect.
Width( aSizeRect.Width() );
669 aRect = aLayRect.SVRect();
674 OSL_ENSURE(pObj,
"Where is the SDR-Object?");
682 if ( bAllowSwap && (( nAngle > 4500_deg100 && nAngle <= 13500_deg100 ) || ( nAngle > 22500_deg100 && nAngle <= 31500_deg100 )) )
688 bHasHeightWidthSwapped =
true;
702 aRect -= rDrawObj.maParentPos;
708 if (eOri == text::RelOrientation::CHAR || eOri == text::RelOrientation::TEXT_LINE)
709 aObjPos.setY( -rVOr.
GetPos() );
711 aObjPos.setY( rVOr.
GetPos() );
714 aObjPos.setX( rHOr.
GetPos() );
718 sal_Int32 nThick = rDrawObj.mnThick;
740 if (nTop == 0 && !rFrameFormat.
IsInline() &&
762 if(bHasHeightWidthSwapped)
764 nXOff = (nSnapWidth - nLogicHeight + 1) / 2;
765 nYOff = (nSnapHeight - nLogicWidth + 1) / 2;
769 nXOff = (nSnapWidth - nLogicWidth + 1) / 2;
770 nYOff = (nSnapHeight - nLogicHeight + 1) / 2;
795 sal_uInt16 nContour = rSurr.
IsContour() ? 0x0080 : 0x0040;
796 css::text::WrapTextMode eSurround = rSurr.
GetSurround();
805 eSurround = css::text::WrapTextMode_THROUGH;
809 case css::text::WrapTextMode_NONE:
812 case css::text::WrapTextMode_THROUGH:
815 case css::text::WrapTextMode_PARALLEL:
816 nFlags |= 0x0000 | nContour;
818 case css::text::WrapTextMode_DYNAMIC:
819 nFlags |= 0x0600 | nContour;
821 case css::text::WrapTextMode_LEFT:
822 nFlags |= 0x0200 | nContour;
824 case css::text::WrapTextMode_RIGHT:
825 nFlags |= 0x0400 | nContour;
828 OSL_ENSURE(
false,
"Unsupported surround type for export");
850 RegisterWithFib(rFib, nFcStart, rWrt.
pTableStrm->
Tell() - nFcStart);
854 sal_uInt32 nLen)
const
866 sal_uInt32 nLen)
const
878 const Point& rNdTopLeft )
898 maDrawObjs.push_back(aObj);
914 bool bRet = WriteGenericText( rWrt, nTyp, rccp );
930 aContent.push_back( &rObj );
931 aShapeIds.push_back( nShapeId );
933 aSpareFormats.push_back(
nullptr);
939 aContent.push_back(
nullptr );
940 aShapeIds.push_back( nShapeId );
941 aSpareFormats.push_back(pFormat);
970 const Point& rNdTopLeft)
972 OSL_ENSURE(!m_pEscher,
"the EscherStream was already written!");
977 pDrwO = m_pHFSdrObjs;
987 WW8_CP nCP = Fc2Cp(Strm().Tell());
988 bool bSuccess = pDrwO->
Append(*
this, nCP, rFrameFormat, rNdTopLeft);
989 OSL_ENSURE(bSuccess,
"Couldn't export a graphical element!");
995 0x03, 0x6a, 0, 0, 0, 0,
1002 m_pChpPlc->AppendFkpEntry( Strm().Tell() );
1004 m_pChpPlc->AppendFkpEntry( Strm().Tell(),
sizeof( aSpec8 ), aSpec8 );
1008 OutGrf(rFrameFormat);
1017 :
MSWordAttrIter( rWr ), pEditObj(&rEditObj), pEditPool(nullptr), mnTyp(nTyp)
1055 sal_Int32
nPos = rTextAtr.nStart;
1056 if( nPos >= nStartPos && nPos <= nMinPos )
1062 nPos = rTextAtr.nEnd;
1063 if( nPos >= nStartPos && nPos < nMinPos )
1082 rtl_TextEncoding eChrSet =
static_cast<const SvxFontItem&
>(rItem).GetCharSet();
1088 std::vector<const EECharAttrib*>::iterator it =
1102 if (
auto pURL = dynamic_cast< const SvxURLField *>( pField ))
1108 const OUString &rStr = pURL->GetRepresentation();
1123 std::set<sal_uInt16> aUsedRunWhichs;
1126 if (nSwPos >= rTextAtr.nStart && nSwPos < rTextAtr.nEnd)
1128 sal_uInt16 nWhich = rTextAtr.pAttr->Which();
1129 aUsedRunWhichs.insert(nWhich);
1132 if( nSwPos < rTextAtr.nStart )
1138 if (aTextAtrArr.empty())
1150 for(
const auto& rTextAtr : aTextAtrArr)
1152 if (nSwPos >= rTextAtr.nStart && nSwPos < rTextAtr.nEnd)
1154 sal_uInt16 nWhich = rTextAtr.pAttr->Which();
1166 const sal_uInt16 nSlotId = pSrcPool->
GetSlotId(nWhich);
1167 if (nSlotId && nWhich != nSlotId)
1169 nWhich = rDstPool.
GetWhich(nSlotId);
1170 if (nWhich && nWhich != nSlotId &&
1175 std::unique_ptr<SfxPoolItem> pI(rTextAtr.pAttr->Clone());
1176 pI->SetWhich( nWhich );
1187 if( nSwPos < rTextAtr.nStart )
1200 return (nSwPos >= rTextAtr.nStart && nSwPos < rTextAtr.nEnd) &&
1220 if (nWhich == rTextAtr.pAttr->Which() &&
nTmpSwPos >= rTextAtr.nStart &&
nTmpSwPos < rTextAtr.nEnd)
1221 return rTextAtr.pAttr;
1237 OSL_ENSURE(nWhich,
"Impossible, catastrophic failure imminent");
1238 pRet = &aSet.Get(nWhich);
1252 for (sal_uInt16 nEEWhich = aWhichIter.
FirstWhich(); nEEWhich; nEEWhich = aWhichIter.
NextWhich())
1254 if (SfxItemState::SET != rSet.
GetItemState(nEEWhich,
false))
1267 if (rDrawItem != rStandardItem)
1268 rSet.
Put(rDrawItem);
1293 sal_uInt16 nWhich = pItem->
Which();
1294 if (pWhichsToIgnore && pWhichsToIgnore->find(nWhich) != pWhichsToIgnore->end())
1297 sal_uInt16 nSlotId = pSrcPool->
GetSlotId(nWhich);
1299 if ( nSlotId && nWhich != nSlotId &&
1300 0 != ( nWhich = pDstPool->GetWhich( nSlotId ) ) &&
1301 nWhich != nSlotId &&
1306 std::unique_ptr<SfxPoolItem> pI(pItem->
Clone());
1307 pI->SetWhich( nWhich );
1311 }
while ((pItem = aIter.
NextItem()));
1318 bool bOwnParaObj =
false;
1345 bool bAnyWrite =
false;
1351 for( sal_Int32
n = 0;
n < nPara; ++
n )
1356 OSL_ENSURE(
pO->empty(),
" pO is not empty at start of line" );
1359 sal_Int32 nCurrentPos = 0;
1360 const sal_Int32 nEnd =
aStr.getLength();
1363 bool bIsRTLPara =
false;
1368 bIsRTLPara = SvxFrameDirection::Horizontal_RL_TB == nDir;
1372 const sal_Int32 nNextAttr = std::min(aAttrIter.
WhereNext(), nEnd);
1374 bool bTextAtr = aAttrIter.
IsTextAttr( nCurrentPos );
1380 if( nNextAttr == nEnd && !bTextAtr )
1384 aAttrIter.
OutAttr( nCurrentPos );
1397 pO->size(),
pO->data() );
1401 if( nNextAttr == nEnd && bTextAtr )
1403 nCurrentPos = nNextAttr;
1406 while( nCurrentPos < nEnd );
1408 OSL_ENSURE(
pO->empty(),
" pO is not empty at start of line" );
1410 pO->push_back( bNul );
1411 pO->push_back( bNul );
1417 pO->size(),
pO->data() );
1422 bAnyWrite = 0 != nPara;
1461 OSL_ENSURE( !
m_pEscher,
"Who did not deleted the pointer?" );
1463 pEscherStrm->
SetEndian(SvStreamEndian::LITTLE);
1477 pFib->m_fcDggInfo = nStart;
1486 if(
SvStream* pPicStrm = static_cast< SwEscherExGlobal& >( *mxGlobal ).GetPictureStream() )
1489 sal_Int32 nEndPos = rWrt.
Strm().
Tell();
1490 mxGlobal->SetNewBlipStreamOffset( nEndPos );
1492 pPicStrm->Seek( 0 );
1511 mxPicStrm = std::make_shared<SvMemoryStream>();
1512 mxPicStrm->SetEndian(SvStreamEndian::LITTLE);
1553 nFlags |= ShapeFlag::FlipH;
1556 nFlags |= ShapeFlag::FlipV;
1559 nFlags |= ShapeFlag::FlipH | ShapeFlag::FlipV;
1573 if ( !aUniqueId.isEmpty() )
1575 sal_uInt32 nBlibId =
mxGlobal->GetBlibID( *(
mxGlobal->QueryPictureStream()), aGraphicObject );
1590 std::shared_ptr<SvxBrushItem> aBrush(std::make_shared<SvxBrushItem>(aTmpColor,
RES_BACKGROUND));
1593 aBrush.reset(pRet->
Clone());
1605 sal_Int32 nBorderThick=0;
1608 OSL_ENSURE(pGrfNd,
"No SwGrfNode ?, suspicious");
1610 return nBorderThick;
1616 AddMirrorFlags(ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty, rMirror),
1640 OString aUniqueId = aGraphicObject.GetUniqueID();
1642 if (!aUniqueId.isEmpty())
1660 return nBorderThick;
1668 sal_Int32 nContrast = 0;
1669 sal_Int16 nBrightness = 0;
1687 if (nMode == GraphicDrawMode::Watermark)
1697 if (nBrightness > 100)
1700 if (nContrast < -100)
1702 nMode = GraphicDrawMode::Standard;
1706 sal_uInt32 nPictureMode;
1707 if (nMode == GraphicDrawMode::Greys)
1708 nPictureMode = 0x40004;
1709 else if (nMode == GraphicDrawMode::Mono)
1710 nPictureMode = 0x60006;
1718 if (nContrast == 100)
1719 nContrast = 0x10000;
1720 else if (nContrast < 100)
1722 nContrast *= 0x10000;
1725 else if (nContrast < 200)
1726 nContrast = (100 * 0x10000) / (200-nContrast);
1728 nContrast = 0x7fffffff;
1732 if (nBrightness != 0)
1735 sal_Int32 nCropL = 0;
1736 sal_Int32 nCropR = 0;
1737 sal_Int32 nCropT = 0;
1738 sal_Int32 nCropB = 0;
1745 nCropT += rCrop.
GetTop();
1753 nCropL -= rBox.
GetDistance( SvxBoxItemLine::LEFT );
1754 nCropR -= rBox.
GetDistance( SvxBoxItemLine::RIGHT );
1755 nCropT -= rBox.
GetDistance( SvxBoxItemLine::TOP );
1756 nCropB -= rBox.
GetDistance( SvxBoxItemLine::BOTTOM );
1786 sal_Int32 nBorderThick = 0;
1793 uno::Reference < embed::XEmbeddedObject > xObj(rOLENd.GetOLEObj().GetOleRef());
1798 awt::Rectangle aRect;
1799 bool bRectIsSet =
false;
1802 if ( xObj.is() && nAspect != embed::Aspects::MSOLE_ICON )
1806 awt::Size aSize = xObj->getVisualAreaSize( nAspect );
1807 aRect.Width = aSize.Width;
1808 aRect.Height = aSize.Height;
1811 catch(
const uno::Exception& )
1820 #ifdef OLE_PREVIEW_AS_EMF
1821 const Graphic* pGraphic = rOLENd.GetGraphic();
1826 const SwMirrorGrf &rMirror = rOLENd.GetSwAttrSet().GetMirrorGrf();
1828 AddMirrorFlags(ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty | ShapeFlag::OLEShape, rMirror),
1829 pGraphic ? *pGraphic :
Graphic(), *pSdrObj, nShapeId, bRectIsSet ? &aRect :
nullptr );
1840 return nBorderThick;
1846 bool bSetOpacity =
false;
1847 sal_uInt32 nOpaque = 0;
1850 OString aUniqueId = pGraphicObject->GetUniqueID();
1851 if (!aUniqueId.isEmpty())
1858 nOpaque = 255 - pGraphicObject->GetAttr().GetAlpha();
1880 nOpaque = (nOpaque * 100) / 0xFE;
1881 nOpaque = ((100 - nOpaque) << 16) / 100;
1891 bool bFirstLine =
true;
1899 const SvxBorderLine* pLine;
1903 pLine =
static_cast<const SvxBoxItem*
>(pItem)->GetLine(
n );
1904 if(
nullptr != pLine )
1908 sal_uInt32 nLineColor =
GetColor(pLine->GetColor());
1911 nLineColor ^ 0xffffff );
1914 if( pLine->isDouble() )
1917 nLineWidth = pLine->GetWidth();
1918 if( pLine->GetInWidth() == pLine->GetOutWidth() )
1920 else if( pLine->GetInWidth() < pLine->GetOutWidth() )
1929 nLineWidth = pLine->GetWidth();
1937 switch (pLine->GetBorderLineStyle())
1939 case SvxBorderLineStyle::DASHED:
1942 case SvxBorderLineStyle::DOTTED:
1945 case SvxBorderLineStyle::SOLID:
1955 eStyle,eShapeType,nLineWidth);
1959 static_cast<const SvxBoxItem*>(pItem)->GetDistance( n ) ));
1962 rPropOpt.
AddOpt( aExhperProp[
n ],
DrawModelToEmu(static_cast<const SvxBoxItem*>(pItem)->GetDistance( n )) );
1984 if (SfxItemState::SET
1989 constexpr sal_uInt32 nShadowType = 131074;
1998 if( (eLocation!=SvxShadowLocation::NONE) && (pSI->
GetWidth()!=0) )
2002 case SvxShadowLocation::TopLeft:
2008 case SvxShadowLocation::TopRight:
2013 case SvxShadowLocation::BottomLeft:
2018 case SvxShadowLocation::BottomRight:
2036 const bool bIsThrough = rFormat.
GetSurround().
GetValue() == css::text::WrapTextMode_THROUGH;
2040 if (bIsInHeader || bIsThrough)
2089 DrawModelToEmu( static_cast<const SvxLRSpaceItem*>(pItem)->GetLeft() ) );
2091 DrawModelToEmu( static_cast<const SvxLRSpaceItem*>(pItem)->GetRight() ) );
2102 DrawModelToEmu( static_cast<const SvxULSpaceItem*>(pItem)->GetUpper() ) );
2104 DrawModelToEmu( static_cast<const SvxULSpaceItem*>(pItem)->GetLower() ) );
2112 if (pPolyPoly && pPolyPoly->
Count())
2116 aPolyDump.
SetEndian(SvStreamEndian::LITTLE);
2118 sal_uInt16 nLen = aPoly.
GetSize();
2122 for (sal_uInt16 nI = 0; nI < nLen; ++nI)
2140 MapUnit eMap = MapUnit::MapTwip;
2145 eMap = pModel->GetScaleUnit();
2163 sal_Int32 nMSVal = (nVal / 65536) * nMax;
2164 nMSVal += (nVal * 65536) / nMax;
2169 sal_Int32
const nDiv = (nVal / sal_Int32(nMax)) - 1;
2170 sal_uInt32 nMSVal = (sal_uInt32(nDiv) << 16) & 0xffff0000;
2171 nMSVal += (nVal * 65536) / sal_Int32(nMax) + (-nDiv * 65536);
2185 if(
SvStream* pPicStrm = static_cast< SwEscherExGlobal& >( *mxGlobal ).GetPictureStream() )
2188 sal_Int32 nEndPos = pPicStrm->Tell();
2203 sal_uInt16 nColorCount = 4;
2219 if (!pSdrObjs->
size())
2241 sal_uInt32 nShapeId=0;
2242 for (
auto& pObj : aSorted)
2244 sal_Int32 nBorderThick=0;
2245 OSL_ENSURE(pObj,
"impossible");
2270 #if OSL_DEBUG_LEVEL > 0
2272 OSL_ENSURE(
false,
"Where is the SDR-Object?" );
2290 if( nSecondShapeId )
2295 ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty | ShapeFlag::Background,
2303 if (SfxItemState::SET == eState && pItem)
2322 aPropOpt.
Commit( *pStrm );
2348 template<
typename OrientType>
2349 void lcl_SetRelationOrient(OrientType& rOrient,
const sw::WW8AnchorConv eConv,
const std::function<
void()>& fDefault)
2355 rOrient.SetRelationOrient(text::RelOrientation::PAGE_PRINT_AREA);
2358 rOrient.SetRelationOrient(text::RelOrientation::PAGE_FRAME);
2361 rOrient.SetRelationOrient(text::RelOrientation::FRAME);
2364 rOrient.SetRelationOrient(text::RelOrientation::CHAR);
2367 rOrient.SetRelationOrient(text::RelOrientation::TEXT_LINE);
2405 if ( (RndStdIds::FLY_AS_CHAR == eAnchor) || (RndStdIds::FLY_AT_FLY == eAnchor) )
2418 bool bConvDueToAnchoredAtColBreakPara(
false );
2419 if ( ( (eAnchor == RndStdIds::FLY_AT_PARA) || (eAnchor == RndStdIds::FLY_AT_CHAR) ) &&
2426 if (rBreak.
GetBreak() == SvxBreak::ColumnBefore)
2428 bConvDueToAnchoredAtColBreakPara =
true;
2438 bool bConvDueToOrientation(
false );
2441 bConvDueToOrientation = eHOri == text::HoriOrientation::LEFT || eHOri == text::HoriOrientation::RIGHT ||
2442 eHOri == text::HoriOrientation::INSIDE || eHOri == text::HoriOrientation::OUTSIDE ||
2443 ( eHOri != text::HoriOrientation::CENTER && _iorHoriOri.
IsPosToggle() );
2447 if ( bConvDueToAnchoredAtColBreakPara )
2452 && _iorHoriOri.
GetHoriOrient() == text::HoriOrientation::RIGHT )
2455 _iorHoriOri.
SetHoriOrient( text::HoriOrientation::OUTSIDE );
2461 case text::RelOrientation::PAGE_FRAME:
2462 case text::RelOrientation::PAGE_PRINT_AREA:
2464 if ( bConvDueToOrientation || bFollowTextFlow )
2468 case text::RelOrientation::PAGE_LEFT:
2469 case text::RelOrientation::PAGE_RIGHT:
2475 case text::RelOrientation::FRAME:
2477 if ( bConvDueToOrientation )
2481 case text::RelOrientation::PRINT_AREA:
2482 case text::RelOrientation::FRAME_LEFT:
2483 case text::RelOrientation::FRAME_RIGHT:
2489 case text::RelOrientation::CHAR:
2491 if ( bConvDueToOrientation )
2496 OSL_FAIL(
"<WinwordAnchoring::ConvertPosition(..)> - unknown horizontal relation" );
2505 bool bConvDueToOrientation(
false );
2508 bConvDueToOrientation = ( eVOri == text::VertOrientation::TOP ||
2509 eVOri == text::VertOrientation::BOTTOM ||
2510 eVOri == text::VertOrientation::CHAR_TOP ||
2511 eVOri == text::VertOrientation::CHAR_BOTTOM ||
2512 eVOri == text::VertOrientation::CHAR_CENTER ||
2513 eVOri == text::VertOrientation::LINE_TOP ||
2514 eVOri == text::VertOrientation::LINE_BOTTOM ||
2515 eVOri == text::VertOrientation::LINE_CENTER );
2519 if ( bConvDueToAnchoredAtColBreakPara )
2527 case text::RelOrientation::PAGE_FRAME:
2528 case text::RelOrientation::PAGE_PRINT_AREA:
2530 if ( bConvDueToOrientation || bFollowTextFlow )
2534 case text::RelOrientation::FRAME:
2536 if ( bConvDueToOrientation ||
2537 _iorVertOri.
GetVertOrient() == text::VertOrientation::CENTER )
2543 case text::RelOrientation::PRINT_AREA:
2549 case text::RelOrientation::CHAR:
2555 case text::RelOrientation::TEXT_LINE:
2557 if ( bConvDueToOrientation ||
2564 case text::RelOrientation::PAGE_LEFT:
2565 case text::RelOrientation::PAGE_RIGHT:
2566 case text::RelOrientation::FRAME_LEFT:
2567 case text::RelOrientation::FRAME_RIGHT:
2569 OSL_FAIL(
"<WinwordAnchoring::ConvertPosition(..)> - unknown vertical relation" );
2598 mbInline = (eAnchor == RndStdIds::FLY_AS_CHAR);
2605 const bool bPosConverted =
ConvertPosition( rHoriOri, rVertOri, rFormat );
2620 case text::HoriOrientation::LEFT:
2623 case text::HoriOrientation::CENTER:
2626 case text::HoriOrientation::RIGHT:
2629 case text::HoriOrientation::INSIDE:
2632 case text::HoriOrientation::OUTSIDE:
2641 const bool bVertSwap = !bPosConverted &&
2642 ( (eVRel == text::RelOrientation::CHAR) ||
2643 (eVRel == text::RelOrientation::TEXT_LINE) );
2650 case text::VertOrientation::TOP:
2651 case text::VertOrientation::LINE_TOP:
2652 case text::VertOrientation::CHAR_TOP:
2655 case text::VertOrientation::CENTER:
2656 case text::VertOrientation::LINE_CENTER:
2659 case text::VertOrientation::BOTTOM:
2660 case text::VertOrientation::LINE_BOTTOM:
2661 case text::VertOrientation::CHAR_BOTTOM:
2669 case text::RelOrientation::PAGE_PRINT_AREA:
2672 case text::RelOrientation::PAGE_FRAME:
2673 case text::RelOrientation::PAGE_LEFT:
2674 case text::RelOrientation::PAGE_RIGHT:
2677 case text::RelOrientation::FRAME:
2678 case text::RelOrientation::FRAME_LEFT:
2679 case text::RelOrientation::FRAME_RIGHT:
2680 if (eAnchor == RndStdIds::FLY_AT_PAGE)
2685 case text::RelOrientation::PRINT_AREA:
2686 if (eAnchor == RndStdIds::FLY_AT_PAGE)
2691 case text::RelOrientation::CHAR:
2694 case text::RelOrientation::TEXT_LINE:
2701 case text::RelOrientation::PAGE_PRINT_AREA:
2704 case text::RelOrientation::PAGE_FRAME:
2707 case text::RelOrientation::PRINT_AREA:
2708 if (eAnchor == RndStdIds::FLY_AT_PAGE)
2713 case text::RelOrientation::FRAME:
2714 if (eAnchor == RndStdIds::FLY_AT_PAGE)
2719 case text::RelOrientation::CHAR:
2720 case text::RelOrientation::TEXT_LINE:
2721 case text::RelOrientation::PAGE_LEFT:
2722 case text::RelOrientation::PAGE_RIGHT:
2723 case text::RelOrientation::FRAME_LEFT:
2724 case text::RelOrientation::FRAME_RIGHT:
2748 sal_Int32 nBorderThick = 0;
2768 sal_uInt16 nOff = 0;
2794 sal_uInt32 nPrevShapeId =
2812 if( bBrowseMode && rFormat.
GetDoc())
2827 return nBorderThick;
2833 auto aIter = std::find_if(rPVec.begin(), rPVec.end(),
2834 [&rFormat, nHdFtIndex](
const DrawObj* pObj) {
2835 OSL_ENSURE(pObj,
"Impossible");
2840 if (aIter != rPVec.end())
2841 return static_cast< sal_uInt16 >(aIter - rPVec.begin());
2851 sal_Int32 nBorderThick=0;
2870 OSL_ENSURE(
false,
"unknown direction type");
2872 case SvxFrameDirection::Horizontal_LR_TB:
2875 case SvxFrameDirection::Horizontal_RL_TB:
2878 case SvxFrameDirection::Vertical_LR_TB:
2879 case SvxFrameDirection::Vertical_RL_TB:
2882 case SvxFrameDirection::Vertical_LR_BT:
2896 return nBorderThick;
2901 sal_uInt32 nShapeId,
const awt::Rectangle* pVisArea )
2916 SetPicId(rObj, nShapeId, rPropOpt);
2930 OSL_ENSURE(pModel && pDevice,
"no model or device");
2934 SdrView aExchange(*pModel, pDevice);
2938 ShapeFlag::HaveAnchor | ShapeFlag::HaveShapeProperty | ShapeFlag::OLEShape, aGraphic,
2939 *pSdrObj, nShapeId,
nullptr );
2954 ::lcl_makeZOrderArray(rWrt, rSrcArr, rDstArr);
2962 bool bNeedsShapeId =
false;
2968 bNeedsShapeId =
true;
2980 sal_uInt16
nPos =
FindPos(rFormat, nHdFtIndex, rpVec);
2981 sal_uInt32 nShapeId;
2997 const uno::Reference< drawing::XShape>& xXShapeRef, sal_uInt32 nShapeId )
3010 ::ole::MSConvertOCXControls( pDSh ? pDSh->GetModel() : nullptr ), pPaM( pP ), mnObjectId(0)
3018 css::uno::Reference< css::drawing::XShape > *pShapeRef,
3019 bool bFloatingCtrl )
3021 uno::Reference< form::XFormComponent > xFComp;
3023 if ( bRes && xFComp.is() )
3033 const uno::Reference< awt::XControlModel >& xControlModel =
3051 OUString sStorageName =
"_" + OUString::number( static_cast<sal_Int64>( nObjId ));
3063 0x03, 0x6a, 0xFF, 0xFF, 0xFF, 0xFF,
#define ESCHER_DgContainer
virtual void RegisterWithFib(WW8Fib &rFib, sal_uInt32 nStart, sal_uInt32 nLen) const override
Exporter of the binary Word file formats.
void OutAttr(sal_Int32 nSwPos)
virtual AttributeOutputBase & AttrOutput() const =0
Access to the attribute output class.
constexpr TypedWhichId< SfxInt16Item > RES_CHRATR_BIDIRTL(44)
sal_Int32 WhereNext() const
const sw::BroadcastingModify * m_pOutFormatNode
SwNoTextNode * GetNoTextNodeFromSwFrameFormat(const SwFrameFormat &rFormat)
Get the SwNoTextNode associated with a SwFrameFormat if here is one.
sal_Int64 GetAspect() const
static ShapeFlag AddMirrorFlags(ShapeFlag nFlags, const SwMirrorGrf &rMirror)
std::unique_ptr< ww::bytes > pO
Buffer.
Represents the style of a paragraph.
unsigned int GetHdFtIndex() const
sal_uInt8 GetAlpha() const
bool IsSaveRelFSys() const
void OutSwString(const OUString &, sal_Int32 nStt, sal_Int32 nLen)
bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth, sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft, SwTwips nPageRight, SwTwips nPageSize)
sal_Int32 GetLeft() const
void OutEEField(const SfxPoolItem &rHt)
std::unique_ptr< WW8_WrPlcField > m_pFieldHFTextBxs
std::unique_ptr< WW8Fib > pFib
File Information Block.
virtual AttributeOutputBase & AttrOutput() const override
memory leak #i120098#, to hold the reference to unnamed SotStorage obj
sal_uInt32 GetSdrOrdNum(const SwFrameFormat &rFormat) const
#define ESCHER_Prop_dyWrapDistBottom
constexpr sal_uInt16 EE_FEATURE_TAB(EE_FEATURE_START+0)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
void WriteStringAsPara(const OUString &rText)
#define ESCHER_Prop_pictureId
rtl_TextEncoding GetNodeCharSet() const
#define ESCHER_Prop_pictureActive
#define ESCHER_Prop_dyTextTop
SvStream & WriteInt32(sal_Int32 nInt32)
#define ESCHER_Prop_cropFromBottom
std::vector< sal_uLong > aFollowShpIds
WW8_WrPlcTextBoxes * pTextBxs
std::unique_ptr< ContentProperties > pData
const SfxItemPool * pEditPool
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
void OutParaAttr(bool bCharAttr, const std::set< sal_uInt16 > *pWhichsToIgnore=nullptr)
#define ESCHER_Prop_pictureBrightness
std::shared_ptr< SvStream > mxPicStrm
#define ESCHER_Prop_lineWidth
void WriteOCXControl(const SwFrameFormat &rFormat, sal_uInt32 nShapeId)
static sal_uInt16 FindPos(const SwFrameFormat &rFormat, unsigned int nHdFtIndex, DrawObjPointerVector &rPVec)
void SetShapeDetails(sal_uInt32 nId, sal_Int32 nThick)
std::vector< sal_uInt8 > bytes
virtual Size GetTwipSize() const =0
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
void SetCharSet(const EECharAttrib &rTextAttr, bool bStart)
void Commit(SvStream &rSt, sal_uInt16 nVersion=3, sal_uInt16 nRecType=ESCHER_OPT)
bool MiserableFormFieldExportHack(const SwFrameFormat &rFrameFormat)
static sal_Int32 GetEscherLineMatch(MSO_LineStyle eStyle, MSO_SPT eShapeType, sal_Int32 &rThick)
constexpr sal_uInt16 RES_FRMATR_END(133)
sal_uInt32 AddSdrObject(const SdrObject &rObj, bool ooxmlExport=false)
size_t GetObjCount() const
const GraphicObject * GetGraphicObject(OUString const &referer=OUString()) const
const EditTextObject * pEditObj
#define ESCHER_ClientAnchor
#define ESCHER_Prop_lineStyle
virtual sal_Int32 WriteFlyFrameAttr(const SwFrameFormat &rFormat, MSO_SPT eShapeType, EscherPropertyContainer &rPropOpt) override
#define ESCHER_Prop_cropFromLeft
const SfxPoolItem * pAttr
sal_uInt16 GetDistance(SvxBoxItemLine nLine) const
virtual bool CollapseScriptsforWordOk(sal_uInt16 nScript, sal_uInt16 nWhich)=0
Guess the script (asian/western).
bool IsLinkedFile() const
css::uno::Reference< css::frame::XModel2 > mxModel
sal_uInt64 Seek(sal_uInt64 nPos)
virtual WW8_CP GetCpOffset(const WW8Fib &rFib) const override
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
static void WriteString8(SvStream &rStrm, std::u16string_view rStr, bool bAddZero, rtl_TextEncoding eCodeSet)
#define ESCHER_Prop_txflTextFlow
void setResult(sal_uInt8 nResult)
static OUString GetRelURL(OUString const &rTheBaseURIRef, OUString const &rTheAbsURIRef, EncodeMechanism eEncodeMechanism=EncodeMechanism::WasEncoded, DecodeMechanism eDecodeMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
SvxFrameDirection GetTextDirection(const SwPosition &rPos, const Point *pPt=nullptr) const
sal_Int32 WriteOLEFlyFrame(const SwFrameFormat &rFormat, sal_uInt32 nShapeId)
void addListboxEntry(const OUString &rEntry)
constexpr TypedWhichId< SwContrastGrf > RES_GRFATR_CONTRAST(137)
void SetAnchoring(const SwFrameFormat &rFormat)
WW8_CP Fc2Cp(sal_uLong nFc) const
virtual void AddShape(sal_uInt32 nShpInstance, ShapeFlag nFlagIds, sal_uInt32 nShapeID=0)
Of course Writer needs its own rectangles.
std::unique_ptr< WW8_WrPlcField > m_pFieldTextBxs
void Set_UInt32(sal_uInt8 *&p, sal_uInt32 n)
std::shared_ptr< T > make_shared(Args &&...args)
void AppendFlyInFlys(const ww8::Frame &rFrameFormat, const Point &rNdTopLeft)
DrawObjVector & GetObjArr()
virtual SdrObjKind GetObjIdentifier() const
virtual SvxBrushItem * Clone(SfxItemPool *pPool=nullptr) const override
Used to export formatted text associated to drawings.
const sal_uInt32 nInlineHack
bool IsTextEditActive() const
virtual void WriteFrameExtraData(const SwFrameFormat &rFormat) override
EmbeddedObjectRef * pObject
std::shared_ptr< EscherExGlobal > mxGlobal
const SfxItemSet * GetCurItemSet() const
Getter for pISet.
#define ESCHER_ClientTextbox
css::chart::ChartAxisLabelPosition ePos
OUString FieldString(ww::eField eIndex)
std::shared_ptr< SvxBrushItem > TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const
bool ReadOCXStorage(tools::SvRef< SotStorage > const &rSrc1, css::uno::Reference< css::form::XFormComponent > &rxFormComp)
const SwFrameFormats * GetSpzFrameFormats() const
static bool WriteOCXStream(const css::uno::Reference< css::frame::XModel > &rxModel, tools::SvRef< SotStorage > const &rSrc1, const css::uno::Reference< css::awt::XControlModel > &rControlModel, const css::awt::Size &rSize, OUString &rName)
constexpr TypedWhichId< SwLuminanceGrf > RES_GRFATR_LUMINANCE(136)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
virtual WW8_CP GetCpOffset(const WW8Fib &) const override
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
virtual void SetPicId(const SdrObject &rSdrObj, sal_uInt32 nShapeId, EscherPropertyContainer &rPropOpt) override
virtual void SetPicId(const SdrObject &, sal_uInt32, EscherPropertyContainer &)
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
virtual sal_uInt32 GenerateShapeId()
virtual const tools::Rectangle & GetSnapRect() const
constexpr auto convertTwipToMm100(N n)
static OutputDevice * GetDefaultDevice()
static bool ConvertPosition(SwFormatHoriOrient &_iorHoriOri, SwFormatVertOrient &_iorVertOri, const SwFrameFormat &_rFrameFormat)
method to perform conversion of positioning attributes with the help of corresponding layout informat...
#define ESCHER_Prop_dxWrapDistLeft
SvStream & GetStream() const
virtual sal_uInt32 QueryTextID(const css::uno::Reference< css::drawing::XShape > &, sal_uInt32) override
const SfxPoolItem * NextItem()
SvxGraphicPosition GetGraphicPos() const
void WritePlc(WW8Export &rWrt) const
#define ESCHER_Prop_wzName
virtual sal_Int32 WriteFlyFrameAttr(const SwFrameFormat &rFormat, MSO_SPT eShapeType, EscherPropertyContainer &rPropOpt)
SvxShadowLocation GetLocation() const
SotStorage * OpenSotStorage(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE, bool transacted=true)
virtual void OutputField(const SwField *pField, ww::eField eFieldType, const OUString &rFieldCmd, FieldFlags nMode=FieldFlags::All) override
Write the field.
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
SwNodeType GetNodeType() const
MSWordExportBase & m_rExport
void Flush(SvStream *pPicStreamMergeBSE=nullptr)
static Graphic GetObjGraphic(const SdrObject &rSdrObject)
OString GetUniqueID() const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
void WriteHyperlinkWithinFly(SvMemoryStream &rStrm, const SwFormatURL *pINetFormatArg)
SwBasicEscherEx(SvStream *pStrm, WW8Export &rWrt)
SwMSConvertControls(SfxObjectShell const *pDSh, SwPaM *pP)
#define DFF_msofbtUDefProp
const SvxBrushItem * GetCurrentPageBgBrush() const
sal_Int32 SearchNext(sal_Int32 nStartPos)
void SetClientData(EscherExClientRecord_Base *p)
void Width(tools::Long nNew)
bool Append(WW8Export const &, WW8_CP nCp, const ww8::Frame &rFormat, const Point &rNdTopLeft)
sal_uInt32 RGBToBGR(::Color nColour)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
const SfxItemSet & GetParaAttribs(sal_Int32 nPara) const
Degree100 NormAngle36000(Degree100 deg100)
const Graphic * GetGraphic(OUString const &referer=OUString()) const
virtual void RawText(const OUString &rText, rtl_TextEncoding eCharSet)=0
Output text (without markup).
MainTextPlcDrawObj * m_pSdrObjs
void WriteChar(sal_Unicode c) override
bool GetFileFilterNms(OUString *pFileNm, OUString *pFilterNm) const
sal_uInt64 remainingSize()
void WriteBrushAttr(const SvxBrushItem &rBrush, EscherPropertyContainer &rPropOpt)
WW8_WrPlcTextBoxes * m_pTextBxs
SdrLayerID GetInvisibleHellId() const
static sal_Int32 ToFract16(sal_Int32 nVal, sal_uInt32 nMax)
#define ESCHER_Prop_fillOpacity
void OutputItem(const SfxPoolItem &rHt)
Call the right virtual function according to the type of the item.
OUString BuildFileName(sal_uInt16 &rnLevel, bool &rbRel, const OUString &rUrl)
void WriteGrfBullet(const Graphic &)
OUString GetBasePath() const
sal_uInt32 AddDummyShape()
SvStream * QueryPictureStream()
OUString GetText(sal_Int32 nPara) const
constexpr auto convert(N n, sal_Int64 mul, sal_Int64 div)
sal_Int32 m_lcbPlcfspaMom
const SwFrameFormat & GetFrameFormat() const
Get the writer SwFrameFormat that this object describes.
#define ESCHER_Prop_dyTextBottom
#define ESCHER_Prop_cropFromTop
SvxFrameDirection mnDirection
virtual SdrLayerID GetInvisibleHellId() const =0
#define ESCHER_Prop_fNoLineDrawDash
void ExportControl(WW8Export &rWrt, const SdrUnoObj &rFormObj)
static void WriteString16(SvStream &rStrm, const OUString &rStr, bool bAddZero)
#define ESCHER_Prop_lineDashing
const Color & GetColor() const
std::unique_ptr< OutlinerParaObject > CreateEditOutlinerParaObject() const
#define DFF_Prop_shadowOffsetX
Fraction conversionFract(o3tl::Length from, o3tl::Length to)
PaM is Point and Mark: a selection of the document model.
const Color & GetColor() const
#define ESCHER_Prop_lineBackColor
#define ESCHER_ShpInst_TextBox
std::unique_ptr< WW8_WrPlcPn > m_pPapPlc
const EditTextObject & GetTextObject() const
tools::Polygon CorrectWordWrapPolygonForExport(const tools::PolyPolygon &rPolyPoly, const SwNoTextNode *pNd, bool bCorrectCrop)
Undo all scaling / move tricks of the wrap polygon done during import.
void setName(const OUString &rName)
#define ESCHER_Prop_pictureContrast
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetCurItemSet(const SfxItemSet *pS)
Setter for pISet.
EscherExHostAppData aHostData
#define DFF_Prop_shadowOffsetY
SVXCORE_DLLPUBLIC SdrObject * GetSdrObjectFromXShape(const css::uno::Reference< css::drawing::XShape > &xShape)
virtual const SfxPoolItem * HasTextItem(sal_uInt16 nWhich) const override
const SwPageDesc & GetPageDesc(const size_t i) const
#define STREAM_SEEK_TO_BEGIN
#define ESCHER_Prop_dxWrapDistRight
virtual void WritePictures() override
constexpr TypedWhichId< SwFormatURL > RES_URL(111)
ESCHER_BlipFlagLinkToFile
constexpr TypedWhichId< SwCropGrf > RES_GRFATR_CROPGRF(134)
sal_uInt16 GetPos(const void *p) const
std::vector< rtl_TextEncoding > aChrSetArr
virtual void RegisterWithFib(WW8Fib &rFib, sal_uInt32 nStart, sal_uInt32 nLen) const override
#define DFF_Prop_shadowColor
const OUString & GetValue() const
static void WriteShort(SvStream &rStrm, sal_Int16 nVal)
const Fraction & X() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
rtl_TextEncoding eNdChrSet
std::size_t WriteBytes(const void *pData, std::size_t nSize)
sal_Int32 DrawModelToEmu(sal_Int32 nVal) const
virtual bool InsertControl(const css::uno::Reference< css::form::XFormComponent > &rFComp, const css::awt::Size &rSize, css::uno::Reference< css::drawing::XShape > *pShape, bool bFloatingCtrl) override
void MiserableRTLFrameFormatHack(SwTwips &rLeft, SwTwips &rRight, const ww8::Frame &rFrameFormat)
Nasty swap for bidi if necessary.
void WriteData(EscherEx &rEx) const override
void DoComboBox(css::uno::Reference< css::beans::XPropertySet > const &xPropSet)
sal_uInt32 GetOrdNum() const
SfxItemSet * GetItemSet() const
virtual void WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner=ww8::WW8TableNodeInfoInner::Pointer_t()) override
void setType(sal_uInt8 nType)
#define DFF_Prop_pWrapPolygonVertices
Marks a node in the document model.
sal_uInt32 GetFlyShapeId(const SwFrameFormat &rFormat, unsigned int nHdFtIndex, DrawObjPointerVector &rPVec)
SwWW8Writer & GetWriter() const
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
sal_Int32 WriteFlyFrame(const DrawObj &rObj, sal_uInt32 &rShapeId, DrawObjPointerVector &rPVec)
bool WriteText(WW8Export &rWrt)
void Write(SvStream *pDataStrm)
void GetCharAttribs(sal_Int32 nPara, std::vector< EECharAttrib > &rLst) const
#define ESCHER_Prop_dyWrapDistTop
SvStream & WriteStream(SvStream &rStream)
bool IsSaveRelINet() const
sal_uInt16 TransformWhichBetweenPools(const SfxItemPool &rDestPool, const SfxItemPool &rSrcPool, sal_uInt16 nWhich)
Map an ID valid in one SfxItemPool to its equivalent in another.
#define ESCHER_Prop_cropFromRight
HdFtPlcDrawObj * m_pHFSdrObjs
sal_Int32 m_lcbPlcfspaHdr
#define ESCHER_Prop_pibName
#define ESCHER_Prop_fillBlip
virtual SdrInventor GetObjInventor() const
#define ESCHER_Prop_shadowColor
sal_uInt32 GetGroupLevel() const
void setStatus(const OUString &rStatus)
virtual SdrLayerID GetHellId() const =0
#define ESCHER_Prop_fillBackColor
#define ESCHER_Prop_hspNext
virtual SdrLayerID GetLayer() const
void setHelp(const OUString &rHelp)
const SwNodeIndex * GetContentIdx() const
virtual ~SwEscherEx() override
std::size_t ReadBytes(void *pData, std::size_t nSize)
#define ESCHER_Prop_dxTextLeft
WW8_WrPlcTextBoxes * m_pHFTextBxs
constexpr sal_uInt16 RES_UNKNOWNATR_BEGIN(RES_BOXATR_END)
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
sal_Int32 GetBottom() const
#define ESCHER_Prop_fillColor
const SwMirrorGrf & GetMirrorGrf(bool=true) const
sal_Int32 GetParagraphCount() const
#define ESCHER_DggContainer
virtual const std::vector< sal_uInt32 > * GetShapeIdArr() const override
SwFrameFormat & GetMaster()
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTextNode is a paragraph in the document model.
bool IsFlyFrameFormatInHeader(const SwFrameFormat &rFormat)
#define ESCHER_SpContainer
#define ESCHER_Prop_fBackground
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
static void WriteGrfAttr(const SwNoTextNode &rNd, const SwFrameFormat &rFormat, EscherPropertyContainer &rPropOpt)
SotStorage & GetStorage() const
void Append(const SdrObject &rObj, sal_uInt32 nShapeId)
FrPair GetMapFactor(MapUnit eS, MapUnit eD)
constexpr sal_uInt16 RES_TXTATR_END(RES_TXTATR_NOEND_END)
virtual void CloseContainer()
#define ESCHER_ShpInst_PictureFrame
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
void MakeZOrderArrAndFollowIds(std::vector< DrawObj > &rSrcArr, DrawObjPointerVector &rDstArr)
sal_Int32 GetDenominator() const
void AddAtom(sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion=0, int nRecInstance=0)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
#define ESCHER_ShpInst_Rectangle
virtual OutlinerParaObject * GetOutlinerParaObject() const override
Make exporting a Writer Frame easy.
virtual void WriteFrameExtraData(const SwFrameFormat &)
#define ESCHER_Prop_lineColor
#define ESCHER_Prop_fNoFillHitTest
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
bool IsTextAttr(sal_Int32 nSwPos)
virtual void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0)
std::vector< EECharAttrib > aTextAtrArr
virtual void WritePictures()
void SetEndian(SvStreamEndian SvStreamEndian)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
INetProtocol GetProtocol() const
MSWord_SdrAttrIter(const MSWord_SdrAttrIter &)=delete
constexpr TypedWhichId< SwDrawModeGrf > RES_GRFATR_DRAWMODE(144)
#define ESCHER_Prop_fillType
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
virtual sal_uInt32 EnterGroup(const OUString &rShapeName, const tools::Rectangle *pBoundRect)
static bool RTLDrawingsHack(SwTwips &rLeft, sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft, SwTwips nPageRight, SwTwips nPageSize)
void WriteSdrTextObj(const SdrTextObj &rObj, sal_uInt8 nTyp)
#define DFF_Prop_fshadowObscured
virtual bool EndURL(bool isAtEndOfParagraph)=0
Output URL end.
void AddOpt(sal_uInt16 nPropID, bool bBlib, sal_uInt32 nSizeReduction, SvMemoryStream &rStream)
FIB - the File Information Block.
void WriteEmptyFlyFrame(const SwFrameFormat &rFormat, sal_uInt32 nShapeId)
sal_Int32 GetNumerator() const
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
SvStream & WriteChar(char nChar)
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
static void InsUInt16(ww::bytes &rO, sal_uInt16 n)
virtual ~SwEscherExGlobal() override
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
void PreWriteHyperlinkWithinFly(const SwFrameFormat &rFormat, EscherPropertyContainer &rPropOpt)
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
virtual void CallSwClientNotify(const SfxHint &rHint) const override
virtual bool StartURL(const OUString &rUrl, const OUString &rTarget)=0
Output URL start.
sal_Int32 GetRight() const
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
virtual SvStream * ImplQueryPictureStream() override
Override to create a new memory stream for picture data.
#define ESCHER_SplitMenuColors
std::vector< const EECharAttrib * > aChrTextAtrArr
bool m_bFontSizeWritten
Is font size written already as part of the current character properties?
SwEscherEx(SvStream *pStrm, WW8Export &rWW8Wrt)
sal_Int32 WriteGrfFlyFrame(const SwFrameFormat &rFormat, sal_uInt32 nShapeId)
SdrLayerID GetHellLayerId() const
Base class for WW8Export and DocxExport.
OUString GetMark(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
virtual Degree100 GetRotateAngle() const
constexpr sal_uInt16 EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
virtual const tools::Rectangle & GetLogicRect() const
if(!pCandidateA->getEnd().equal(pCandidateB->getStart()))
WinwordAnchoring aWinwordAnchoring
bool IsInline() const
Is this frame inline (as character)
bool ReadOCXStream(tools::SvRef< SotStorage > const &rSrc1, css::uno::Reference< css::drawing::XShape > *pShapeRef, bool bFloatingCtrl=false)
void WriteOutliner(const OutlinerParaObject &rOutliner, sal_uInt8 nTyp)
WriterSource GetWriterType() const
Get the type of frame that this wraps.
virtual const SfxPoolItem & GetItem(sal_uInt16 nWhich) const override
rtl_TextEncoding GetNextCharSet() const
void SetItemsThatDifferFromStandard(bool bCharAttr, SfxItemSet &rSet)
std::vector< DrawObj * > DrawObjPointerVector
sal_uInt16 GetSetWhichFromSwDocWhich(const SfxItemSet &rSet, const SwDoc &rDoc, sal_uInt16 nWhich)
Map a SwDoc WhichId to the equivalent Id for a given SfxItemSet.
#define ESCHER_Prop_fPrint
virtual ~SwBasicEscherEx() override
virtual void DoFormText(const SwInputField *pField) override
static sal_uInt32 GetColor(const sal_uInt32 nColor)
bool GetOpt(sal_uInt16 nPropertyID, sal_uInt32 &rPropValue) const
void WriteOLEPicture(EscherPropertyContainer &rPropOpt, ShapeFlag nShapeFlags, const Graphic &rGraphic, const SdrObject &rObj, sal_uInt32 nShapeId, const css::awt::Rectangle *pVisArea)
void SetHellLayerId(SdrLayerID nId)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
#define ESCHER_Prop_pibFlags
The class MSWordAttrIter is a helper class to build the Fkp.chpx.
static void WriteLong(SvStream &rStrm, sal_Int32 nVal)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
const SwPosition & GetPosition() const
Get the position this frame is anchored at.
virtual void WriteChar(sal_Unicode c)=0
void NextPara(sal_Int32 nPar)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
std::unique_ptr< WW8_WrPlcPn > m_pChpPlc
SvxFrameDirection TrueFrameDirection(const SwFrameFormat &rFlyFormat) const
Right to left?
const Graphic & GetGrf(bool bWait=false) const
static void InsAsString16(ww::bytes &rO, const OUString &rStr)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
sal_Int32 WriteTextFlyFrame(const DrawObj &rObj, sal_uInt32 nShapeId, sal_uInt32 nTextBox, DrawObjPointerVector &rPVec)
const Size & GetSize() const
const SfxPoolItem * GetCurItem() const
#define ESCHER_Prop_lTxid
const SwAttrPool & GetAttrPool() const
#define ESCHER_ClientData
constexpr OUStringLiteral aObjectPool
#define ESCHER_Prop_pihlShape
const SvxFieldData * GetField() const
virtual const tools::Rectangle & GetLogicRect() const override
sal_uInt16 GetWidth() const
#define ESCHER_Prop_dxTextRight