summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/core/drawdoc4.cxx12
-rw-r--r--sd/source/core/stlpool.cxx6
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx2
-rw-r--r--sd/source/ui/func/fubullet.cxx4
-rw-r--r--sd/source/ui/inc/SlideshowLayerRenderer.hxx2
-rw-r--r--sd/source/ui/inc/sdxfer.hxx5
-rw-r--r--sd/source/ui/sidebar/MasterPageContainer.cxx15
-rw-r--r--sd/source/ui/sidebar/MasterPageContainer.hxx2
-rw-r--r--sd/source/ui/sidebar/MasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/tools/SlideshowLayerRenderer.cxx172
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx3
-rw-r--r--sd/source/ui/view/sdview2.cxx3
-rw-r--r--sd/source/ui/view/sdview3.cxx48
13 files changed, 174 insertions, 106 deletions
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index f696c09ae95f..de0005098693 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -194,13 +194,13 @@ void SdDrawDocument::CreateLayoutTemplates()
getDefaultFonts( aLatinFont, aCJKFont, aCTLFont );
- SvxFontItem aSvxFontItem( aLatinFont.GetFamilyType(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(),
+ SvxFontItem aSvxFontItem( aLatinFont.GetFamilyTypeMaybeAskConfig(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitchMaybeAskConfig(),
aLatinFont.GetCharSet(), EE_CHAR_FONTINFO );
- SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyType(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(),
+ SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyTypeMaybeAskConfig(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitchMaybeAskConfig(),
aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK );
- SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyType(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(),
+ SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyTypeMaybeAskConfig(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitchMaybeAskConfig(),
aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL );
rISet.Put( aSvxFontItem );
@@ -652,13 +652,13 @@ void SdDrawDocument::CreateDefaultCellStyles()
getDefaultFonts( aLatinFont, aCJKFont, aCTLFont );
- SvxFontItem aSvxFontItem( aLatinFont.GetFamilyType(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(),
+ SvxFontItem aSvxFontItem( aLatinFont.GetFamilyTypeMaybeAskConfig(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitchMaybeAskConfig(),
aLatinFont.GetCharSet(), EE_CHAR_FONTINFO );
- SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyType(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(),
+ SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyTypeMaybeAskConfig(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitchMaybeAskConfig(),
aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK );
- SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyType(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(),
+ SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyTypeMaybeAskConfig(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitchMaybeAskConfig(),
aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL );
SdStyleSheetPool* pSSPool = static_cast<SdStyleSheetPool*>(GetStyleSheetPool());
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 23a41e8df5cf..69a5fe18de37 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -185,13 +185,13 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(std::u16string_view rLayoutName,
mpDoc->getDefaultFonts( aLatinFont, aCJKFont, aCTLFont );
// Font for title and outline
- SvxFontItem aSvxFontItem( aLatinFont.GetFamilyType(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(),
+ SvxFontItem aSvxFontItem( aLatinFont.GetFamilyTypeMaybeAskConfig(), aLatinFont.GetFamilyName(), aLatinFont.GetStyleName(), aLatinFont.GetPitchMaybeAskConfig(),
aLatinFont.GetCharSet(), EE_CHAR_FONTINFO );
- SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyType(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(),
+ SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamilyTypeMaybeAskConfig(), aCJKFont.GetFamilyName(), aCJKFont.GetStyleName(), aCJKFont.GetPitchMaybeAskConfig(),
aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK );
- SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyType(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(),
+ SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamilyTypeMaybeAskConfig(), aCTLFont.GetFamilyName(), aCTLFont.GetStyleName(), aCTLFont.GetPitchMaybeAskConfig(),
aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL );
vcl::Font aBulletFont( GetBulletFont() );
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index cfcfa52ef971..504bbe63adef 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -113,7 +113,7 @@ SfxItemPool* GetAnnotationPool()
s_pAnnotationPool->SetUserDefaultItem(SvxFontHeightItem(423,100,EE_CHAR_FONTHEIGHT));
vcl::Font aAppFont( Application::GetSettings().GetStyleSettings().GetAppFont() );
- s_pAnnotationPool->SetUserDefaultItem(SvxFontItem(aAppFont.GetFamilyType(),aAppFont.GetFamilyName(),u""_ustr,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO));
+ s_pAnnotationPool->SetUserDefaultItem(SvxFontItem(aAppFont.GetFamilyTypeMaybeAskConfig(),aAppFont.GetFamilyName(),u""_ustr,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO));
}
return s_pAnnotationPool.get();
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index ba2e1d71cc50..299abd1c3641 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -257,8 +257,8 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq )
// set attributes (set font)
SfxItemSet aSet(pOL->GetEmptyItemSet());
- SvxFontItem aFontItem (aFont.GetFamilyType(), aFont.GetFamilyName(),
- aFont.GetStyleName(), aFont.GetPitch(),
+ SvxFontItem aFontItem (aFont.GetFamilyTypeMaybeAskConfig(), aFont.GetFamilyName(),
+ aFont.GetStyleName(), aFont.GetPitchMaybeAskConfig(),
aFont.GetCharSet(),
EE_CHAR_FONTINFO);
aSet.Put(aFontItem);
diff --git a/sd/source/ui/inc/SlideshowLayerRenderer.hxx b/sd/source/ui/inc/SlideshowLayerRenderer.hxx
index d76367adee73..12a944b86377 100644
--- a/sd/source/ui/inc/SlideshowLayerRenderer.hxx
+++ b/sd/source/ui/inc/SlideshowLayerRenderer.hxx
@@ -158,7 +158,7 @@ public:
* The properties of the layer are written to the input string in JSON format.
*
* @returns false, if nothing was rendered and rendering is done */
- bool render(unsigned char* pBuffer, double& scale, OString& rJsonMsg);
+ bool render(unsigned char* pBuffer, bool& bIsBitmapLayer, double& scale, OString& rJsonMsg);
};
} // end of namespace sd
diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx
index b93ef331f1d4..3a1e599856e1 100644
--- a/sd/source/ui/inc/sdxfer.hxx
+++ b/sd/source/ui/inc/sdxfer.hxx
@@ -58,6 +58,10 @@ public:
void SetStartPos( const Point& rStartPos ) { maStartPos = rStartPos; }
const Point& GetStartPos() const { return maStartPos; }
+ // tdf#118171 - snap rectangles of objects without line width
+ void SetBoundStartPos(const Point& rBoundStartPos) { maBoundStartPos = rBoundStartPos; }
+ const Point& GetBoundStartPos() const { return maBoundStartPos; }
+
void SetInternalMove( bool bSet ) { mbInternalMove = bSet; }
bool IsInternalMove() const { return mbInternalMove; }
@@ -126,6 +130,7 @@ private:
std::unique_ptr<ImageMap> mpImageMap;
::tools::Rectangle maVisArea;
Point maStartPos;
+ Point maBoundStartPos;
bool mbInternalMove : 1;
bool mbOwnDocument : 1;
bool mbOwnView : 1;
diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx
index ed3445824153..fb404b765200 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.cxx
@@ -103,6 +103,8 @@ public:
void ReleaseDescriptor (Token aToken);
+ const Size& GetPreviewSizePixel(PreviewSize pPreviewSize);
+
/** Called by the MasterPageContainerFiller to notify that all master
pages from template documents have been added.
*/
@@ -444,6 +446,11 @@ void MasterPageContainer::InvalidatePreview (MasterPageContainer::Token aToken)
mpImpl->InvalidatePreview(aToken);
}
+const Size& MasterPageContainer::GetPreviewSizePixel()
+{
+ return mpImpl->GetPreviewSizePixel(mePreviewSize);
+}
+
Image MasterPageContainer::GetPreviewForToken (MasterPageContainer::Token aToken)
{
return mpImpl->GetPreviewForToken(aToken,mePreviewSize);
@@ -809,6 +816,14 @@ SdDrawDocument* MasterPageContainer::Implementation::GetDocument()
return mpDocument;
}
+const Size& MasterPageContainer::Implementation::GetPreviewSizePixel(PreviewSize pPreviewSize)
+{
+ if (pPreviewSize == PreviewSize::SMALL)
+ return maSmallPreviewSizePixel;
+ else
+ return maLargePreviewSizePixel;
+}
+
Image MasterPageContainer::Implementation::GetPreviewSubstitution (
TranslateId pId,
PreviewSize ePreviewSize)
diff --git a/sd/source/ui/sidebar/MasterPageContainer.hxx b/sd/source/ui/sidebar/MasterPageContainer.hxx
index 18e476c0303d..19b1e7bc9ab0 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.hxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.hxx
@@ -85,6 +85,8 @@ public:
};
PreviewState GetPreviewState(Token aToken);
+ const Size& GetPreviewSizePixel();
+
/** This method is typically called for entries in the container for
which GetPreviewState() returns OS_CREATABLE. The creation of the
preview is then scheduled to be executed asynchronously at a later
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index 23f09a1d79fe..b40704c307de 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -585,7 +585,8 @@ css::ui::LayoutSize MasterPagesSelector::GetHeightForWidth(const sal_Int32 nWidt
{
// there is no way to get margin of item programmatically, we use value provided in ui file.
const int nMargin = 6;
- sal_Int32 nColumnCount = nWidth / (mxPreviewIconView->get_item_width() + (5 * nMargin));
+ const Size& previewSize = mpContainer->GetPreviewSizePixel();
+ sal_Int32 nColumnCount = nWidth / (previewSize.Width() + (2 * nMargin));
if (nColumnCount < 1)
nColumnCount = 1;
@@ -594,8 +595,7 @@ css::ui::LayoutSize MasterPagesSelector::GetHeightForWidth(const sal_Int32 nWidt
if (nRowCount < 1)
nRowCount = 1;
- sal_Int32 nPreferedHeight
- = nRowCount * (mxPreviewIconView->get_rect(nTotalItems - 1).GetHeight() + (2 * nMargin));
+ sal_Int32 nPreferedHeight = nRowCount * (previewSize.getHeight() + (4 * nMargin));
return css::ui::LayoutSize(nPreferedHeight, nPreferedHeight, nPreferedHeight);
}
diff --git a/sd/source/ui/tools/SlideshowLayerRenderer.cxx b/sd/source/ui/tools/SlideshowLayerRenderer.cxx
index e63e76be30b7..6729c3f23c57 100644
--- a/sd/source/ui/tools/SlideshowLayerRenderer.cxx
+++ b/sd/source/ui/tools/SlideshowLayerRenderer.cxx
@@ -95,20 +95,55 @@ public:
namespace
{
-bool hasFields(SdrObject* pObject)
+sal_Int32 getFieldType(SdrObject* pObject)
{
auto* pTextObject = dynamic_cast<SdrTextObj*>(pObject);
if (!pTextObject)
- return false;
+ return -2;
OutlinerParaObject* pOutlinerParagraphObject = pTextObject->GetOutlinerParaObject();
if (pOutlinerParagraphObject)
{
const EditTextObject& rEditText = pOutlinerParagraphObject->GetTextObject();
- if (rEditText.IsFieldObject())
- return true;
+ if (rEditText.IsFieldObject() && rEditText.GetField() && rEditText.GetField()->GetField())
+ return rEditText.GetField()->GetField()->GetClassId();
}
- return false;
+ return -2;
+}
+
+bool hasFields(SdrObject* pObject) { return getFieldType(pObject) > -2; }
+
+OUString getFieldName(sal_Int32 nType)
+{
+ switch (nType)
+ {
+ case text::textfield::Type::PAGE:
+ return u"Page"_ustr;
+ case text::textfield::Type::PAGE_NAME:
+ return u"PageName"_ustr;
+ default:
+ return u""_ustr;
+ }
+}
+
+OUString getMasterTextFieldType(SdrObject* pObject)
+{
+ OUString aType;
+
+ uno::Reference<drawing::XShape> xShape = pObject->getUnoShape();
+ if (!xShape.is())
+ return aType;
+
+ OUString sShapeType = xShape->getShapeType();
+
+ if (sShapeType == u"com.sun.star.presentation.SlideNumberShape")
+ aType = u"SlideNumber"_ustr;
+ else if (sShapeType == u"com.sun.star.presentation.FooterShape")
+ aType = u"Footer"_ustr;
+ else if (sShapeType == u"com.sun.star.presentation.DateTimeShape")
+ aType = u"DateTime"_ustr;
+
+ return aType;
}
/// Sets visible for all kinds of polypolys in the container
@@ -251,27 +286,11 @@ private:
mpCurrentRenderPass = newRenderPass();
}
- OUString getMasterTextFieldString(SdrObject* pObject)
+ bool isTextFieldVisible(std::u16string_view svType) const
{
- OUString aType;
-
- uno::Reference<drawing::XShape> xShape = pObject->getUnoShape();
- if (!xShape.is())
- return aType;
-
- OUString sShapeType = xShape->getShapeType();
-
- if (mrRenderState.mbSlideNumberEnabled
- && sShapeType == u"com.sun.star.presentation.SlideNumberShape")
- aType = u"SlideNumber"_ustr;
- else if (mrRenderState.mbFooterEnabled
- && sShapeType == u"com.sun.star.presentation.FooterShape")
- aType = u"Footer"_ustr;
- else if (mrRenderState.mbDateTimeEnabled
- && sShapeType == u"com.sun.star.presentation.DateTimeShape")
- aType = u"DateTime"_ustr;
-
- return aType;
+ return (mrRenderState.mbSlideNumberEnabled && svType == u"SlideNumber")
+ || (mrRenderState.mbFooterEnabled && svType == u"Footer")
+ || (mrRenderState.mbDateTimeEnabled && svType == u"DateTime");
}
public:
@@ -287,9 +306,13 @@ public:
if (mrRenderState.maRenderPasses.back().isEmpty())
mrRenderState.maRenderPasses.pop_back();
+ // Merge text field render passes into the main render pass list.
+ // We prepend them, so that they are rendered and sent to the client first.
+ // So, when the client try to draw a master page layer corresponding
+ // to a text field placeholder the content is already available.
for (auto& rRenderWork : mrRenderState.maTextFields)
{
- mrRenderState.maRenderPasses.push_back(rRenderWork);
+ mrRenderState.maRenderPasses.push_front(rRenderWork);
}
}
@@ -314,19 +337,58 @@ public:
const bool bVisible
= pObject->getSdrPageFromSdrObject()->checkVisibility(rOriginal, rDisplayInfo, true);
- if (!bVisible)
- return;
-
// Determine the current stage, depending on the page
RenderStage eCurrentStage
= pPage->IsMasterPage() ? RenderStage::Master : RenderStage::Slide;
+ OUString sTextFieldType = getMasterTextFieldType(pObject);
+ bool isPresentationTextField = !sTextFieldType.isEmpty();
+ if (!isPresentationTextField)
+ {
+ sTextFieldType = getFieldName(getFieldType(pObject));
+ }
+
+ // Check if the object has slide number, footer, date/time
+ if (eCurrentStage == RenderStage::Master && !sTextFieldType.isEmpty())
+ {
+ // it's not possible to set visibility for non-presentation text fields
+ bool bIsTextFieldVisible
+ = !isPresentationTextField || isTextFieldVisible(sTextFieldType);
+
+ // A placeholder always needs to be exported even if the content is hidden
+ // since it could be visible on another slide and master page layers should be cached
+ // on the client
+ closeRenderPass();
+
+ mpCurrentRenderPass->maObjectsAndParagraphs.emplace(pObject, std::deque<sal_Int32>());
+ mpCurrentRenderPass->meStage = eCurrentStage;
+ mpCurrentRenderPass->mbPlaceholder = true;
+ mpCurrentRenderPass->maFieldType = sTextFieldType;
+ mpCurrentRenderPass->mpObject = pObject;
+ closeRenderPass();
+
+ // Collect text field content if it's visible
+ // Both checks are needed!
+ if (bVisible && bIsTextFieldVisible)
+ {
+ RenderPass aTextFieldPass;
+ aTextFieldPass.maObjectsAndParagraphs.emplace(pObject, std::deque<sal_Int32>());
+ aTextFieldPass.meStage = RenderStage::TextFields;
+ aTextFieldPass.maFieldType = sTextFieldType;
+ aTextFieldPass.mpObject = pObject;
+
+ mrRenderState.maTextFields.push_back(aTextFieldPass);
+ }
+ return;
+ }
+
+ if (!bVisible)
+ return;
+
// We switched from master objects to slide objects
if (eCurrentStage == RenderStage::Slide && mePreviousStage == RenderStage::Master)
closeRenderPass();
- OUString sTextFieldString = getMasterTextFieldString(pObject);
-
// check if object is in an animation
auto aIterator = mrRenderState.maAnimationRenderInfoList.find(pObject);
if (aIterator != mrRenderState.maAnimationRenderInfoList.end())
@@ -382,36 +444,6 @@ public:
closeRenderPass();
}
}
- // Check if the object has slide number, footer, date/time
- else if (eCurrentStage == RenderStage::Master && !sTextFieldString.isEmpty())
- {
- closeRenderPass();
-
- mpCurrentRenderPass->maObjectsAndParagraphs.emplace(pObject, std::deque<sal_Int32>());
- mpCurrentRenderPass->meStage = eCurrentStage;
- mpCurrentRenderPass->mbPlaceholder = true;
- mpCurrentRenderPass->maFieldType = sTextFieldString;
- mpCurrentRenderPass->mpObject = pObject;
- closeRenderPass();
-
- RenderPass aTextFieldPass;
- aTextFieldPass.maObjectsAndParagraphs.emplace(pObject, std::deque<sal_Int32>());
- aTextFieldPass.meStage = RenderStage::TextFields;
- aTextFieldPass.maFieldType = sTextFieldString;
- aTextFieldPass.mpObject = pObject;
-
- mrRenderState.maTextFields.push_back(aTextFieldPass);
- }
- // Check if the object has fields
- else if (eCurrentStage == RenderStage::Master && hasFields(pObject))
- {
- closeRenderPass();
-
- mpCurrentRenderPass->maObjectsAndParagraphs.emplace(pObject, std::deque<sal_Int32>());
- mpCurrentRenderPass->meStage = eCurrentStage;
- mpCurrentRenderPass->mpObject = pObject;
- closeRenderPass();
- }
// No special handling is needed, just add the object to the current rendering pass
else
{
@@ -457,7 +489,10 @@ public:
auto const& rParagraphs = aIterator->second;
- if (!rParagraphs.empty())
+ // A render pass for the non-animated part of a text shapes whose paragraphs are all animated
+ // has no paragraphs (rParagraphs.empty()) anyway it still needs to be modified in order to
+ // render the text shape background only; on the contrary it will render all paragraphs.
+ if (!rParagraphs.empty() || mrRenderPass.mbRenderObjectBackground)
{
auto const& rViewInformation2D = rOriginal.GetObjectContact().getViewInformation2D();
auto rContainer
@@ -746,12 +781,16 @@ void SlideshowLayerRenderer::writeJSON(OString& rJsonMsg, RenderPass const& rRen
{
auto aContentNode = aJsonWriter.startNode("content");
aJsonWriter.put("type", rRenderPass.maFieldType);
+ std::string sHash = pObject ? std::to_string(pObject->GetUniqueID()) : "";
+ aJsonWriter.put("hash", sHash);
}
}
else if (rRenderPass.meStage == RenderStage::TextFields)
{
auto aContentNode = aJsonWriter.startNode("content");
aJsonWriter.put("type", rRenderPass.maFieldType);
+ std::string sHash = pObject ? std::to_string(pObject->GetUniqueID()) : "";
+ aJsonWriter.put("hash", sHash);
writeContentNode(aJsonWriter);
}
else
@@ -766,7 +805,8 @@ void SlideshowLayerRenderer::writeJSON(OString& rJsonMsg, RenderPass const& rRen
maRenderState.incrementIndex();
}
-bool SlideshowLayerRenderer::render(unsigned char* pBuffer, double& rScale, OString& rJsonMsg)
+bool SlideshowLayerRenderer::render(unsigned char* pBuffer, bool& bIsBitmapLayer, double& rScale,
+ OString& rJsonMsg)
{
// We want to render one pass (one iteration through objects)
@@ -780,6 +820,8 @@ bool SlideshowLayerRenderer::render(unsigned char* pBuffer, double& rScale, OStr
createViewAndDraw(aRenderContext, &aRedirector);
aRedirector.finalizeRenderPasses();
+ bIsBitmapLayer = true;
+
// Write JSON for the Background layer
writeBackgroundJSON(rJsonMsg);
@@ -792,7 +834,9 @@ bool SlideshowLayerRenderer::render(unsigned char* pBuffer, double& rScale, OStr
auto const& rRenderPass = maRenderState.maRenderPasses.front();
maRenderState.meStage = rRenderPass.meStage;
- if (!rRenderPass.mbPlaceholder) // no need to render if placehodler
+
+ bIsBitmapLayer = !rRenderPass.mbPlaceholder;
+ if (bIsBitmapLayer) // no need to render if placeholder
{
RenderPassObjectRedirector aRedirector(maRenderState, rRenderPass);
createViewAndDraw(aRenderContext, &aRedirector);
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 5a75fb1c005b..a2fff3370033 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -4790,12 +4790,11 @@ bool SdXImpressDocument::renderNextSlideLayer(unsigned char* pBuffer, bool& bIsB
return bDone;
OString sMsg;
- bool bOK = mpSlideshowLayerRenderer->render(pBuffer, rScale, sMsg);
+ bool bOK = mpSlideshowLayerRenderer->render(pBuffer, bIsBitmapLayer, rScale, sMsg);
if (bOK)
{
rJsonMsg = OUString::fromUtf8(sMsg);
- bIsBitmapLayer = true;
bDone = false;
}
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index b571625484f0..1ed27775501b 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -92,6 +92,8 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateClipboardDat
// #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get
// fat lines correctly
const ::tools::Rectangle aMarkRect( GetAllMarkedBoundRect() );
+ // tdf#118171 - snap rectangles of objects without line width
+ const ::tools::Rectangle aMarkBoundRect(GetAllMarkedRect());
std::unique_ptr<TransferableObjectDescriptor> pObjDesc(new TransferableObjectDescriptor);
SdrOle2Obj* pSdrOleObj = nullptr;
SdrPageView* pPgView = GetSdrPageView();
@@ -135,6 +137,7 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateClipboardDat
pObjDesc->maSize = aMarkRect.GetSize();
pTransferable->SetStartPos( aMarkRect.TopLeft() );
+ pTransferable->SetBoundStartPos(aMarkBoundRect.TopLeft());
pTransferable->SetObjectDescriptor( std::move(pObjDesc) );
pTransferable->CopyToClipboard( mpViewSh->GetActiveWindow() );
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 37455c28b1bb..fa3d7c3d2e8a 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -652,11 +652,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
pWorkPage->SetSdrObjListRectsDirty();
- // #i120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
+ // tdf#118171 - snap rectangles of objects without line width
+ const Size aSize(pWorkPage->GetAllObjSnapRect().GetSize());
- maDropPos.setX( pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ) );
- maDropPos.setY( pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ) );
+ maDropPos.setX( pOwnData->GetBoundStartPos().X() + ( aSize.Width() >> 1 ) );
+ maDropPos.setY( pOwnData->GetBoundStartPos().Y() + ( aSize.Height() >> 1 ) );
// delete pages, that are not of any interest for us
for( ::tools::Long i = pWorkModel->GetPageCount() - 1; i >= 0; i-- )
@@ -838,11 +838,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( pOwnData )
{
- // #i120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
+ // tdf#118171 - snap rectangles of objects without line width
+ const Size aSize(pWorkPage->GetAllObjSnapRect().GetSize());
- maDropPos.setX( pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ) );
- maDropPos.setY( pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ) );
+ maDropPos.setX( pOwnData->GetBoundStartPos().X() + ( aSize.Width() >> 1 ) );
+ maDropPos.setY( pOwnData->GetBoundStartPos().Y() + ( aSize.Height() >> 1 ) );
}
bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions);
@@ -912,11 +912,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( pOwnData )
{
- // #i120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
+ // tdf#118171 - snap rectangles of objects without line width
+ const Size aSize(pWorkPage->GetAllObjSnapRect().GetSize());
- maDropPos.setX( pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ) );
- maDropPos.setY( pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ) );
+ maDropPos.setX( pOwnData->GetBoundStartPos().X() + ( aSize.Width() >> 1 ) );
+ maDropPos.setY( pOwnData->GetBoundStartPos().Y() + ( aSize.Height() >> 1 ) );
}
// delete pages, that are not of any interest for us
@@ -1238,11 +1238,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
pWorkPage->SetSdrObjListRectsDirty();
- // #i120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
+ // tdf#118171 - snap rectangles of objects without line width
+ const Size aSize(pWorkPage->GetAllObjSnapRect().GetSize());
- aInsertPos.setX( pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ) );
- aInsertPos.setY( pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ) );
+ aInsertPos.setX( pOwnData->GetBoundStartPos().X() + ( aSize.Width() >> 1 ) );
+ aInsertPos.setY( pOwnData->GetBoundStartPos().Y() + ( aSize.Height() >> 1 ) );
}
// restrict movement to WorkArea
@@ -1270,11 +1270,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
pWorkPage->SetSdrObjListRectsDirty();
- // #i120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
+ // tdf#118171 - snap rectangles of objects without line width
+ const Size aSize(pWorkPage->GetAllObjSnapRect().GetSize());
- aInsertPos.setX( pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ) );
- aInsertPos.setY( pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ) );
+ aInsertPos.setX( pOwnData->GetBoundStartPos().X() + ( aSize.Width() >> 1 ) );
+ aInsertPos.setY( pOwnData->GetBoundStartPos().Y() + ( aSize.Height() >> 1 ) );
}
bReturn = InsertMetaFile( rDataHelper, aInsertPos, pImageMap.get(), nFormat == SotClipboardFormatId::NONE );
@@ -1319,11 +1319,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
pWorkPage->SetSdrObjListRectsDirty();
- // #i120393# Clipboard data uses full object geometry range
- const Size aSize( pWorkPage->GetAllObjBoundRect().GetSize() );
+ // tdf#118171 - snap rectangles of objects without line width
+ const Size aSize(pWorkPage->GetAllObjSnapRect().GetSize());
- aInsertPos.setX( pOwnData->GetStartPos().X() + ( aSize.Width() >> 1 ) );
- aInsertPos.setY( pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ) );
+ aInsertPos.setX( pOwnData->GetBoundStartPos().X() + ( aSize.Width() >> 1 ) );
+ aInsertPos.setY( pOwnData->GetBoundStartPos().Y() + ( aSize.Height() >> 1 ) );
}
// restrict movement to WorkArea