LibreOffice Module sfx2 (master) 1
objcont.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21#include <com/sun/star/uno/Reference.hxx>
22
23#include <com/sun/star/document/DocumentProperties.hpp>
24#include <com/sun/star/document/XDocumentProperties.hpp>
25#include <com/sun/star/document/UpdateDocMode.hpp>
27#include <vcl/svapp.hxx>
28#include <vcl/weld.hxx>
29#include <svl/style.hxx>
30
31#include <svl/intitem.hxx>
32#include <svl/ctloptions.hxx>
35#include <tools/datetime.hxx>
37#include <tools/helpers.hxx>
38#include <rtl/uri.hxx>
39
41#include <vcl/virdev.hxx>
42#include <vcl/settings.hxx>
43#include <vcl/gdimtf.hxx>
44
45#include <sfx2/app.hxx>
46#include <sfx2/dinfdlg.hxx>
47#include <sfx2/sfxresid.hxx>
48#include <appdata.hxx>
49#include <sfx2/docfac.hxx>
50#include <sfx2/viewsh.hxx>
51#include <sfx2/objsh.hxx>
52#include <objshimp.hxx>
53#include <sfx2/printer.hxx>
54#include <sfx2/viewfrm.hxx>
55#include <sfx2/doctempl.hxx>
56#include <sfx2/sfxsids.hrc>
57#include <sfx2/strings.hrc>
58#include <sfx2/docfile.hxx>
59#include <sfx2/docfilt.hxx>
60#include <memory>
61#include <helpids.h>
62
63using namespace ::com::sun::star;
64using namespace ::com::sun::star::uno;
65
66
67static
68bool operator> (const util::DateTime& i_rLeft, const util::DateTime& i_rRight)
69{
70 if ( i_rLeft.Year != i_rRight.Year )
71 return i_rLeft.Year > i_rRight.Year;
72
73 if ( i_rLeft.Month != i_rRight.Month )
74 return i_rLeft.Month > i_rRight.Month;
75
76 if ( i_rLeft.Day != i_rRight.Day )
77 return i_rLeft.Day > i_rRight.Day;
78
79 if ( i_rLeft.Hours != i_rRight.Hours )
80 return i_rLeft.Hours > i_rRight.Hours;
81
82 if ( i_rLeft.Minutes != i_rRight.Minutes )
83 return i_rLeft.Minutes > i_rRight.Minutes;
84
85 if ( i_rLeft.Seconds != i_rRight.Seconds )
86 return i_rLeft.Seconds > i_rRight.Seconds;
87
88 if ( i_rLeft.NanoSeconds != i_rRight.NanoSeconds )
89 return i_rLeft.NanoSeconds > i_rRight.NanoSeconds;
90
91 return false;
92}
93
94std::shared_ptr<GDIMetaFile>
95SfxObjectShell::GetPreviewMetaFile( bool bFullContent ) const
96{
97 auto xFile = std::make_shared<GDIMetaFile>();
99 pDevice->EnableOutput( false );
100 if(!CreatePreview_Impl(bFullContent, pDevice, xFile.get()))
101 return std::shared_ptr<GDIMetaFile>();
102 return xFile;
103}
104
106{
108 pDevice->SetAntialiasing(AntialiasingFlags::Enable | pDevice->GetAntialiasing());
109 if(!CreatePreview_Impl(/*bFullContent*/false, pDevice, nullptr))
110 return BitmapEx();
111 Size size = pDevice->GetOutputSizePixel();
112 BitmapEx aBitmap = pDevice->GetBitmapEx( Point(), size);
113 // Scale down the image to the desired size from the 4*size from CreatePreview_Impl().
114 size = Size( size.Width() / 4, size.Height() / 4 );
115 aBitmap.Scale(size, BmpScaleFlag::BestQuality);
116 if (!aBitmap.IsEmpty())
117 aBitmap.Convert(BmpConversion::N24Bit);
118 return aBitmap;
119}
120
121bool SfxObjectShell::CreatePreview_Impl( bool bFullContent, VirtualDevice* pDevice, GDIMetaFile* pFile) const
122{
123 // DoDraw can only be called when no printing is done, otherwise
124 // the printer may be turned off
125 SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this );
126 if ( pFrame && pFrame->GetViewShell() &&
127 pFrame->GetViewShell()->GetPrinter() &&
128 pFrame->GetViewShell()->GetPrinter()->IsPrinting() )
129 return false;
130
131 MapMode aMode( GetMapUnit() );
132 Size aTmpSize;
133 sal_Int8 nAspect;
134 if ( bFullContent )
135 {
136 nAspect = ASPECT_CONTENT;
137 aTmpSize = GetVisArea( nAspect ).GetSize();
138 }
139 else
140 {
141 nAspect = ASPECT_THUMBNAIL;
142 aTmpSize = GetFirstPageSize();
143 }
144
145 DBG_ASSERT( !aTmpSize.IsEmpty(),
146 "size of first page is 0, override GetFirstPageSize or set visible-area!" );
147
148 if(pFile)
149 {
150 pDevice->SetMapMode( aMode );
151 pFile->SetPrefMapMode( aMode );
152 pFile->SetPrefSize( aTmpSize );
153 pFile->Record( pDevice );
154 }
155 else
156 {
157 // Use pixel size, that's also what DoDraw() requires in this case,
158 // despite the metafile case (needlessly?) setting mapmode.
159 Size aSizePix = pDevice->LogicToPixel( aTmpSize, aMode );
160 // Code based on GDIMetaFile::CreateThumbnail().
161 sal_uInt32 nMaximumExtent = 512;
162 // determine size that has the same aspect ratio as image size and
163 // fits into the rectangle determined by nMaximumExtent
164 if ( aSizePix.Width() && aSizePix.Height()
165 && ( sal::static_int_cast< tools::ULong >(aSizePix.Width()) >
166 nMaximumExtent ||
167 sal::static_int_cast< tools::ULong >(aSizePix.Height()) >
168 nMaximumExtent ) )
169 {
170 double fWH = static_cast< double >( aSizePix.Width() ) / aSizePix.Height();
171 if ( fWH <= 1.0 )
172 {
173 aSizePix.setWidth( FRound( nMaximumExtent * fWH ) );
174 aSizePix.setHeight( nMaximumExtent );
175 }
176 else
177 {
178 aSizePix.setWidth( nMaximumExtent );
179 aSizePix.setHeight( FRound( nMaximumExtent / fWH ) );
180 }
181 }
182 // do it 4x larger to be able to scale it down & get beautiful antialias
183 aTmpSize = Size( aSizePix.Width() * 4, aSizePix.Height() * 4 );
184 pDevice->SetOutputSizePixel( aTmpSize );
185 }
186
187 LanguageType eLang;
191 eLang = LANGUAGE_ENGLISH;
192 else
194
195 pDevice->SetDigitLanguage( eLang );
196
197 const_cast<SfxObjectShell*>(this)->DoDraw( pDevice, Point(0,0), aTmpSize, JobSetup(), nAspect );
198
199 if(pFile)
200 pFile->Stop();
201
202 return true;
203}
204
205
207{
208 uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties());
209
210 // clear user data if recommend (see 'Tools - Options - LibreOffice - Security')
213 {
214 xDocProps->resetUserData( OUString() );
215 }
216 else if ( IsModified() )
217 {
218 const OUString aUserName = SvtUserOptions().GetFullName();
219 if ( !IsUseUserData() )
220 {
221 // remove all data pointing to the current user
222 if (xDocProps->getAuthor() == aUserName) {
223 xDocProps->setAuthor( OUString() );
224 }
225 xDocProps->setModifiedBy( OUString() );
226 if (xDocProps->getPrintedBy() == aUserName) {
227 xDocProps->setPrintedBy( OUString() );
228 }
229 }
230 else
231 {
232 // update ModificationAuthor, revision and editing time
234 xDocProps->setModificationDate( now.GetUNODateTime() );
235 xDocProps->setModifiedBy( aUserName );
236 UpdateTime_Impl( xDocProps );
237 }
238 }
239}
240
241
242static void
243lcl_add(util::Duration & rDur, tools::Time const& rTime)
244{
245 // here we don't care about overflow: rDur is converted back to seconds
246 // anyway, and tools::Time cannot store more than ~4000 hours
247 rDur.Hours += rTime.GetHour();
248 rDur.Minutes += rTime.GetMin();
249 rDur.Seconds += rTime.GetSec();
250}
251
252// Update the processing time
254 const uno::Reference<document::XDocumentProperties> & i_xDocProps)
255{
256 // Get old time from documentinfo
257 const sal_Int32 secs = i_xDocProps->getEditingDuration();
258 util::Duration editDuration(false, 0, 0, 0,
259 secs/3600, (secs%3600)/60, secs%60, 0);
260
261 // Initialize some local member! It's necessary for follow operations!
262 DateTime aNow( DateTime::SYSTEM ); // Date and time at current moment
263 tools::Time n24Time (24,0,0,0) ; // Time-value for 24 hours - see follow calculation
264 tools::Time nAddTime (0) ; // Value to add on aOldTime
265
266 // Save impossible cases!
267 // User has changed time to the past between last editing and now... it's not possible!!!
268 DBG_ASSERT( !(aNow.GetDate()<pImpl->nTime.GetDate()), "Timestamp of last change is in the past!?..." );
269
270 // Do the follow only, if user has NOT changed time to the past.
271 // Else add a time of 0 to aOldTime... !!!
272 if (aNow.GetDate()>=pImpl->nTime.GetDate())
273 {
274 // Count of days between now and last editing
275 sal_Int32 nDays = aNow.GetSecFromDateTime(Date(pImpl->nTime.GetDate()))/86400 ;
276
277 if (nDays==0)
278 {
279 // If no day between now and last editing - calculate time directly.
280 nAddTime = static_cast<const tools::Time&>(aNow) - static_cast<const tools::Time&>(pImpl->nTime);
281 }
282 else if (nDays<=31)
283 {
284 // If time of working without save greater than 1 month (!)...
285 // we add 0 to aOldTime!
286
287 // If 1 or up to 31 days between now and last editing - calculate time indirectly.
288 // nAddTime = (24h - nTime) + (nDays * 24h) + aNow
289 --nDays;
290 nAddTime = tools::Time( nDays * n24Time.GetTime());
291 nAddTime += n24Time-static_cast<const tools::Time&>(pImpl->nTime);
292 nAddTime += aNow ;
293 }
294
295 lcl_add(editDuration, nAddTime);
296 }
297
298 pImpl->nTime = aNow;
299 try {
300 const sal_Int32 newSecs( (editDuration.Hours*3600)
301 + (editDuration.Minutes*60) + editDuration.Seconds);
302 i_xDocProps->setEditingDuration(newSecs);
303 i_xDocProps->setEditingCycles(i_xDocProps->getEditingCycles() + 1);
304 }
305 catch (const lang::IllegalArgumentException &)
306 {
307 // ignore overflow
308 }
309}
310
311std::shared_ptr<SfxDocumentInfoDialog> SfxObjectShell::CreateDocumentInfoDialog(weld::Window* pParent,
312 const SfxItemSet& rSet)
313{
314 return std::make_shared<SfxDocumentInfoDialog>(pParent, rSet);
315}
316
317std::optional<NamedColor> SfxObjectShell::GetRecentColor(sal_uInt16 nSlotId)
318{
319 auto it = pImpl->m_aRecentColors.find(nSlotId);
320 if (it != pImpl->m_aRecentColors.end())
321 return it->second;
322
323 return std::nullopt;
324}
325
326void SfxObjectShell::SetRecentColor(sal_uInt16 nSlotId, const NamedColor& rColor)
327{
328 pImpl->m_aRecentColors[nSlotId] = rColor;
329 Broadcast(SfxHint(SfxHintId::ColorsChanged));
330}
331
333{
334 std::set<Color> empty;
335 return empty;
336}
337
338std::shared_ptr<model::ColorSet> SfxObjectShell::GetThemeColors() { return {}; }
339
341{
343 return aCollection;
344}
345
347{
348 return nullptr;
349}
350
351namespace {
352
353struct Styles_Impl
354{
355 SfxStyleSheetBase *pSource;
356 SfxStyleSheetBase *pDest;
357};
358
359}
360
362(
363 SfxObjectShell &rSource /* the document template from which
364 the styles are to be loaded */
365)
366
367/* [Description]
368
369 This method is called by the SFx if styles are to be loaded from a template.
370 Existing styles are in this case overwritten. The document must then be
371 re-formatted. Therefore, applications usually override this method
372 and call the implementation in the base class.
373*/
374
375{
376 SfxStyleSheetBasePool *pSourcePool = rSource.GetStyleSheetPool();
377 DBG_ASSERT(pSourcePool, "Source-DocumentShell without StyleSheetPool");
379 DBG_ASSERT(pMyPool, "Dest-DocumentShell without StyleSheetPool");
380 auto xIter = pSourcePool->CreateIterator(SfxStyleFamily::All);
381 std::unique_ptr<Styles_Impl[]> pFound(new Styles_Impl[xIter->Count()]);
382 sal_uInt16 nFound = 0;
383
384 SfxStyleSheetBase *pSource = xIter->First();
385 while ( pSource )
386 {
387 SfxStyleSheetBase *pDest =
388 pMyPool->Find( pSource->GetName(), pSource->GetFamily() );
389 if ( !pDest )
390 {
391 pDest = &pMyPool->Make( pSource->GetName(),
392 pSource->GetFamily(), pSource->GetMask());
393 // Setting of parents, the next style
394 }
395 pFound[nFound].pSource = pSource;
396 pFound[nFound].pDest = pDest;
397 ++nFound;
398 pSource = xIter->Next();
399 }
400
401 for ( sal_uInt16 i = 0; i < nFound; ++i )
402 {
403 pFound[i].pDest->GetItemSet().PutExtended(pFound[i].pSource->GetItemSet(), SfxItemState::DONTCARE, SfxItemState::DEFAULT);
404 if(pFound[i].pSource->HasParentSupport())
405 pFound[i].pDest->SetParent(pFound[i].pSource->GetParent());
406 if(pFound[i].pSource->HasFollowSupport())
407 pFound[i].pDest->SetFollow(pFound[i].pSource->GetParent());
408 }
409}
410
412{
413 return nullptr;
414}
415
416namespace
417{
418 class QueryTemplateBox
419 {
420 private:
421 std::unique_ptr<weld::MessageDialog> m_xQueryBox;
422 public:
423 QueryTemplateBox(weld::Window* pParent, const OUString& rMessage)
424 : m_xQueryBox(Application::CreateMessageDialog(pParent, VclMessageType::Question, VclButtonsType::NONE, rMessage))
425 {
426 m_xQueryBox->add_button(SfxResId(STR_QRYTEMPL_UPDATE_BTN), RET_YES);
427 m_xQueryBox->add_button(SfxResId(STR_QRYTEMPL_KEEP_BTN), RET_NO);
428 m_xQueryBox->set_default_response(RET_YES);
430 }
431 short run() { return m_xQueryBox->run(); }
432 };
433}
434
436
437/* [Description]
438
439 This internal method checks whether the document was created from a
440 template, and if this is newer than the document. If this is the case,
441 the user is asked if the Templates (StyleSheets) should be updated.
442 If this is answered positively, the StyleSheets are updated.
443*/
444
445{
446 // Storage-medium?
447 SfxMedium *pFile = GetMedium();
448 DBG_ASSERT( pFile, "cannot UpdateFromTemplate without medium" );
449 if ( !pFile )
450 return;
451
452 if ( !comphelper::isFileUrl( pFile->GetName() ) )
453 // update only for documents loaded from the local file system
454 return;
455
456 // tdf#113935 - do not remove this line - somehow, it makes the process
457 // of switching from viewing a read-only document to opening it in writable
458 // mode much faster.
459 uno::Reference< embed::XStorage > xDocStor = pFile->GetStorage(false);
460
461 // only for own storage formats
462 if ( !pFile->GetFilter() || !pFile->GetFilter()->IsOwnFormat() )
463 return;
464
465 const SfxUInt16Item* pUpdateDocItem = pFile->GetItemSet().GetItem(SID_UPDATEDOCMODE, false);
466 sal_Int16 bCanUpdateFromTemplate = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
467
468 // created from template?
469 uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties());
470 const OUString aTemplName( xDocProps->getTemplateName() );
471 OUString aTemplURL( xDocProps->getTemplateURL() );
472 OUString aFoundName;
473
474 if ( !aTemplName.isEmpty() || (!aTemplURL.isEmpty() && !IsReadOnly()) )
475 {
476 // try to locate template, first using filename this must be done
477 // because writer global document uses this "great" idea to manage
478 // the templates of all parts in the master document but it is NOT
479 // an error if the template filename points not to a valid file
481 if (!aTemplURL.isEmpty())
482 {
483 try {
484 aFoundName = ::rtl::Uri::convertRelToAbs(GetMedium()->GetName(),
485 aTemplURL);
486 } catch (::rtl::MalformedUriException const&) {
487 assert(false); // don't think that's supposed to happen?
488 }
489 }
490
491 if( aFoundName.isEmpty() && !aTemplName.isEmpty() )
492 // if the template filename did not lead to success,
493 // try to get a file name for the logical template name
494 aTempl.GetFull( u"", aTemplName, aFoundName );
495 }
496
497 if ( aFoundName.isEmpty() )
498 return;
499
500 // check existence of template storage
501 aTemplURL = aFoundName;
502
503 // should the document checked against changes in the template ?
504 if ( !IsQueryLoadTemplate() )
505 return;
506
507 bool bLoad = false;
508
509 // load document properties of template
510 bool bOK = false;
511 util::DateTime aTemplDate;
512 try
513 {
514 Reference<document::XDocumentProperties> const
515 xTemplateDocProps( document::DocumentProperties::create(
516 ::comphelper::getProcessComponentContext()));
517 xTemplateDocProps->loadFromMedium(aTemplURL,
518 Sequence<beans::PropertyValue>());
519 aTemplDate = xTemplateDocProps->getModificationDate();
520 bOK = true;
521 }
522 catch (const Exception&)
523 {
524 TOOLS_INFO_EXCEPTION("sfx.doc", "");
525 }
526
527 // if modify date was read successfully
528 if ( bOK )
529 {
530 // compare modify data of template with the last check date of the document
531 const util::DateTime aInfoDate( xDocProps->getTemplateDate() );
532 if ( aTemplDate > aInfoDate )
533 {
534 // ask user
535 if( bCanUpdateFromTemplate == document::UpdateDocMode::QUIET_UPDATE
536 || bCanUpdateFromTemplate == document::UpdateDocMode::FULL_UPDATE )
537 bLoad = true;
538 else if ( bCanUpdateFromTemplate == document::UpdateDocMode::ACCORDING_TO_CONFIG )
539 {
540 const OUString sMessage( SfxResId(STR_QRYTEMPL_MESSAGE).replaceAll( "$(ARG1)", aTemplName ) );
541 QueryTemplateBox aBox(Application::GetFrameWeld(GetDialogParent()), sMessage);
542 if (RET_YES == aBox.run())
543 bLoad = true;
544 }
545
546 if( !bLoad )
547 {
548 // user refuses, so don't ask again for this document
550 SetModified();
551 }
552 }
553 }
554
555 if ( !bLoad )
556 return;
557
558 // styles should be updated, create document in organizer mode to read in the styles
559 //TODO: testen!
561 xTemplDoc->DoInitNew();
562
563 // TODO/MBA: do we need a BaseURL? Then LoadFrom must be extended!
564 //xTemplDoc->SetBaseURL( aFoundName );
565
566 // TODO/LATER: make sure that we don't use binary templates!
567 SfxMedium aMedium( aFoundName, StreamMode::STD_READ );
568 if ( xTemplDoc->LoadFrom( aMedium ) )
569 {
570 // transfer styles from xTemplDoc to this document
571 // TODO/MBA: make sure that no BaseURL is needed in *this* document
572 LoadStyles(*xTemplDoc);
573
574 // remember date/time of check
575 xDocProps->setTemplateDate(aTemplDate);
576 // TODO/LATER: new functionality to store document info is required ( didn't work for SO7 XML format )
577 }
578}
579
581{
582 std::shared_ptr<const SfxFilter> pFilter = GetMedium()->GetFilter();
583 return (pFilter && pFilter->GetFilterName() == "writer_web_HTML_help");
584}
585
586void SfxObjectShell::ResetFromTemplate( const OUString& rTemplateName, std::u16string_view rFileName )
587{
588 // only care about resetting this data for LibreOffice formats otherwise
589 if ( !IsOwnStorageFormat( *GetMedium()) )
590 return;
591
592 uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties());
593 xDocProps->setTemplateURL( OUString() );
594 xDocProps->setTemplateName( OUString() );
595 xDocProps->setTemplateDate( util::DateTime() );
596 xDocProps->resetUserData( OUString() );
597
598 // TODO/REFACTOR:
599 // Title?
600
601 if( !comphelper::isFileUrl( rFileName ) )
602 return;
603
604 OUString aFoundName;
605 if( SfxGetpApp()->Get_Impl()->GetDocumentTemplates()->GetFull( u"", rTemplateName, aFoundName ) )
606 {
607 INetURLObject aObj( rFileName );
608 xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DecodeMechanism::ToIUri) );
609 xDocProps->setTemplateName( rTemplateName );
610
612 xDocProps->setTemplateDate( now.GetUNODateTime() );
613
614 SetQueryLoadTemplate( true );
615 }
616}
617
619{
620 return pImpl->bQueryLoadTemplate;
621}
622
624{
625 return pImpl->bUseUserData;
626}
627
629{
630 return pImpl->bUseThumbnailSave;
631}
632
634{
635 if ( pImpl->bQueryLoadTemplate != bNew )
636 SetModified();
637 pImpl->bQueryLoadTemplate = bNew;
638}
639
641{
642 if ( pImpl->bUseUserData != bNew )
643 SetModified();
644 pImpl->bUseUserData = bNew;
645}
646
648{
649 if ( pImpl->bUseThumbnailSave != _bNew )
650 SetModified();
651 pImpl->bUseThumbnailSave = _bNew;
652}
653
655{
656 return pImpl->bLoadReadonly;
657}
658
660{
661 return pImpl->bSaveVersionOnClose;
662}
663
665{
666 if ( pImpl->bLoadReadonly != bNew )
667 SetModified();
668 pImpl->bLoadReadonly = bNew;
669}
670
672{
673 if ( pImpl->bSaveVersionOnClose != bNew )
674 SetModified();
675 pImpl->bSaveVersionOnClose = bNew;
676}
677
679{
680 return pImpl->m_nModifyPasswordHash;
681}
682
684{
685 if ( ( !IsReadOnly() && !IsReadOnlyUI() )
686 || !(pImpl->nFlagsInProgress & SfxLoadedFlags::MAINDOCUMENT ) )
687 {
688 // the hash can be changed only in editable documents,
689 // or during loading of document
690 pImpl->m_nModifyPasswordHash = nHash;
691 return true;
692 }
693
694 return false;
695}
696
697const uno::Sequence< beans::PropertyValue >& SfxObjectShell::GetModifyPasswordInfo() const
698{
699 return pImpl->m_aModifyPasswordInfo;
700}
701
702bool SfxObjectShell::SetModifyPasswordInfo( const uno::Sequence< beans::PropertyValue >& aInfo )
703{
704 if ( ( !IsReadOnly() && !IsReadOnlyUI() )
705 || !(pImpl->nFlagsInProgress & SfxLoadedFlags::MAINDOCUMENT ) )
706 {
707 // the hash can be changed only in editable documents,
708 // or during loading of document
709 pImpl->m_aModifyPasswordInfo = aInfo;
710 return true;
711 }
712
713 return false;
714}
715
717{
718 pImpl->m_bModifyPasswordEntered = bEntered;
719}
720
722{
723 return pImpl->m_bModifyPasswordEntered;
724}
725
726/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxApplication * SfxGetpApp()
Definition: app.hxx:231
std::unique_ptr< weld::MessageDialog > m_xQueryBox
const LanguageTag & GetLanguageTag() const
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
static const AllSettings & GetSettings()
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
bool Convert(BmpConversion eConversion)
bool IsEmpty() const
sal_uInt16 GetValue() const
sal_Int64 GetSecFromDateTime(const Date &rDate) const
css::util::DateTime GetUNODateTime() const
sal_Int32 GetDate() const
void SetPrefMapMode(const MapMode &rMapMode)
void Record(OutputDevice *pOutDev)
void SetPrefSize(const Size &rSize)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
LanguageType getLanguageType(bool bResolveSystem=true) const
void SetMapMode()
void SetDigitLanguage(LanguageType)
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
bool IsPrinting() const
void Broadcast(const SfxHint &rHint)
bool GetFull(std::u16string_view rRegion, std::u16string_view rName, OUString &rPath)
Definition: doctempl.cxx:1098
void PutExtended(const SfxItemSet &, SfxItemState eDontCareAs, SfxItemState eDefaultAs)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const std::shared_ptr< const SfxFilter > & GetFilter() const
Definition: docfile.cxx:3111
SfxItemSet & GetItemSet() const
Definition: docfile.cxx:3647
const OUString & GetName() const
Definition: docfile.cxx:3592
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
Definition: docfile.cxx:1703
SAL_DLLPRIVATE void SetModifyPasswordEntered(bool bEntered=true)
Definition: objcont.cxx:716
virtual SfxStyleSheetBasePool * GetStyleSheetPool()
Definition: objcont.cxx:346
css::uno::Reference< css::document::XDocumentProperties > getDocProperties() const
Definition: objmisc.cxx:161
void ResetFromTemplate(const OUString &rTemplateName, std::u16string_view rFileName)
Definition: objcont.cxx:586
virtual sfx::AccessibilityIssueCollection runAccessibilityCheck()
Definition: objcont.cxx:340
bool SetModifyPasswordInfo(const css::uno::Sequence< css::beans::PropertyValue > &aInfo)
Definition: objcont.cxx:702
SAL_DLLPRIVATE bool CreatePreview_Impl(bool bFullContent, VirtualDevice *pDevice, GDIMetaFile *pFile) const
Definition: objcont.cxx:121
virtual bool LoadFrom(SfxMedium &rMedium)
Definition: objstor.cxx:3052
bool IsLoadReadonly() const
Definition: objcont.cxx:654
MapUnit GetMapUnit() const
Definition: objembed.cxx:109
virtual sfx2::StyleManager * GetStyleManager()
Definition: objcont.cxx:411
sal_uInt32 GetModifyPasswordHash() const
Definition: objcont.cxx:678
virtual std::shared_ptr< SfxDocumentInfoDialog > CreateDocumentInfoDialog(weld::Window *pParent, const SfxItemSet &rItemSet)
Definition: objcont.cxx:311
static bool IsOwnStorageFormat(const SfxMedium &)
Definition: objstor.cxx:953
void SetRecentColor(sal_uInt16 nSlotId, const NamedColor &rColor)
Definition: objcont.cxx:326
std::shared_ptr< GDIMetaFile > GetPreviewMetaFile(bool bFullContent=false) const
Definition: objcont.cxx:95
virtual std::shared_ptr< model::ColorSet > GetThemeColors()
Definition: objcont.cxx:338
virtual SfxObjectFactory & GetFactory() const =0
bool IsUseUserData() const
Definition: objcont.cxx:623
css::uno::Reference< css::awt::XWindow > GetDialogParent(SfxMedium const *pMedium=nullptr)
Definition: objmisc.cxx:1618
bool IsReadOnly() const
Definition: objmisc.cxx:416
bool IsReadOnlyUI() const
Definition: objmisc.cxx:336
bool IsModified() const
Definition: objmisc.cxx:259
static SfxObjectShell * CreateObjectByFactoryName(const OUString &rURL, SfxObjectCreateMode=SfxObjectCreateMode::STANDARD)
Definition: objxtor.cxx:990
SAL_DLLPRIVATE SfxObjectShell_Impl * Get_Impl()
Definition: objsh.hxx:718
SfxMedium * GetMedium() const
Definition: objsh.hxx:261
std::optional< NamedColor > GetRecentColor(sal_uInt16 nSlotId)
Definition: objcont.cxx:317
void SetQueryLoadTemplate(bool b)
Definition: objcont.cxx:633
virtual std::set< Color > GetDocColors()
Definition: objcont.cxx:332
void DoDraw(OutputDevice *, const Point &rObjPos, const Size &rSize, const JobSetup &rSetup, sal_uInt16 nAspect=ASPECT_CONTENT, bool bOutputForScreen=false)
Definition: objembed.cxx:132
virtual void LoadStyles(SfxObjectShell &rSource)
Definition: objcont.cxx:362
void UpdateDocInfoForSave()
Definition: objcont.cxx:206
std::unique_ptr< struct SfxObjectShell_Impl > pImpl
Definition: objsh.hxx:185
SAL_DLLPRIVATE void UpdateFromTemplate_Impl()
Definition: objcont.cxx:435
BitmapEx GetPreviewBitmap() const
Definition: objcont.cxx:105
const tools::Rectangle & GetVisArea() const
Definition: objembed.cxx:74
void SetSaveVersionOnClose(bool bSet)
Definition: objcont.cxx:671
void SetUseThumbnailSave(bool _bNew)
Definition: objcont.cxx:647
void SetUseUserData(bool bNew)
Definition: objcont.cxx:640
Size GetFirstPageSize() const
Definition: objmisc.cxx:653
bool IsUseThumbnailSave() const
Definition: objcont.cxx:628
bool IsSaveVersionOnClose() const
Definition: objcont.cxx:659
void SetLoadReadonly(bool _bReadonly)
Definition: objcont.cxx:664
SAL_DLLPRIVATE bool IsModifyPasswordEntered() const
Definition: objcont.cxx:721
const css::uno::Sequence< css::beans::PropertyValue > & GetModifyPasswordInfo() const
Definition: objcont.cxx:697
bool DoInitNew()
Definition: objstor.cxx:443
bool IsHelpDocument() const
Definition: objcont.cxx:580
bool SetModifyPasswordHash(sal_uInt32 nHash)
Definition: objcont.cxx:683
virtual void SetModified(bool bModified=true)
Definition: objmisc.cxx:301
SAL_DLLPRIVATE void UpdateTime_Impl(const css::uno::Reference< css::document::XDocumentProperties > &i_xDocProps)
Definition: objcont.cxx:253
bool IsQueryLoadTemplate() const
Definition: objcont.cxx:618
const OUString & GetName() const
Returns the name of the Shell object.
Definition: shell.cxx:119
SfxViewShell * GetViewShell() const
Returns the SfxViewShell in which they are located in the subshells.
Definition: shell.cxx:129
virtual std::unique_ptr< SfxStyleSheetIterator > CreateIterator(SfxStyleFamily, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
SfxStyleSearchBits GetMask() const
virtual const OUString & GetParent() const
const OUString & GetName() const
virtual bool HasFollowSupport() const
SfxStyleFamily GetFamily() const
virtual bool HasParentSupport() const
virtual SfxItemSet & GetItemSet()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
Definition: viewfrm.cxx:1983
virtual SfxPrinter * GetPrinter(bool bCreate=false)
Definition: viewprn.cxx:904
bool IsEmpty() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
static TextNumerals GetCTLTextNumerals()
reference_type * get() const
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true, bool bAlphaMaskTransparent=false)
constexpr Size GetSize() const
sal_uInt16 GetSec() const
sal_Int64 GetTime() const
sal_uInt16 GetMin() const
sal_uInt16 GetHour() const
#define DBG_ASSERT(sCon, aError)
#define TOOLS_INFO_EXCEPTION(area, stream)
float u
tools::Long FRound(double fVal)
constexpr OUStringLiteral HID_QUERY_LOAD_TEMPLATE
Definition: helpids.h:51
#define LANGUAGE_ENGLISH
#define LANGUAGE_ARABIC_SAUDI_ARABIA
DateTime now
def run(arg=None, arg2=-1)
bool IsOptionSet(EOption eOption)
NONE
size
@ Exception
COMPHELPER_DLLPUBLIC bool isFileUrl(std::u16string_view url)
int i
static bool operator>(const util::DateTime &i_rLeft, const util::DateTime &i_rRight)
Definition: objcont.cxx:68
static void lcl_add(util::Duration &rDur, tools::Time const &rTime)
Definition: objcont.cxx:243
#define ASPECT_CONTENT
Definition: objsh.hxx:83
#define ASPECT_THUMBNAIL
Definition: objsh.hxx:84
OUString SfxResId(TranslateId aId)
Definition: sfxresid.cxx:22
static SfxItemSet & rSet
Definition: shell.cxx:534
OUString sMessage
signed char sal_Int8
RET_YES
VclMessageType
VclButtonsType