27#include <com/sun/star/document/PrinterIndependentLayout.hpp>
31#include <svx/svxids.hrc>
32#include <editeng/editeng.hxx>
48#include <com/sun/star/drawing/XDrawPage.hpp>
49#include <com/sun/star/drawing/XDrawView.hpp>
83using ::sd::framework::FrameworkHelper;
101 SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
102 SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
103 ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT>>(
GetPool() );
108 (aPrintItem.GetOptionsPrint().IsWarningSize() ? SfxPrinterChangeFlags::CHG_SIZE : SfxPrinterChangeFlags::NONE) |
109 (aPrintItem.GetOptionsPrint().IsWarningOrientation() ? SfxPrinterChangeFlags::CHG_ORIENTATION : SfxPrinterChangeFlags::NONE);
110 aFlagItem.
SetValue(
static_cast<int>(nFlags) );
112 pSet->Put( aPrintItem );
113 pSet->Put(
SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.GetOptionsPrint().IsWarningPrinter() ) );
114 pSet->Put( aFlagItem );
120 sal_uInt16 nQuality = aPrintItem.GetOptionsPrint().GetOutputQuality();
125 nMode = DrawModeFlags::GrayLine | DrawModeFlags::GrayFill | DrawModeFlags::GrayText | DrawModeFlags::GrayBitmap | DrawModeFlags::GrayGradient;
126 else if( nQuality == 2 )
127 nMode = DrawModeFlags::BlackLine | DrawModeFlags::WhiteFill | DrawModeFlags::BlackText | DrawModeFlags::GrayBitmap | DrawModeFlags::WhiteGradient;
168 pRefDevice =
SD_MOD()->GetVirtualRefDevice();
213 case css::document::PrinterIndependentLayout::DISABLED:
217 case css::document::PrinterIndependentLayout::ENABLED:
218 pRefDevice =
SD_MOD()->GetVirtualRefDevice();
225 SAL_WARN(
"sd",
"DrawDocShell::UpdateRefDevice(): Unexpected printer layout mode");
235 pOutl->SetRefDevice( pRefDevice );
240 pInternalOutl->SetRefDevice( pRefDevice );
277 bool bStartPresentation =
false;
288 rSet.
Get( SID_DOC_STARTPRESENTATION ).GetValue() )
290 bStartPresentation =
true;
351 std::unique_ptr<weld::WaitObject> pWait;
376 uno::Reference<text::XTextRange>
const& xInsertPosition)
378 const OUString aFilterName( rMedium.
GetFilter()->GetFilterName() );
379 if (aFilterName ==
"Impress MS PowerPoint 2007 XML" ||
380 aFilterName ==
"Impress MS PowerPoint 2007 XML AutoPlay" ||
381 aFilterName ==
"Impress MS PowerPoint 2007 XML VBA")
391 EEControlBits nControlWord = rOutl.GetEditEngine().GetControlWord();
392 nControlWord |= EEControlBits::ULSPACESUMMATION;
393 const_cast<EditEngine&
>(rOutl.GetEditEngine()).SetControlWord( nControlWord );
398 if (aFilterName ==
"Impress MS PowerPoint 2007 XML")
409 if (aFilterName ==
"Impress MS PowerPoint 2007 XML" ||
410 aFilterName ==
"Impress MS PowerPoint 2007 XML AutoPlay" ||
411 aFilterName ==
"Impress MS PowerPoint 2007 XML VBA" ||
412 aFilterName ==
"Impress Office Open XML")
425 rSet.
Get( SID_DOC_STARTPRESENTATION ).GetValue() )
444 const OUString aFilterName( rMedium.
GetFilter()->GetFilterName() );
446 bool bStartPresentation =
false;
457 rSet.
Get( SID_DOC_STARTPRESENTATION ).GetValue() )
459 bStartPresentation =
true;
470 else if (aFilterName.indexOf(
"impress8") >= 0 ||
471 aFilterName.indexOf(
"draw8") >= 0)
480 else if (aFilterName.indexOf(
"StarOffice XML (Draw)") >= 0 ||
481 aFilterName.indexOf(
"StarOffice XML (Impress)") >= 0)
489 else if (aFilterName ==
"CGM - Computer Graphics Metafile")
495 else if (aFilterName ==
"draw_pdf_import")
553 if (
vcl::Window* pSysWin = pFrame1->GetWindow().GetSystemWindow())
555 pSysWin->SetAccessibleName(OUString());
568 if( pObj && pOutl && pOutl->IsModified() )
572 pOutl->ClearModifyFlag();
601 std::shared_ptr<const SfxFilter> pMediumFilter = rMedium.
GetFilter();
602 const OUString aTypeName( pMediumFilter->GetTypeName() );
603 std::unique_ptr<SdFilter> xFilter;
605 if( aTypeName.indexOf(
"graphic_HTML" ) >= 0 )
607 xFilter = std::make_unique<SdHTMLFilter>(rMedium, *
this);
609 else if( aTypeName.indexOf(
"MS_PowerPoint_97" ) >= 0 )
611 xFilter = std::make_unique<SdPPTFilter>(rMedium, *
this);
612 static_cast<SdPPTFilter*
>(xFilter.get())->PreSaveBasic();
614 else if ( aTypeName.indexOf(
"CGM_Computer_Graphics_Metafile" ) >= 0 )
616 xFilter = std::make_unique<SdCGMFilter>(rMedium, *
this);
618 else if( aTypeName.indexOf(
"draw8" ) >= 0 ||
619 aTypeName.indexOf(
"impress8" ) >= 0 )
621 xFilter = std::make_unique<SdXMLFilter>(rMedium, *
this);
623 else if( aTypeName.indexOf(
"StarOffice_XML_Impress" ) >= 0 ||
624 aTypeName.indexOf(
"StarOffice_XML_Draw" ) >= 0 )
630 xFilter = std::make_unique<SdGRFFilter>(rMedium, *
this);
642 bRet = xFilter->Export();
665 ->GetOutliner().ClearModifyFlag();
674 pOutl->ClearModifyFlag();
703 bool bIsMasterPage =
false;
707 static constexpr std::u16string_view sInteraction(
u"action?" );
710 static constexpr std::u16string_view sJump(
u"jump=" );
713 std::u16string_view aDestination( rBookmark.substr( sInteraction.size() + sJump.size() ) );
724 SdPage* pPage = pDrawViewShell->GetActualPage();
730 SdPage* pPage = pDrawViewShell->GetActualPage();
770 if (eNewPageKind != pDrawViewShell->GetPageKind())
775 switch (eNewPageKind)
778 sViewURL = FrameworkHelper::msImpressViewURL;
781 sViewURL = FrameworkHelper::msNotesViewURL;
784 sViewURL = FrameworkHelper::msHandoutViewURL;
789 if (!sViewURL.isEmpty())
791 std::shared_ptr<FrameworkHelper> pHelper (
792 FrameworkHelper::Instance(rBase));
793 pHelper->RequestView(
795 FrameworkHelper::msCenterPaneURL);
796 pHelper->WaitForUpdate();
804 pDrawViewShell =
nullptr;
808 if (pDrawViewShell !=
nullptr)
816 sal_uInt16 nSdPgNum = (nPageNumber - 1) / 2;
820 Reference<drawing::XDrawPage> xDrawPage (pPage->
getUnoPage(), UNO_QUERY);
827 "DrawDocShell::GotoBookmark: can't switch page via API");
828 pDrawViewShell->SwitchPage(nSdPgNum);
833 pDrawViewShell->GetView()->UnmarkAll();
837 if (
vcl::Window* pWindow = pDrawViewShell->GetActiveWindow())
838 pDrawViewShell->MakeVisible(pObj->
GetSnapRect(), *pWindow);
839 pDrawViewShell->GetView()->MarkObj(
841 pDrawViewShell->GetView()->GetSdrPageView());
846 if (
SfxViewFrame* pViewFrame = (pDrawViewShell && pDrawViewShell->GetViewFrame())
847 ? pDrawViewShell->GetViewFrame()
850 SfxBindings& rBindings = pViewFrame->GetBindings();
851 rBindings.
Invalidate(SID_NAVIGATOR_STATE,
true);
862 std::shared_ptr<const SfxFilter> pFilter = rMedium.
GetFilter();
864 if (pFilter->IsOwnTemplateFormat())
873 OUString aLayoutName;
878 aLayoutName = pLayoutItem->
GetValue();
883 aURL.removeExtension();
884 aLayoutName =
aURL.getName();
887 if (aLayoutName.isEmpty())
893 OUString aNewLayoutName = aLayoutName;
896 aNewLayoutName += OUString::number(
i);
908 OUString* pFullTypeName,
909 sal_Int32 nFileFormat,
910 bool bTemplate )
const
917 *pFormat = SotClipboardFormatId::STARDRAW_60;
918 *pFullTypeName =
SdResId(STR_GRAPHIC_DOCUMENT_FULLTYPE_60);
923 *pFormat = SotClipboardFormatId::STARIMPRESS_60;
924 *pFullTypeName =
SdResId(STR_IMPRESS_DOCUMENT_FULLTYPE_60);
932 *pFormat = bTemplate ? SotClipboardFormatId::STARDRAW_8_TEMPLATE : SotClipboardFormatId::STARDRAW_8;
933 *pFullTypeName =
SdResId(STR_GRAPHIC_DOCUMENT_FULLTYPE_80);
938 *pFormat = bTemplate ? SotClipboardFormatId::STARIMPRESS_8_TEMPLATE : SotClipboardFormatId::STARIMPRESS_8;
939 *pFullTypeName =
SdResId(STR_IMPRESS_DOCUMENT_FULLTYPE_80);
949 if (pReferenceDevice ==
nullptr &&
mpDoc !=
nullptr)
951 return pReferenceDevice;
960 const SfxPoolItem* ppArgs[] = { &aStrItem, &aReferer,
nullptr };
962 pFrame->GetBindings().Execute( SID_OPENHYPERLINK, ppArgs );
967 std::shared_ptr<SfxDocumentInfoDialog> xDlg = std::make_shared<SfxDocumentInfoDialog>(pParent,
rSet);
971 xDlg->AddFontTabPage();
const OUString & GetValue() const
void SetMapUnit(MapUnit eUnit)
const OUString & GetName() const
const JobSetup & GetJobSetup() const
void CreateFirstPages(SdDrawDocument const *pRefDocument=nullptr)
if the document does not contain at least one handout, one slide and one notes page with at least one...
sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const
SAL_DLLPRIVATE void setDocAccTitle(const OUString &rTitle)
SAL_DLLPRIVATE void SetSummationOfParagraphs(bool bOn=true)
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
SdOutliner * GetInternalOutliner(bool bCreateOutliner=true)
SAL_DLLPRIVATE SdOutliner * GetOutliner(bool bCreateOutliner=true)
void StopWorkStartupDelay()
SAL_DLLPRIVATE void NbcSetChanged(bool bFlag)
SAL_DLLPRIVATE sal_uInt16 GetPageByName(std::u16string_view rPgName, bool &rbIsMasterPage) const
Return the first page that has the given name.
SAL_DLLPRIVATE void RenameLayoutTemplate(const OUString &rOldLayoutName, const OUString &rNewName)
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
SAL_DLLPRIVATE SdrObject * GetObj(std::u16string_view rObjName) const
SAL_DLLPRIVATE void NewOrLoadCompleted(DocCreationMode eMode)
SAL_DLLPRIVATE sal_Int32 GetPrinterIndependentLayout() const
Get the flag that controls whether the formatting of the document depends on the current printer metr...
SAL_DLLPRIVATE void SetStartWithPresentation(bool bStartWithPresentation)
SAL_DLLPRIVATE DocumentType GetDocumentType() const
The main purpose of this class is searching and replacing as well as spelling of impress documents.
bool Import()
these methods are necessary for the export to PowerPoint
PageKind GetPageKind() const
std::shared_ptr< sd::MainSequence > const & getMainSequence()
returns a helper class to manipulate effects inside the main sequence
virtual OUString GetLayoutName() const override
bool Import(ErrCode &nError)
void SetCompatibilityFlag(SdrCompatibilityFlag eFlag, bool bEnabled)
const SdrPage * GetMasterPage(sal_uInt16 nPgNum) const
void SetRefDevice(OutputDevice *pDev)
void SetDefaultTabulator(sal_uInt16 nVal)
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
SfxStyleSheetBasePool * GetStyleSheetPool() const
OutputDevice * GetRefDevice() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
sal_uInt16 GetPageCount() const
void SetStarDrawPreviewMode(bool bPreview)
SdrTextObj * GetTextEditObject() const
virtual bool IsTextEdit() const final override
const SdrOutliner * GetTextEditOutliner() const
const tools::Rectangle & GetAllObjBoundRect() const
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
virtual const tools::Rectangle & GetSnapRect() const
SdrPage * getSdrPageFromSdrObject() const
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
sal_uInt16 GetPageNum() const
void Invalidate(sal_uInt16 nId)
void SetValue(sal_uInt16 nNewVal)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const std::shared_ptr< const SfxFilter > & GetFilter() const
SfxItemSet & GetItemSet() const
const OUString & GetName() const
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
virtual bool ImportFrom(SfxMedium &rMedium, css::uno::Reference< css::text::XTextRange > const &xInsertPosition)
virtual bool InitNew(const css::uno::Reference< css::embed::XStorage > &xStorage)
void SetWaitCursor(bool bSet) const
void SetError(ErrCode rErr)
virtual OutputDevice * GetDocumentRefDev()
virtual bool Load(SfxMedium &rMedium)
void SetAutoLoad(const INetURLObject &, sal_uInt32 nTime, bool bReload)
static bool IsOwnStorageFormat(const SfxMedium &)
virtual bool SaveAs(SfxMedium &rMedium)
virtual void SetVisArea(const tools::Rectangle &rVisArea)
virtual bool SaveCompleted(const css::uno::Reference< css::embed::XStorage > &xStorage)
void FinishedLoading(SfxLoadedFlags nWhich=SfxLoadedFlags::ALL)
virtual bool SaveAsOwnFormat(SfxMedium &pMedium)
SfxMedium * GetMedium() const
css::uno::Reference< css::embed::XStorage > const & GetStorage()
const tools::Rectangle & GetVisArea() const
SfxObjectCreateMode GetCreateMode() const
virtual comphelper::EmbeddedObjectContainer & getEmbeddedObjectContainer() const override
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
void PutItem(const SfxPoolItem &rItem)
SfxItemPool & GetPool() const
const OUString & GetName() const
SfxViewShell * GetViewShell() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
css::uno::Reference< css::frame::XController > GetController() const
sal_Int32 GetVersion() const
reference_type * get() const
static VclPtr< reference_type > Create(Arg &&... arg)
void setUserAllowsLinkUpdate(bool bNew)
#define SO3_SDRAW_CLASSID_60
#define SO3_SIMPRESS_CLASSID_60
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
void SetPrinter(SfxPrinter *pNewPrinter)
Set new SfxPrinter (transfer of ownership)
virtual OutputDevice * GetDocumentRefDev() override
Return the reference device for the current document.
virtual bool Load(SfxMedium &rMedium) override
loads pools and document
static void setEditMode(DrawViewShell *pDrawViewShell, bool isMasterPage)
virtual void FillClass(SvGlobalName *pClassName, SotClipboardFormatId *pFormat, OUString *pFullTypeName, sal_Int32 nFileFormat, bool bTemplate=false) const override
virtual bool InitNew(const css::uno::Reference< css::embed::XStorage > &xStorage) override
Creates new document, opens streams.
::sd::FrameView * GetFrameView()
virtual bool Save() override
Writes pools and document to the open streams.
virtual Printer * GetDocumentPrinter() override
virtual std::shared_ptr< SfxDocumentInfoDialog > CreateDocumentInfoDialog(weld::Window *pParent, const SfxItemSet &rSet) override
void GotoBookmark(std::u16string_view rBookmark)
virtual bool ConvertTo(SfxMedium &rMedium) override
save to foreign format
::sd::ViewShell * mpViewShell
std::unique_ptr< FontList > mpFontList
virtual bool LoadFrom(SfxMedium &rMedium) override
loads content for organizer
VclPtr< SfxPrinter > mpPrinter
virtual void OnDocumentPrinterChanged(Printer *pNewPrinter) override
SfxPrinter * GetPrinter(bool bCreate)
Creates (if necessary) and returns a SfxPrinter.
virtual bool ConvertFrom(SfxMedium &rMedium) override
load from a foreign format
virtual bool SaveAs(SfxMedium &rMedium) override
Writes pools and document to the provided storage.
virtual bool ImportFrom(SfxMedium &rMedium, css::uno::Reference< css::text::XTextRange > const &xInsertPosition) override
load from 3rd party format
virtual bool SaveCompleted(const css::uno::Reference< css::embed::XStorage > &xStorage) override
Reopen own streams to ensure that nobody else can prevent use from opening them.
void OpenBookmark(const OUString &rBookmarkURL)
executes the SID_OPENDOC slot to let the framework open a document with the given URL and this docume...
SdDrawDocument * GetDoc()
virtual bool SaveAsOwnFormat(SfxMedium &rMedium) override
If it should become a document template.
void UpdateTablePointers()
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
EditMode GetEditMode() const
virtual void ChangeEditMode(EditMode eMode, bool bIsLayerModeActive)
Set status (enabled/disabled) of menu SfxSlots.
static void DocumentLoaded(SdDrawDocument &rDoc)
void SetPageKind(PageKind eKind)
Show a textual overview of the text contents of all slides.
Derivative of sd::View for the outline mode |* .
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
virtual SdPage * getCurrentPage() const =0
::sd::View * GetView() const
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
#define DBG_ASSERT(sCon, aError)
constexpr OUStringLiteral pFilterPowerPoint97AutoPlay(u"MS PowerPoint 97 AutoPlay")
constexpr OUStringLiteral pFilterPowerPoint97(u"MS PowerPoint 97")
constexpr OUStringLiteral pFilterPowerPoint97Template(u"MS PowerPoint 97 Vorlage")
#define ERRCODE_IO_BROKENPACKAGE
#define SAL_WARN(area, stream)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
OUString SdResId(TranslateId aId)
@ Normal
standard load and save of the complete document
@ Organizer
only for import, only the styles are loaded
Reference< XController > xController