20#include <config_wasm_strip.h>
25#include <com/sun/star/frame/XModel.hpp>
26#include <com/sun/star/lang/XMultiServiceFactory.hpp>
27#include <com/sun/star/uno/XComponentContext.hpp>
28#include <com/sun/star/document/XUndoManager.hpp>
29#include <com/sun/star/document/XUndoManagerSupplier.hpp>
38#include <svx/strings.hrc>
47#include <oox/token/tokens.hxx>
54using ::com::sun::star::beans::PropertyValue;
55using ::com::sun::star::lang::XComponent;
59#if OSL_DEBUG_LEVEL > 0
65#
if ENABLE_WASM_STRIP_CHART
72#if OSL_DEBUG_LEVEL > 0
88 uno::Reference< document::XUndoManagerSupplier > xUndoManagerSupplier (
getModel(), UNO_QUERY );
89 uno::Reference< util::XLockable > xUndoManager;
90 bool bWasUnLocked =
true;
91 if(xUndoManagerSupplier.is())
93 xUndoManager = xUndoManagerSupplier->getUndoManager();
96 bWasUnLocked = !xUndoManager->isLocked();
105 maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc(
u"tableStyles" );
106 const OUString sPresPropsPath
107 = xPresentationFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc(
u"presProps");
110 if (bRet && !sPresPropsPath.isEmpty())
117 static bool bNoSmartartWarning = getenv(
"OOX_NO_SMARTART_WARNING");
125 aWarning +=
":\n" +
SvxResId(RID_SVXSTR_WARN_MISSING_SMARTART);
129 VclMessageType::Warning, VclButtonsType::Ok,
134 if(xUndoManager.is() && bWasUnLocked)
135 xUndoManager->unlock();
151 bool bColorMapped =
false;
154 bColorMapped = pClrMapPtr->getColorMap(
nToken );
159 if ( pMasterPersist )
161 pClrMapPtr = pMasterPersist->getClrMap();
163 pClrMapPtr->getColorMap(
nToken );
170 pTheme->getClrScheme().getColor(
nToken, nColor );
174 SAL_WARN(
"oox",
"OOX: PowerPointImport::mpThemePtr is NULL");
192 if( XmlFilterBase::filter( rDescriptor ) )
203 Reference<css::lang::XMultiServiceFactory> aFactory(
getComponentContext()->getServiceManager(), UNO_QUERY_THROW);
204 Reference< XExporter > xExporter(aFactory->createInstanceWithArguments(
"com.sun.star.comp.Impress.oox.PowerPointExport",
aArguments), UNO_QUERY);
206 if (Reference<XFilter> xFilter{ xExporter, UNO_QUERY })
208 Reference<util::XLockable> xUndoManager;
209 bool bWasUnLocked =
true;
210 if (Reference<document::XUndoManagerSupplier> xUMS{
getModel(), UNO_QUERY })
212 xUndoManager = xUMS->getUndoManager();
213 if (xUndoManager.is())
215 bWasUnLocked = !xUndoManager->isLocked();
216 xUndoManager->lock();
220 if (xUndoManager && bWasUnLocked)
221 xUndoManager->unlock();
224 Reference< XComponent > xDocument =
getModel();
225 xExporter->setSourceDocument(xDocument);
226 if (xFilter->filter(rDescriptor))
243 mpTableStyleList = std::make_shared<oox::drawingml::table::TableStyleList>( );
261 virtual ::Color getSchemeColor( sal_Int32 nToken )
const override;
262 virtual sal_Int32 getDefaultChartAreaFillStyle()
const override;
267PptGraphicHelper::PptGraphicHelper(
const PowerPointImport& rFilter ) :
273::Color PptGraphicHelper::getSchemeColor( sal_Int32 nToken )
const
275 return mrFilter.getSchemeColor( nToken );
278sal_Int32 PptGraphicHelper::getDefaultChartAreaFillStyle()
const
287 return new PptGraphicHelper( *
this );
295OUString PowerPointImport::getImplementationName()
297 return "com.sun.star.comp.oox.ppt.PowerPointImport";
302extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
304 uno::XComponentContext* pCtx, uno::Sequence<uno::Any>
const& )
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
bool GetString(ErrCode nErrId, OUString &rStr) override
Provides helper functions for colors, device measurement conversion, graphics, and graphic objects ha...
const OUString & getFileUrl() const
Returns the URL of the imported or exported file.
bool isExportFilter() const
Returns true, if filter is an export filter.
const css::uno::Reference< css::frame::XModel > & getModel() const
Returns the document model (always existing).
bool isExportTemplate() const
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext() const
Returns the component context passed in the filter constructor (always existing).
void importDocumentProperties()
Read the document properties and also the customXml entries (xlsx and pptx only).
OUString getFragmentPathFromFirstTypeFromOfficeDoc(std::u16string_view rPart)
bool importFragment(const rtl::Reference< FragmentHandler > &rxHandler)
Imports a fragment using the passed fragment handler, which contains the full path to the fragment st...
::Color getSchemeColor(sal_Int32 nToken) const
std::shared_ptr< ::oox::drawingml::chart::ChartConverter > mxChartConv
virtual ::oox::vml::Drawing * getVmlDrawing() override
Has to be implemented by each filter to return the collection of VML shapes.
virtual oox::drawingml::table::TableStyleListPtr getTableStyles() override
Has to be implemented by each filter to return the table style list.
oox::drawingml::table::TableStyleListPtr mpTableStyleList
static XmlFilterBase * mpDebugFilterBase
virtual sal_Bool SAL_CALL filter(const css::uno::Sequence< css::beans::PropertyValue > &rDescriptor) override
virtual bool importDocument() override
Derived classes implement import of the entire document.
virtual std::shared_ptr<::oox::drawingml::Theme > getCurrentThemePtr() const override
May be implemented by filters which handle Diagrams, default returns empty ptr.
virtual ::oox::drawingml::chart::ChartConverter * getChartConverter() override
Has to be implemented by each filter, returns a filter-specific chart converter object,...
SlidePersistPtr mpActualSlidePersist
PowerPointImport(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
OUString maTableStyleListPath
virtual bool exportDocument() noexcept override
Derived classes implement export of the entire document.
virtual const ::oox::drawingml::Theme * getCurrentTheme() const override
Has to be implemented by each filter, returns the current theme.
virtual ~PowerPointImport() override
Represents the collection of VML shapes for a complete draw page.
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
#define OOX_DUMP_FILE(DumperClassName)
SVT_DLLPUBLIC const ErrMsgCode RID_ERRCTX[]
Sequence< PropertyValue > aArguments
#define SAL_WARN(area, stream)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
std::shared_ptr< T > make_shared(Args &&... args)
std::shared_ptr< TableStyleList > TableStyleListPtr
std::shared_ptr< Theme > ThemePtr
std::shared_ptr< ClrMap > ClrMapPtr
std::shared_ptr< SlidePersist > SlidePersistPtr
const PowerPointImport & mrFilter
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_oox_ppt_PowerPointImport_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
#define ERRCTX_SFX_OPENDOC