summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf165670.pptxbin0 -> 33317 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml3.cxx25
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx12
-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/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.cxx14
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx3
13 files changed, 76 insertions, 27 deletions
diff --git a/sd/qa/unit/data/pptx/tdf165670.pptx b/sd/qa/unit/data/pptx/tdf165670.pptx
new file mode 100644
index 000000000000..66e7c54041f5
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf165670.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx
index 7d06160b4ce2..639a64555566 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -27,6 +27,31 @@ public:
int testTdf115005_FallBack_Images(bool bAddReplacementImages);
};
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf165670)
+{
+ createSdImpressDoc("pptx/tdf165670.pptx");
+ save(u"Impress Office Open XML"_ustr);
+
+ xmlDocUniquePtr pXmlDoc1 = parseExport(u"ppt/slides/slide1.xml"_ustr);
+
+ // glue points export
+ // without the fix in place, this test would have failed with
+ // - Expected: "*/ 690465 w 2407298"
+ // - Actual : "*/ 1917.97586131837 w 5236"
+ assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:gdLst/a:gd[5]", "name",
+ u"GluePoint1X");
+ assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:gdLst/a:gd[5]", "fmla",
+ u"*/ 690465 w 2407298");
+
+ // without the fix in place, this test would have failed with
+ // - Expected: "*/ 802433 h 1884784"
+ // - Actual : "*/ 2229.18869642357 h 6687"
+ assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:gdLst/a:gd[6]", "name",
+ u"GluePoint1Y");
+ assertXPath(pXmlDoc1, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:gdLst/a:gd[6]", "fmla",
+ u"*/ 802433 h 1884784");
+}
+
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf165262)
{
createSdImpressDoc("ppt/tdf165262.ppt");
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 76c449705e01..17f55ae25122 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -3157,11 +3157,11 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_SlideNu
{
std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4);
- bool bIsBitmapLayer = false;
+ bool bIsBitmapLayer = true;
OUString aJson;
double dScale = 1.0;
CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson));
- CPPUNIT_ASSERT(bIsBitmapLayer);
+ CPPUNIT_ASSERT(!bIsBitmapLayer);
debugWriteImageToFile(1, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr());
@@ -3180,11 +3180,11 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_SlideNu
{
std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4);
- bool bIsBitmapLayer = false;
+ bool bIsBitmapLayer = true;
OUString aJson;
double dScale = 1.0;
CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson));
- CPPUNIT_ASSERT(bIsBitmapLayer);
+ CPPUNIT_ASSERT(!bIsBitmapLayer);
debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr());
@@ -3203,11 +3203,11 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_SlideNu
{
std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4);
- bool bIsBitmapLayer = false;
+ bool bIsBitmapLayer = true;
OUString aJson;
double dScale = 1.0;
CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson));
- CPPUNIT_ASSERT(bIsBitmapLayer);
+ CPPUNIT_ASSERT(!bIsBitmapLayer);
debugWriteImageToFile(3, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr());
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/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..8a4c7e6dfbbe 100644
--- a/sd/source/ui/tools/SlideshowLayerRenderer.cxx
+++ b/sd/source/ui/tools/SlideshowLayerRenderer.cxx
@@ -457,7 +457,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
@@ -766,7 +769,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 +784,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 +798,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;
}