LibreOffice Module starmath (master) 1
document.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#include <sal/config.h>
21
22#include <com/sun/star/accessibility/AccessibleEventId.hpp>
23#include <com/sun/star/uno/Any.h>
24
27#include <rtl/ustrbuf.hxx>
28#include <rtl/ustring.hxx>
29#include <sal/log.hxx>
30#include <unotools/eventcfg.hxx>
31#include <sfx2/event.hxx>
32#include <sfx2/app.hxx>
33#include <sfx2/bindings.hxx>
34#include <sfx2/docfile.hxx>
35#include <sfx2/docfilt.hxx>
36#include <sfx2/msg.hxx>
37#include <sfx2/objface.hxx>
38#include <sfx2/printer.hxx>
39#include <sfx2/request.hxx>
40#include <sfx2/viewfrm.hxx>
42#include <sot/formats.hxx>
43#include <sot/storage.hxx>
44#include <svl/eitem.hxx>
45#include <svl/intitem.hxx>
46#include <svl/itempool.hxx>
47#include <svl/slstitm.hxx>
48#include <svl/hint.hxx>
49#include <svl/stritem.hxx>
50#include <svl/undo.hxx>
51#include <svl/whiter.hxx>
52#include <vcl/mapmod.hxx>
53#include <vcl/virdev.hxx>
54#include <tools/mapunit.hxx>
55#include <vcl/settings.hxx>
56
57#include <document.hxx>
58#include <action.hxx>
59#include <dialog.hxx>
60#include <format.hxx>
61#include <parse.hxx>
62#include <starmath.hrc>
63#include <strings.hrc>
64#include <smmod.hxx>
65#include <symbol.hxx>
66#include <unomodel.hxx>
67#include <utility.hxx>
68#include <view.hxx>
69#include "mathtype.hxx"
70#include "ooxmlexport.hxx"
71#include "ooxmlimport.hxx"
72#include "rtfexport.hxx"
73#include <mathmlimport.hxx>
74#include <mathmlexport.hxx>
75#include <svx/svxids.hrc>
76#include <cursor.hxx>
78#include <visitors.hxx>
79#include "accessibility.hxx"
80#include <cfgitem.hxx>
81#include <utility>
84#include <smediteng.hxx>
85
86using namespace ::com::sun::star;
87using namespace ::com::sun::star::accessibility;
88using namespace ::com::sun::star::uno;
89
90#define ShellClass_SmDocShell
91#include <smslots.hxx>
92
93
95
96void SmDocShell::InitInterface_Impl()
97{
98 GetStaticInterface()->RegisterPopupMenu("view");
99}
100
101void SmDocShell::SetSmSyntaxVersion(sal_uInt16 nSmSyntaxVersion)
102{
103 mnSmSyntaxVersion = nSmSyntaxVersion;
105}
106
107SFX_IMPL_OBJECTFACTORY(SmDocShell, SvGlobalName(SO3_SM_CLASSID), "smath" )
108
109void SmDocShell::Notify(SfxBroadcaster&, const SfxHint& rHint)
110{
111 if (rHint.GetId() == SfxHintId::MathFormatChanged)
112 {
113 SetFormulaArranged(false);
114
115 mnModifyCount++;
116
117 Repaint();
118 }
119}
120
122{
123 SmModule *pp = SM_MOD();
124 pp->GetSymbolManager().Load();
125}
126
127
129{
130 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
131 GetModel(), uno::UNO_QUERY_THROW);
132 uno::Reference<document::XDocumentProperties> xDocProps(
133 xDPS->getDocumentProperties());
134 return xDocProps->getDescription();
135}
136
137
138void SmDocShell::SetText(const OUString& rBuffer)
139{
140 if (rBuffer == maText)
141 return;
142
144 if( bIsEnabled )
145 EnableSetModified( false );
146
147 maText = rBuffer;
148 SetFormulaArranged( false );
149
150 Parse();
151
152 SmViewShell *pViewSh = SmGetActiveView();
153 if (pViewSh)
154 {
155 pViewSh->GetViewFrame().GetBindings().Invalidate(SID_TEXT);
156 if ( SfxObjectCreateMode::EMBEDDED == GetCreateMode() )
157 {
158 // have SwOleClient::FormatChanged() to align the modified formula properly
159 // even if the visible area does not change (e.g. when formula text changes from
160 // "{a over b + c} over d" to "d over {a over b + c}"
161 SfxGetpApp()->NotifyEvent(SfxEventHint( SfxEventHintId::VisAreaChanged, GlobalEventConfig::GetEventName(GlobalEventId::VISAREACHANGED), this));
162
163 Repaint();
164 }
165 else
166 pViewSh->GetGraphicWidget().Invalidate();
167 }
168
169 if ( bIsEnabled )
171 SetModified();
172
173 // launch accessible event if necessary
174 SmGraphicAccessible *pAcc = pViewSh ? pViewSh->GetGraphicWidget().GetAccessible_Impl() : nullptr;
175 if (pAcc)
176 {
177 Any aOldValue, aNewValue;
178 if ( comphelper::OCommonAccessibleText::implInitTextChangedEvent( maText, rBuffer, aOldValue, aNewValue ) )
179 {
180 pAcc->LaunchEvent( AccessibleEventId::TEXT_CHANGED,
181 aOldValue, aNewValue );
182 }
183 }
184
185 if ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
187}
188
189void SmDocShell::SetFormat(SmFormat const & rFormat)
190{
191 maFormat = rFormat;
192 SetFormulaArranged( false );
193 SetModified();
194
195 mnModifyCount++;
196
197 // don't use SmGetActiveView since the view shell might not be active (0 pointer)
198 // if for example the Basic Macro dialog currently has the focus. Thus:
199 SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
200 while (pFrm)
201 {
202 pFrm->GetBindings().Invalidate(SID_GRAPHIC_SM);
203 pFrm = SfxViewFrame::GetNext( *pFrm, this );
204 }
205}
206
208{
210 if (maAccText.isEmpty())
211 {
212 OSL_ENSURE( mpTree, "Tree missing" );
213 if (mpTree)
214 {
215 OUStringBuffer aBuf;
216 mpTree->GetAccessibleText(aBuf);
217 maAccText = aBuf.makeStringAndClear();
218 }
219 }
220 return maAccText;
221}
222
224{
225 mpTree.reset();
227 mpTree = maParser->Parse(maText);
228 mnModifyCount++;
229 SetFormulaArranged( false );
231 maUsedSymbols = maParser->GetUsedSymbols();
232}
233
234
236{
238 return;
239
240 // Only for the duration of the existence of this object the correct settings
241 // at the printer are guaranteed!
242 SmPrinterAccess aPrtAcc(*this);
243 OutputDevice* pOutDev = aPrtAcc.GetRefDev();
244
245 SAL_WARN_IF( !pOutDev, "starmath", "!! SmDocShell::ArrangeFormula: reference device missing !!");
246
247 // if necessary get another OutputDevice for which we format
248 if (!pOutDev)
249 {
250 if (SmViewShell *pView = SmGetActiveView())
251 pOutDev = &pView->GetGraphicWidget().GetDrawingArea()->get_ref_device();
252 else
253 {
254 pOutDev = &SM_MOD()->GetDefaultVirtualDev();
255 pOutDev->SetMapMode( MapMode(SmMapUnit()) );
256 }
257 }
258 OSL_ENSURE(pOutDev->GetMapMode().GetMapUnit() == SmMapUnit(),
259 "Sm : wrong MapMode");
260
261 const SmFormat &rFormat = GetFormat();
262 mpTree->Prepare(rFormat, *this, 0);
263
264 // format/draw formulas always from left to right,
265 // and numbers should not be converted
266 vcl::text::ComplexTextLayoutFlags nLayoutMode = pOutDev->GetLayoutMode();
268 LanguageType nDigitLang = pOutDev->GetDigitLanguage();
270
271 mpTree->Arrange(*pOutDev, rFormat);
272
273 pOutDev->SetLayoutMode( nLayoutMode );
274 pOutDev->SetDigitLanguage( nDigitLang );
275
276 SetFormulaArranged(true);
277
278 // invalidate accessible text
279 maAccText.clear();
280}
281
283{
285}
286
288{
289 if (!mpEditEngine)
290 {
296 mpEditEngine.reset( new SmEditEngine( mpEditEngineItemPool.get() ) );
297 mpEditEngine->EraseVirtualDevice();
298
299 // set initial text if the document already has some...
300 // (may be the case when reloading a doc)
301 OUString aTxt( GetText() );
302 if (!aTxt.isEmpty())
303 mpEditEngine->SetText( aTxt );
304 mpEditEngine->ClearModifyFlag();
305 }
306 return *mpEditEngine;
307}
308
309
310void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSelection)
311{
312 if (!mpTree)
313 Parse();
314 OSL_ENSURE(mpTree, "Sm : NULL pointer");
315
317
318 // Problem: What happens to WYSIWYG? While we're active inplace, we don't have a reference
319 // device and aren't aligned to that either. So now there can be a difference between the
320 // VisArea (i.e. the size within the client) and the current size.
321 // Idea: The difference could be adapted with SmNod::SetSize (no long-term solution)
322
325
330 DrawModeFlags nOldDrawMode = DrawModeFlags::Default;
331 bool bRestoreDrawMode = false;
332 if (OUTDEV_WINDOW == rDev.GetOutDevType() &&
334 {
335 nOldDrawMode = rDev.GetDrawMode();
336 rDev.SetDrawMode( DrawModeFlags::Default );
337 bRestoreDrawMode = true;
338 }
339
340 // format/draw formulas always from left to right
341 // and numbers should not be converted
344 LanguageType nDigitLang = rDev.GetDigitLanguage();
346
347 //Set selection if any
348 if(mpCursor && bDrawSelection){
349 mpCursor->AnnotateSelection();
350 SmSelectionDrawingVisitor(rDev, mpTree.get(), rPosition);
351 }
352
353 //Drawing using visitor
354 SmDrawingVisitor(rDev, rPosition, mpTree.get());
355
356
357 rDev.SetLayoutMode( nLayoutMode );
358 rDev.SetDigitLanguage( nDigitLang );
359
360 if (bRestoreDrawMode)
361 rDev.SetDrawMode( nOldDrawMode );
362}
363
365{
366 Size aRet;
367
368 if (!mpTree)
369 Parse();
370
371 if (mpTree)
372 {
374 aRet = mpTree->GetSize();
375
376 if ( !aRet.Width() || aRet.Width() == 1 )
377 aRet.setWidth( 2000 );
378 else
381 if ( !aRet.Height() )
382 aRet.setHeight( 1000 );
383 else
386 }
387
388 return aRet;
389}
390
392 mpCursor.reset();
393}
394
396 if(!mpCursor)
397 mpCursor.reset(new SmCursor(mpTree.get(), this));
398 return *mpCursor;
399}
400
401bool SmDocShell::HasCursor() const { return mpCursor != nullptr; }
402
404{
405 pPrinter = rDocShell.GetPrt();
406 if ( pPrinter )
407 {
409 if ( SfxObjectCreateMode::EMBEDDED == rDocShell.GetCreateMode() )
410 {
411 // if it is an embedded object (without its own printer)
412 // we change the MapMode temporarily.
417
418 const MapUnit eOld = pPrinter->GetMapMode().GetMapUnit();
419 if ( SmMapUnit() != eOld )
420 {
421 MapMode aMap( pPrinter->GetMapMode() );
422 aMap.SetMapUnit( SmMapUnit() );
423 Point aTmp( aMap.GetOrigin() );
424 aTmp.setX( OutputDevice::LogicToLogic( aTmp.X(), eOld, SmMapUnit() ) );
425 aTmp.setY( OutputDevice::LogicToLogic( aTmp.Y(), eOld, SmMapUnit() ) );
426 aMap.SetOrigin( aTmp );
427 pPrinter->SetMapMode( aMap );
428 }
429 }
430 }
431 pRefDev = rDocShell.GetRefDev();
432 if ( !pRefDev || pPrinter.get() == pRefDev.get() )
433 return;
434
436 if ( SfxObjectCreateMode::EMBEDDED != rDocShell.GetCreateMode() )
437 return;
438
439 // if it is an embedded object (without its own printer)
440 // we change the MapMode temporarily.
445
446 const MapUnit eOld = pRefDev->GetMapMode().GetMapUnit();
447 if ( SmMapUnit() != eOld )
448 {
449 MapMode aMap( pRefDev->GetMapMode() );
450 aMap.SetMapUnit( SmMapUnit() );
451 Point aTmp( aMap.GetOrigin() );
452 aTmp.setX( OutputDevice::LogicToLogic( aTmp.X(), eOld, SmMapUnit() ) );
453 aTmp.setY( OutputDevice::LogicToLogic( aTmp.Y(), eOld, SmMapUnit() ) );
454 aMap.SetOrigin( aTmp );
455 pRefDev->SetMapMode( aMap );
456 }
457}
458
460{
461 if ( pPrinter )
462 pPrinter->Pop();
463 if ( pRefDev && pRefDev != pPrinter )
464 pRefDev->Pop();
465}
466
468{
469 if (SfxObjectCreateMode::EMBEDDED == GetCreateMode())
470 {
471 // Normally the server provides the printer. But if it doesn't provide one (e.g. because
472 // there is no connection) it still can be the case that we know the printer because it
473 // has been passed on by the server in OnDocumentPrinterChanged and being kept temporarily.
474 Printer* pPrt = GetDocumentPrinter();
475 if (!pPrt && mpTmpPrinter)
476 pPrt = mpTmpPrinter;
477 return pPrt;
478 }
479 else if (!mpPrinter)
480 {
481 auto pOptions = std::make_unique<SfxItemSetFixed<
482 SID_PRINTTITLE, SID_PRINTZOOM,
483 SID_NO_RIGHT_SPACES, SID_SAVE_ONLY_USED_SYMBOLS,
484 SID_AUTO_CLOSE_BRACKETS, SID_SMEDITWINDOWZOOM>>(GetPool());
485 SmModule *pp = SM_MOD();
486 pp->GetConfig()->ConfigToItemSet(*pOptions);
487 mpPrinter = VclPtr<SfxPrinter>::Create(std::move(pOptions));
488 mpPrinter->SetMapMode(MapMode(SmMapUnit()));
489 }
490 return mpPrinter;
491}
492
494{
495 if (SfxObjectCreateMode::EMBEDDED == GetCreateMode())
496 {
497 OutputDevice* pOutDev = GetDocumentRefDev();
498 if (pOutDev)
499 return pOutDev;
500 }
501
502 return GetPrt();
503}
504
506{
508 mpPrinter = pNew; //Transfer ownership
509 mpPrinter->SetMapMode( MapMode(SmMapUnit()) );
510 SetFormulaArranged(false);
511 Repaint();
512}
513
515{
516 mpTmpPrinter = pPrt;
517 SetFormulaArranged(false);
518 Size aOldSize = GetVisArea().GetSize();
519 Repaint();
520 if( aOldSize != GetVisArea().GetSize() && !maText.isEmpty() )
521 SetModified();
522 mpTmpPrinter = nullptr;
523}
524
526{
528 if (bIsEnabled)
529 EnableSetModified( false );
530
531 SetFormulaArranged(false);
532
533 Size aVisSize = GetSize();
534 SetVisAreaSize(aVisSize);
535 if (SmViewShell* pViewSh = SmGetActiveView())
536 pViewSh->GetGraphicWidget().Invalidate();
537
538 if (bIsEnabled)
540}
541
543 : SfxObjectShell(i_nSfxCreationFlags)
544 , m_pMlElementTree(nullptr)
545 , mpPrinter(nullptr)
546 , mpTmpPrinter(nullptr)
547 , mnModifyCount(0)
548 , mbFormulaArranged(false)
549 , mnSmSyntaxVersion(SM_MOD()->GetConfig()->GetDefaultSmSyntaxVersion())
550{
552
554
555 SmModule *pp = SM_MOD();
557
560
561 SetBaseModel(new SmModel(this));
563
565}
566
568{
569 SmModule *pp = SM_MOD();
570
572 EndListening(*pp->GetConfig());
573
574 mpCursor.reset();
575 mpEditEngine.reset();
576 mpEditEngineItemPool.clear();
578
580}
581
583{
584 bool bSuccess = false;
585 const OUString& rFltName = rMedium.GetFilter()->GetFilterName();
586
587 OSL_ENSURE( rFltName != STAROFFICE_XML, "Wrong filter!");
588
589 if ( rFltName == MATHML_XML )
590 {
591 if (mpTree)
592 {
593 mpTree.reset();
595 }
597 SmXMLImportWrapper aEquation(xModel);
598 aEquation.useHTMLMLEntities(true);
599 bSuccess = ( ERRCODE_NONE == aEquation.Import(rMedium) );
600 }
601 else
602 {
603 SvStream *pStream = rMedium.GetInStream();
604 if ( pStream )
605 {
606 if ( SotStorage::IsStorageFile( pStream ) )
607 {
608 tools::SvRef<SotStorage> aStorage = new SotStorage( pStream, false );
609 if ( aStorage->IsStream("Equation Native") )
610 {
611 // is this a MathType Storage?
612 OUStringBuffer aBuffer;
613 MathType aEquation(aBuffer);
614 bSuccess = aEquation.Parse( aStorage.get() );
615 if ( bSuccess )
616 {
617 maText = aBuffer.makeStringAndClear();
618 Parse();
619 }
620 }
621 }
622 }
623 }
624
625 if ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
626 {
627 SetFormulaArranged( false );
628 Repaint();
629 }
630
632 return bSuccess;
633}
634
635
636bool SmDocShell::InitNew( const uno::Reference < embed::XStorage >& xStorage )
637{
638 bool bRet = false;
639 if ( SfxObjectShell::InitNew( xStorage ) )
640 {
641 bRet = true;
642 SetVisArea(tools::Rectangle(Point(0, 0), Size(2000, 1000)));
643 }
644 return bRet;
645}
646
647
649{
650 bool bRet = false;
651 if( SfxObjectShell::Load( rMedium ))
652 {
653 uno::Reference < embed::XStorage > xStorage = GetMedium()->GetStorage();
654 if (xStorage->hasByName("content.xml") && xStorage->isStreamElement("content.xml"))
655 {
656 // is this a fabulous math package ?
658 SmXMLImportWrapper aEquation(xModel);
659 auto nError = aEquation.Import(rMedium);
660 bRet = ERRCODE_NONE == nError;
661 SetError(nError);
662 }
663 }
664
665 if ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
666 {
667 SetFormulaArranged( false );
668 Repaint();
669 }
670
672 return bRet;
673}
674
675
677{
679 UpdateText();
680
681 if ( SfxObjectShell::Save() )
682 {
683 if (!mpTree)
684 Parse();
685 if( mpTree )
687
688 Reference<css::frame::XModel> xModel(GetModel());
689 SmXMLExportWrapper aEquation(xModel);
690 aEquation.SetFlat(false);
691 return aEquation.Export(*GetMedium());
692 }
693
694 return false;
695}
696
697/*
698 * replace bad characters that can not be saved. (#i74144)
699 * */
701{
702 bool bReplace = false;
703
704 if (!mpEditEngine)
705 return;
706
707 OUStringBuffer aBuf( mpEditEngine->GetText() );
708
709 for (sal_Int32 i = 0; i < aBuf.getLength(); ++i)
710 {
711 if (aBuf[i] < ' ' && aBuf[i] != '\r' && aBuf[i] != '\n' && aBuf[i] != '\t')
712 {
713 aBuf[i] = ' ';
714 bReplace = true;
715 }
716 }
717
718 if (bReplace)
719 maText = aBuf.makeStringAndClear();
720}
721
722
724{
725 if (mpEditEngine && mpEditEngine->IsModified())
726 {
727 OUString aEngTxt( mpEditEngine->GetText() );
728 if (GetText() != aEngTxt)
729 SetText( aEngTxt );
730 }
731}
732
733
735{
736 bool bRet = false;
737
739 UpdateText();
740
741 if ( SfxObjectShell::SaveAs( rMedium ) )
742 {
743 if (!mpTree)
744 Parse();
745 if( mpTree )
747
748 Reference<css::frame::XModel> xModel(GetModel());
749 SmXMLExportWrapper aEquation(xModel);
750 aEquation.SetFlat(false);
751 bRet = aEquation.Export(rMedium);
752 }
753 return bRet;
754}
755
757{
758 bool bRet = false;
759 std::shared_ptr<const SfxFilter> pFlt = rMedium.GetFilter();
760 if( pFlt )
761 {
762 if( !mpTree )
763 Parse();
764 if( mpTree )
766
767 const OUString& rFltName = pFlt->GetFilterName();
768 if(rFltName == STAROFFICE_XML)
769 {
770 Reference<css::frame::XModel> xModel(GetModel());
771 SmXMLExportWrapper aEquation(xModel);
772 aEquation.SetFlat(false);
773 bRet = aEquation.Export(rMedium);
774 }
775 else if(rFltName == MATHML_XML)
776 {
777 Reference<css::frame::XModel> xModel(GetModel());
778 SmXMLExportWrapper aEquation(xModel);
779 aEquation.SetFlat(true);
780 aEquation.SetUseHTMLMLEntities(true);
781 bRet = aEquation.Export(rMedium);
782 }
783 else if (pFlt->GetFilterName() == "MathType 3.x")
784 bRet = WriteAsMathType3( rMedium );
785 }
786 return bRet;
787}
788
790 ::sax_fastparser::FSHelperPtr const& pSerializer,
791 oox::core::OoxmlVersion const version,
792 oox::drawingml::DocumentType const documentType,
793 const sal_Int8 nAlign)
794{
795 if( !mpTree )
796 Parse();
797 if( mpTree )
799 SmOoxmlExport aEquation(mpTree.get(), version, documentType);
800 if(documentType == oox::drawingml::DOCUMENT_DOCX)
801 aEquation.ConvertFromStarMath( pSerializer, nAlign);
802 else
803 aEquation.ConvertFromStarMath(pSerializer, oox::FormulaImExportBase::eFormulaAlign::INLINE);
804}
805
806void SmDocShell::writeFormulaRtf(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding)
807{
808 if (!mpTree)
809 Parse();
810 if (mpTree)
812 SmRtfExport aEquation(mpTree.get());
813 aEquation.ConvertFromStarMath(rBuffer, nEncoding);
814}
815
817{
818 SmOoxmlImport aEquation( stream );
819 SetText( aEquation.ConvertToStarMath());
820}
821
823{
824 switch (rReq.GetSlot())
825 {
826 case SID_TEXTMODE:
827 {
828 SmFormat aOldFormat = GetFormat();
829 SmFormat aNewFormat( aOldFormat );
830 aNewFormat.SetTextmode(!aOldFormat.IsTextmode());
831
832 SfxUndoManager *pTmpUndoMgr = GetUndoManager();
833 if (pTmpUndoMgr)
834 pTmpUndoMgr->AddUndoAction(
835 std::make_unique<SmFormatAction>(this, aOldFormat, aNewFormat));
836
837 SetFormat( aNewFormat );
838 Repaint();
839 }
840 break;
841
842 case SID_AUTO_REDRAW :
843 {
844 SmModule *pp = SM_MOD();
845 bool bRedraw = pp->GetConfig()->IsAutoRedraw();
846 pp->GetConfig()->SetAutoRedraw(!bRedraw);
847 }
848 break;
849
850 case SID_LOADSYMBOLS:
851 LoadSymbols();
852 break;
853
854 case SID_SAVESYMBOLS:
855 SaveSymbols();
856 break;
857
858 case SID_FONT:
859 {
860 // get device used to retrieve the FontList
861 OutputDevice *pDev = GetPrinter();
862 if (!pDev || pDev->GetFontFaceCollectionCount() == 0)
863 pDev = &SM_MOD()->GetDefaultVirtualDev();
864 OSL_ENSURE (pDev, "device for font list missing" );
865
866 SmFontTypeDialog aFontTypeDialog(rReq.GetFrameWeld(), pDev);
867
868 SmFormat aOldFormat = GetFormat();
869 aFontTypeDialog.ReadFrom( aOldFormat );
870 if (aFontTypeDialog.run() == RET_OK)
871 {
872 SmFormat aNewFormat( aOldFormat );
873
874 aFontTypeDialog.WriteTo(aNewFormat);
875 SfxUndoManager *pTmpUndoMgr = GetUndoManager();
876 if (pTmpUndoMgr)
877 pTmpUndoMgr->AddUndoAction(
878 std::make_unique<SmFormatAction>(this, aOldFormat, aNewFormat));
879
880 SetFormat( aNewFormat );
881 Repaint();
882 }
883 }
884 break;
885
886 case SID_FONTSIZE:
887 {
888 SmFontSizeDialog aFontSizeDialog(rReq.GetFrameWeld());
889
890 SmFormat aOldFormat = GetFormat();
891 aFontSizeDialog.ReadFrom( aOldFormat );
892 if (aFontSizeDialog.run() == RET_OK)
893 {
894 SmFormat aNewFormat( aOldFormat );
895
896 aFontSizeDialog.WriteTo(aNewFormat);
897
898 SfxUndoManager *pTmpUndoMgr = GetUndoManager();
899 if (pTmpUndoMgr)
900 pTmpUndoMgr->AddUndoAction(
901 std::make_unique<SmFormatAction>(this, aOldFormat, aNewFormat));
902
903 SetFormat( aNewFormat );
904 Repaint();
905 }
906 }
907 break;
908
909 case SID_DISTANCE:
910 {
911 SmDistanceDialog aDistanceDialog(rReq.GetFrameWeld());
912
913 SmFormat aOldFormat = GetFormat();
914 aDistanceDialog.ReadFrom( aOldFormat );
915 if (aDistanceDialog.run() == RET_OK)
916 {
917 SmFormat aNewFormat( aOldFormat );
918
919 aDistanceDialog.WriteTo(aNewFormat);
920
921 SfxUndoManager *pTmpUndoMgr = GetUndoManager();
922 if (pTmpUndoMgr)
923 pTmpUndoMgr->AddUndoAction(
924 std::make_unique<SmFormatAction>(this, aOldFormat, aNewFormat));
925
926 SetFormat( aNewFormat );
927 Repaint();
928 }
929 }
930 break;
931
932 case SID_ALIGN:
933 {
934 SmAlignDialog aAlignDialog(rReq.GetFrameWeld());
935
936 SmFormat aOldFormat = GetFormat();
937 aAlignDialog.ReadFrom( aOldFormat );
938 if (aAlignDialog.run() == RET_OK)
939 {
940 SmFormat aNewFormat( aOldFormat );
941
942 aAlignDialog.WriteTo(aNewFormat);
943
944 SmModule *pp = SM_MOD();
945 SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
946 aAlignDialog.WriteTo( aFmt );
947 pp->GetConfig()->SetStandardFormat( aFmt );
948
949 SfxUndoManager *pTmpUndoMgr = GetUndoManager();
950 if (pTmpUndoMgr)
951 pTmpUndoMgr->AddUndoAction(
952 std::make_unique<SmFormatAction>(this, aOldFormat, aNewFormat));
953
954 SetFormat( aNewFormat );
955 Repaint();
956 }
957 }
958 break;
959
960 case SID_TEXT:
961 {
962 const SfxStringItem& rItem = rReq.GetArgs()->Get(SID_TEXT);
963 if (GetText() != rItem.GetValue())
964 SetText(rItem.GetValue());
965 }
966 break;
967
968 case SID_UNDO:
969 case SID_REDO:
970 {
971 SfxUndoManager* pTmpUndoMgr = GetUndoManager();
972 if( pTmpUndoMgr )
973 {
974 sal_uInt16 nId = rReq.GetSlot(), nCnt = 1;
975 const SfxItemSet* pArgs = rReq.GetArgs();
976 const SfxPoolItem* pItem;
977 if( pArgs && SfxItemState::SET == pArgs->GetItemState( nId, false, &pItem ))
978 nCnt = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
979
980 bool (SfxUndoManager::*fnDo)();
981
982 size_t nCount;
983 if( SID_UNDO == rReq.GetSlot() )
984 {
985 nCount = pTmpUndoMgr->GetUndoActionCount();
986 fnDo = &SfxUndoManager::Undo;
987 }
988 else
989 {
990 nCount = pTmpUndoMgr->GetRedoActionCount();
991 fnDo = &SfxUndoManager::Redo;
992 }
993
994 try
995 {
996 for( ; nCnt && nCount; --nCnt, --nCount )
997 (pTmpUndoMgr->*fnDo)();
998 }
999 catch( const Exception& )
1000 {
1001 DBG_UNHANDLED_EXCEPTION("starmath");
1002 }
1003 }
1004 Repaint();
1005 UpdateText();
1006 SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
1007 while( pFrm )
1008 {
1009 SfxBindings& rBind = pFrm->GetBindings();
1010 rBind.Invalidate(SID_UNDO);
1011 rBind.Invalidate(SID_REDO);
1012 rBind.Invalidate(SID_REPEAT);
1013 rBind.Invalidate(SID_CLEARHISTORY);
1014 pFrm = SfxViewFrame::GetNext( *pFrm, this );
1015 }
1016 }
1017 break;
1018 }
1019
1020 rReq.Done();
1021}
1022
1023
1025{
1026 SfxWhichIter aIter(rSet);
1027
1028 for (sal_uInt16 nWh = aIter.FirstWhich(); 0 != nWh; nWh = aIter.NextWhich())
1029 {
1030 switch (nWh)
1031 {
1032 case SID_TEXTMODE:
1033 rSet.Put(SfxBoolItem(SID_TEXTMODE, GetFormat().IsTextmode()));
1034 break;
1035
1036 case SID_DOCTEMPLATE :
1037 rSet.DisableItem(SID_DOCTEMPLATE);
1038 break;
1039
1040 case SID_AUTO_REDRAW :
1041 {
1042 SmModule *pp = SM_MOD();
1043 bool bRedraw = pp->GetConfig()->IsAutoRedraw();
1044
1045 rSet.Put(SfxBoolItem(SID_AUTO_REDRAW, bRedraw));
1046 }
1047 break;
1048
1049 case SID_MODIFYSTATUS:
1050 {
1051 sal_Unicode cMod = ' ';
1052 if (IsModified())
1053 cMod = '*';
1054 rSet.Put(SfxStringItem(SID_MODIFYSTATUS, OUString(cMod)));
1055 }
1056 break;
1057
1058 case SID_TEXT:
1059 rSet.Put(SfxStringItem(SID_TEXT, GetText()));
1060 break;
1061
1062 case SID_GRAPHIC_SM:
1067 rSet.Put(SfxInt16Item(SID_GRAPHIC_SM, mnModifyCount));
1068 break;
1069
1070 case SID_UNDO:
1071 case SID_REDO:
1072 {
1073 SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
1074 if( pFrm )
1075 pFrm->GetSlotState( nWh, nullptr, &rSet );
1076 else
1077 rSet.DisableItem( nWh );
1078 }
1079 break;
1080
1081 case SID_GETUNDOSTRINGS:
1082 case SID_GETREDOSTRINGS:
1083 {
1084 SfxUndoManager* pTmpUndoMgr = GetUndoManager();
1085 if( pTmpUndoMgr )
1086 {
1087 OUString(SfxUndoManager::*fnGetComment)( size_t, bool const ) const;
1088
1089 size_t nCount;
1090 if( SID_GETUNDOSTRINGS == nWh )
1091 {
1092 nCount = pTmpUndoMgr->GetUndoActionCount();
1094 }
1095 else
1096 {
1097 nCount = pTmpUndoMgr->GetRedoActionCount();
1099 }
1100 if (nCount)
1101 {
1102 OUStringBuffer aBuf;
1103 for (size_t n = 0; n < nCount; ++n)
1104 {
1105 aBuf.append((pTmpUndoMgr->*fnGetComment)( n, SfxUndoManager::TopLevel ));
1106 aBuf.append('\n');
1107 }
1108
1109 SfxStringListItem aItem( nWh );
1110 aItem.SetString( aBuf.makeStringAndClear() );
1111 rSet.Put( aItem );
1112 }
1113 }
1114 else
1115 rSet.DisableItem( nWh );
1116 }
1117 break;
1118 }
1119 }
1120}
1121
1122
1124{
1125 if (!mpEditEngine)
1126 GetEditEngine();
1127 return &mpEditEngine->GetUndoManager();
1128}
1129
1130
1132{
1133 SmModule *pp = SM_MOD();
1134 pp->GetSymbolManager().Save();
1135}
1136
1137
1139 const JobSetup &,
1140 sal_uInt16 /*nAspect*/,
1141 bool /*bOutputForScreen*/)
1142{
1143 pDevice->IntersectClipRegion(GetVisArea());
1144 Point atmppoint;
1145 DrawFormula(*pDevice, atmppoint);
1146}
1147
1149{
1150 return SfxGetpApp()->GetPool();
1151}
1152
1154{
1155 tools::Rectangle aNewRect(rVisArea);
1156
1157 aNewRect.SetPos(Point());
1158
1159 if (aNewRect.IsWidthEmpty())
1160 aNewRect.SetRight( 2000 );
1161 if (aNewRect.IsHeightEmpty())
1162 aNewRect.SetBottom( 1000 );
1163
1165 if ( bIsEnabled )
1166 EnableSetModified( false );
1167
1168 //TODO/LATER: it's unclear how this interacts with the SFX code
1169 // If outplace editing, then don't resize the OutplaceWindow. But the
1170 // ObjectShell has to resize.
1171 bool bUnLockFrame;
1172 if( GetCreateMode() == SfxObjectCreateMode::EMBEDDED && !IsInPlaceActive() && GetFrame() )
1173 {
1175 bUnLockFrame = true;
1176 }
1177 else
1178 bUnLockFrame = false;
1179
1180 SfxObjectShell::SetVisArea( aNewRect );
1181
1182 if( bUnLockFrame )
1184
1185 if ( bIsEnabled )
1187}
1188
1189
1191 SotClipboardFormatId* pFormat,
1192 OUString* pFullTypeName,
1193 sal_Int32 nFileFormat,
1194 bool bTemplate /* = false */) const
1195{
1196 if (nFileFormat == SOFFICE_FILEFORMAT_60 )
1197 {
1198 *pClassName = SvGlobalName(SO3_SM_CLASSID_60);
1199 *pFormat = SotClipboardFormatId::STARMATH_60;
1200 *pFullTypeName = SmResId(STR_MATH_DOCUMENT_FULLTYPE_CURRENT);
1201 }
1202 else if (nFileFormat == SOFFICE_FILEFORMAT_8 )
1203 {
1204 *pClassName = SvGlobalName(SO3_SM_CLASSID_60);
1205 *pFormat = bTemplate ? SotClipboardFormatId::STARMATH_8_TEMPLATE : SotClipboardFormatId::STARMATH_8;
1206 *pFullTypeName = SmResId(STR_MATH_DOCUMENT_FULLTYPE_CURRENT);
1207 }
1208}
1209
1210void SmDocShell::SetModified(bool bModified)
1211{
1212 if( IsEnableSetModified() )
1213 {
1214 SfxObjectShell::SetModified( bModified );
1215 Broadcast(SfxHint(SfxHintId::DocChanged));
1216 }
1217}
1218
1220{
1221 OUStringBuffer aTextAsBuffer(maText);
1222 MathType aEquation(aTextAsBuffer, mpTree.get());
1223 return aEquation.ConvertFromStarMath( rMedium );
1224}
1225
1226/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DrawModeFlags
SfxApplication * SfxGetpApp()
const StyleSettings & GetStyleSettings() const
const OUString & GetValue() const
static rtl::Reference< SfxItemPool > CreatePool()
static OUString GetEventName(GlobalEventId nID)
MapUnit GetMapUnit() const
bool Parse(SotStorage *pStor)
Definition: mathtype.cxx:550
bool ConvertFromStarMath(SfxMedium &rMedium)
Definition: mathtype.cxx:1864
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void SetMapMode()
void SetDigitLanguage(LanguageType)
vcl::text::ComplexTextLayoutFlags GetLayoutMode() const
int GetFontFaceCollectionCount() const
const MapMode & GetMapMode() const
void SetDrawMode(DrawModeFlags nDrawMode)
OutDevType GetOutDevType() const
void SetLayoutMode(vcl::text::ComplexTextLayoutFlags nTextLayoutMode)
DrawModeFlags GetDrawMode() const
void IntersectClipRegion(const tools::Rectangle &rRect)
LanguageType GetDigitLanguage() const
virtual vcl::Window * GetOwnerWindow() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
void Invalidate(sal_uInt16 nId)
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
void DisableItem(sal_uInt16 nWhich)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
const std::shared_ptr< const SfxFilter > & GetFilter() const
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
SvStream * GetInStream()
virtual bool InitNew(const css::uno::Reference< css::embed::XStorage > &xStorage)
void SetError(ErrCode rErr)
virtual OutputDevice * GetDocumentRefDev()
virtual bool Load(SfxMedium &rMedium)
virtual bool SaveAs(SfxMedium &rMedium)
bool IsEnableSetModified() const
virtual void SetVisArea(const tools::Rectangle &rVisArea)
void SetVisAreaSize(const Size &rVisSize)
virtual bool Save()
void SetMapUnit(MapUnit nMUnit)
void FinishedLoading(SfxLoadedFlags nWhich=SfxLoadedFlags::ALL)
bool IsModified() const
SfxMedium * GetMedium() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
const tools::Rectangle & GetVisArea() const
void EnableSetModified(bool bEnable=true)
virtual Printer * GetDocumentPrinter()
SfxObjectCreateMode GetCreateMode() const
bool IsInPlaceActive() const
virtual void SetModified(bool bModified=true)
void SetBaseModel(SfxBaseModel *pModel)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
weld::Window * GetFrameWeld() const
void Done(bool bRemove=false)
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
SfxItemPool & GetPool() const
SfxViewFrame * GetFrame() const
void SetPool(SfxItemPool *pNewPool)
void SetString(const OUString &)
virtual bool Undo()
OUString GetRedoActionComment(size_t nNo=0, bool const i_currentLevel=CurrentLevel) const
OUString GetUndoActionComment(size_t nNo=0, bool const i_currentLevel=CurrentLevel) const
static bool const TopLevel
virtual bool Redo()
virtual size_t GetRedoActionCount(bool const i_currentLevel=CurrentLevel) const
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
virtual size_t GetUndoActionCount(bool const i_currentLevel=CurrentLevel) const
void LockAdjustPosSizePixel()
SfxBindings & GetBindings()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
void UnlockAdjustPosSizePixel()
SfxViewFrame & GetViewFrame() const
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void WriteTo(SmFormat &rFormat) const
Definition: dialog.cxx:935
void ReadFrom(const SmFormat &rFormat)
Definition: dialog.cxx:919
Formula cursor.
Definition: cursor.hxx:69
void ReadFrom(const SmFormat &rFormat)
Definition: dialog.cxx:821
void WriteTo(SmFormat &rFormat)
Definition: dialog.cxx:857
void SetFormat(SmFormat const &rFormat)
Definition: document.cxx:189
OUString GetComment() const
Definition: document.cxx:128
void UpdateText()
Definition: document.cxx:723
void SetText(const OUString &rBuffer)
Definition: document.cxx:138
OUString const & GetAccessibleText()
Definition: document.cxx:207
void writeFormulaRtf(OStringBuffer &rBuffer, rtl_TextEncoding nEncoding)
Definition: document.cxx:806
virtual void OnDocumentPrinterChanged(Printer *) override
Definition: document.cxx:514
virtual ~SmDocShell() override
Definition: document.cxx:567
void GetState(SfxItemSet &)
Definition: document.cxx:1024
virtual void SetVisArea(const tools::Rectangle &rVisArea) override
Definition: document.cxx:1153
virtual bool InitNew(const css::uno::Reference< css::embed::XStorage > &xStorage) override
Definition: document.cxx:636
SmDocShell(SfxModelFlags i_nSfxCreationFlags)
Definition: document.cxx:542
EditEngine & GetEditEngine()
Definition: document.cxx:287
void SetFormulaArranged(bool bVal)
Definition: document.hxx:124
OUString maAccText
Definition: document.hxx:84
SmFormat maFormat
Definition: document.hxx:83
SfxPrinter * GetPrinter()
Definition: document.hxx:160
bool HasCursor() const
True, if cursor have previously been requested and thus has some sort of position.
Definition: document.cxx:401
void Repaint()
Definition: document.cxx:525
void ReplaceBadChars()
Definition: document.cxx:700
virtual bool Save() override
Definition: document.cxx:676
void SetPrinter(SfxPrinter *)
Definition: document.cxx:505
VclPtr< SfxPrinter > mpPrinter
Definition: document.hxx:90
SmCursor & GetCursor()
Get a cursor for modifying this document.
Definition: document.cxx:395
virtual bool ConvertFrom(SfxMedium &rMedium) override
Definition: document.cxx:582
static SfxItemPool & GetPool()
Definition: document.cxx:1148
Size GetSize()
Definition: document.cxx:364
OUString maText
Definition: document.hxx:82
const OUString & GetText() const
Definition: document.hxx:170
std::unique_ptr< SmCursor > mpCursor
Definition: document.hxx:96
void Parse()
Definition: document.cxx:223
virtual bool SaveAs(SfxMedium &rMedium) override
Definition: document.cxx:734
bool WriteAsMathType3(SfxMedium &)
Definition: document.cxx:1219
void InvalidateCursor()
Called whenever the formula is changed Deletes the current cursor.
Definition: document.cxx:391
void ArrangeFormula()
Definition: document.cxx:235
virtual void Draw(OutputDevice *pDevice, const JobSetup &rSetup, sal_uInt16 nAspect, bool bOutputForScreen) override
Definition: document.cxx:1138
void SetSmSyntaxVersion(sal_uInt16 nSmSyntaxVersion)
Definition: document.cxx:101
virtual SfxUndoManager * GetUndoManager() override
Definition: document.cxx:1123
SmMlElement * m_pMlElementTree
Definition: document.hxx:87
static void LoadSymbols()
Definition: document.cxx:121
std::unique_ptr< AbstractSmParser > maParser
Definition: document.hxx:95
static void SaveSymbols()
Definition: document.cxx:1131
std::set< OUString > maUsedSymbols
Definition: document.hxx:97
Printer * GetPrt()
Definition: document.cxx:467
OutputDevice * GetRefDev()
Definition: document.cxx:493
std::unique_ptr< SmTableNode > mpTree
Definition: document.hxx:86
void Execute(SfxRequest &rReq)
Definition: document.cxx:822
virtual bool ConvertTo(SfxMedium &rMedium) override
Definition: document.cxx:756
void DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSelection=false)
Definition: document.cxx:310
virtual void SetModified(bool bModified=true) override
Definition: document.cxx:1210
VclPtr< Printer > mpTmpPrinter
Definition: document.hxx:91
void UpdateEditEngineDefaultFonts()
Definition: document.cxx:282
bool mbFormulaArranged
Definition: document.hxx:93
const SmFormat & GetFormat() const
Definition: document.hxx:172
rtl::Reference< SfxItemPool > mpEditEngineItemPool
Definition: document.hxx:88
std::unique_ptr< SmEditEngine > mpEditEngine
Definition: document.hxx:89
void readFormulaOoxml(oox::formulaimport::XmlStream &stream)
Definition: document.cxx:816
sal_uInt16 mnModifyCount
Definition: document.hxx:92
SvtLinguOptions maLinguOptions
Definition: document.hxx:85
virtual bool Load(SfxMedium &rMedium) override
Definition: document.cxx:648
virtual void FillClass(SvGlobalName *pClassName, SotClipboardFormatId *pFormat, OUString *pFullTypeName, sal_Int32 nFileFormat, bool bTemplate=false) const override
Definition: document.cxx:1190
sal_uInt16 mnSmSyntaxVersion
Definition: document.hxx:94
friend class SmCursor
Definition: document.hxx:80
void writeFormulaOoxml(const ::sax_fastparser::FSHelperPtr &pSerializer, oox::core::OoxmlVersion version, oox::drawingml::DocumentType documentType, const sal_Int8 nAlign)
Definition: document.cxx:789
Visitor for drawing SmNodes to OutputDevice.
Definition: visitors.hxx:208
static void setSmItemPool(SfxItemPool *mpItemPool, const SvtLinguOptions &maLangOptions)
Sets up default font parameters for the item pool.
Definition: smediteng.cxx:109
void ReadFrom(const SmFormat &rFormat)
Definition: dialog.cxx:397
void WriteTo(SmFormat &rFormat) const
Definition: dialog.cxx:411
void ReadFrom(const SmFormat &rFormat)
Definition: dialog.cxx:502
void WriteTo(SmFormat &rFormat) const
Definition: dialog.cxx:524
void SetTextmode(bool bVal)
Definition: format.hxx:127
bool IsTextmode() const
Definition: format.hxx:126
sal_uInt16 GetDistance(sal_uInt16 nIdent) const
Definition: format.hxx:120
void LaunchEvent(const sal_Int16 nAccessibleEventId, const css::uno::Any &rOldVal, const css::uno::Any &rNewVal)
SmGraphicAccessible * GetAccessible_Impl()
Definition: view.hxx:127
const SmFormat & GetStandardFormat() const
Definition: cfgitem.cxx:1093
bool IsAutoRedraw() const
Definition: cfgitem.cxx:1319
void SetAutoRedraw(bool bVal)
Definition: cfgitem.cxx:1327
void SetStandardFormat(const SmFormat &rFormat, bool bSaveFontFormatList=false)
Definition: cfgitem.cxx:1101
SmMathConfig * GetConfig()
Definition: smmod.cxx:162
SmSymbolManager & GetSymbolManager()
Definition: smmod.cxx:169
Class implementing writing of formulas to OOXML.
Definition: ooxmlexport.hxx:22
void ConvertFromStarMath(const ::sax_fastparser::FSHelperPtr &m_pSerializer, const sal_Int8)
Definition: ooxmlexport.cxx:28
Class implementing reading of formulas from OOXML.
Definition: ooxmlimport.hxx:20
OUString ConvertToStarMath()
Definition: ooxmlimport.cxx:41
SmPrinterAccess(SmDocShell &rDocShell)
Definition: document.cxx:403
VclPtr< Printer > pPrinter
Definition: document.hxx:67
OutputDevice * GetRefDev()
Definition: document.hxx:73
VclPtr< OutputDevice > pRefDev
Definition: document.hxx:68
Class implementing writing of formulas to RTF.
Definition: rtfexport.hxx:20
void ConvertFromStarMath(OStringBuffer &rBuffer, rtl_TextEncoding nEncoding)
Definition: rtfexport.cxx:22
SmGraphicWidget & GetGraphicWidget()
Definition: view.hxx:304
void SetUseHTMLMLEntities(bool bUseHTMLMLEntities)
void SetFlat(bool bIn)
bool Export(SfxMedium &rMedium)
ErrCode Import(SfxMedium &rMedium)
void useHTMLMLEntities(bool bUseHTMLMLEntities)
static bool IsStorageFile(OUString const &rFileName)
bool GetHighContrastMode() const
void GetOptions(SvtLinguOptions &rOptions) const
void disposeAndClear()
reference_type * get() const
static VclPtr< reference_type > Create(Arg &&... arg)
static bool implInitTextChangedEvent(std::u16string_view rOldString, std::u16string_view rNewString, css::uno::Any &rDeleted, css::uno::Any &rInserted)
#define SO3_SM_CLASSID_60
void SetPos(const Point &rPoint)
constexpr void SetRight(tools::Long v)
constexpr Size GetSize() const
constexpr bool IsWidthEmpty() const
constexpr void SetBottom(tools::Long v)
constexpr bool IsHeightEmpty() const
T * get() const
const AllSettings & GetSettings() const
virtual short run()
int nCount
#define DBG_UNHANDLED_EXCEPTION(...)
SFX_IMPL_SUPERCLASS_INTERFACE(DrawDocShell, SfxObjectShell)
Reference< XOutputStream > stream
#define STAROFFICE_XML
Definition: document.hxx:44
constexpr OUStringLiteral MATHML_XML
Definition: document.hxx:45
#define ERRCODE_NONE
#define SOFFICE_FILEFORMAT_8
#define SOFFICE_FILEFORMAT_60
#define DIS_BOTTOMSPACE
Definition: format.hxx:80
#define DIS_TOPSPACE
Definition: format.hxx:79
#define DIS_RIGHTSPACE
Definition: format.hxx:78
#define DIS_LEFTSPACE
Definition: format.hxx:77
SotClipboardFormatId
sal_Int64 n
#define LANGUAGE_ENGLISH
#define SAL_WARN_IF(condition, area, stream)
MapUnit
aBuf
@ Exception
int i
void SmMlIteratorFree(SmMlElement *pMlElementTree)
Definition: iterator.cxx:53
std::shared_ptr< FastSerializerHelper > FSHelperPtr
SFX_IMPL_OBJECTFACTORY(DrawDocShell, SvGlobalName(SO3_SIMPRESS_CLASSID), "simpress") void DrawDocShell
AbstractSmParser * GetVersionSmParser(sal_uInt16 nVersion)
Definition: parse.cxx:39
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
ComplexTextLayoutFlags
HashMap_OWString_Interface aMap
sal_Int16 nId
const char GetValue[]
OUTDEV_WINDOW
SfxModelFlags
static SfxItemSet & rSet
OUString SmResId(TranslateId aId)
Definition: smmod.cxx:42
#define SM_MOD()
Definition: smmod.hxx:98
Reference< XModel > xModel
bool bIsEnabled
sal_uInt16 sal_Unicode
signed char sal_Int8
SmViewShell * SmGetActiveView()
! Since this method is based on the current focus it is somewhat ! unreliable and may return unexpect...
Definition: utility.cxx:33
MapUnit SmMapUnit()
Definition: utility.hxx:121
RET_OK
std::unique_ptr< char[]> aBuffer