diff options
Diffstat (limited to 'starmath/source')
-rw-r--r-- | starmath/source/document.cxx | 72 | ||||
-rw-r--r-- | starmath/source/view.cxx | 47 |
2 files changed, 46 insertions, 73 deletions
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 12083e489158..0d123ec4cc50 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -567,54 +567,49 @@ SmPrinterAccess::~SmPrinterAccess() pRefDev->Pop(); } - - Printer* SmDocShell::GetPrt() { - if ( SfxObjectCreateMode::EMBEDDED == GetCreateMode() ) + if (SfxObjectCreateMode::EMBEDDED == GetCreateMode()) { // Normally the server provides the printer. But if it doesn't provide one (e.g. because // there is no connection) it still can be the case that we know the printer because it // has been passed on by the server in OnDocumentPrinterChanged and being kept temporarily. - Printer *pPrt = GetDocumentPrinter(); - if ( !pPrt && pTmpPrinter ) + Printer* pPrt = GetDocumentPrinter(); + if (!pPrt && pTmpPrinter) pPrt = pTmpPrinter; return pPrt; } - else if ( !pPrinter ) + else if (!pPrinter) { - SfxItemSet *pOptions = - new SfxItemSet(GetPool(), - SID_PRINTSIZE, SID_PRINTSIZE, - SID_PRINTZOOM, SID_PRINTZOOM, - SID_PRINTTITLE, SID_PRINTTITLE, - SID_PRINTTEXT, SID_PRINTTEXT, - SID_PRINTFRAME, SID_PRINTFRAME, - SID_NO_RIGHT_SPACES, SID_NO_RIGHT_SPACES, - SID_SAVE_ONLY_USED_SYMBOLS, SID_SAVE_ONLY_USED_SYMBOLS, - 0); - + SfxItemSet* pOptions = new SfxItemSet(GetPool(), + SID_PRINTSIZE, SID_PRINTSIZE, + SID_PRINTZOOM, SID_PRINTZOOM, + SID_PRINTTITLE, SID_PRINTTITLE, + SID_PRINTTEXT, SID_PRINTTEXT, + SID_PRINTFRAME, SID_PRINTFRAME, + SID_NO_RIGHT_SPACES, SID_NO_RIGHT_SPACES, + SID_SAVE_ONLY_USED_SYMBOLS, SID_SAVE_ONLY_USED_SYMBOLS, + 0); SmModule *pp = SM_MOD(); pp->GetConfig()->ConfigToItemSet(*pOptions); pPrinter = VclPtr<SfxPrinter>::Create(pOptions); - pPrinter->SetMapMode( MapMode(MAP_100TH_MM) ); + pPrinter->SetMapMode(MapMode(MAP_100TH_MM)); } return pPrinter; } OutputDevice* SmDocShell::GetRefDev() { - if ( SfxObjectCreateMode::EMBEDDED == GetCreateMode() ) + if (SfxObjectCreateMode::EMBEDDED == GetCreateMode()) { OutputDevice* pOutDev = GetDocumentRefDev(); - if ( pOutDev ) + if (pOutDev) return pOutDev; } return GetPrt(); } - void SmDocShell::SetPrinter( SfxPrinter *pNew ) { pPrinter.disposeAndClear(); @@ -638,31 +633,30 @@ void SmDocShell::OnDocumentPrinterChanged( Printer *pPrt ) void SmDocShell::Repaint() { bool bIsEnabled = IsEnableSetModified(); - if ( bIsEnabled ) + if (bIsEnabled) EnableSetModified( false ); - SetFormulaArranged( false ); + SetFormulaArranged(false); Size aVisSize = GetSize(); - SetVisAreaSize( aVisSize ); - SmViewShell *pViewSh = SmGetActiveView(); + SetVisAreaSize(aVisSize); + SmViewShell* pViewSh = SmGetActiveView(); if (pViewSh) pViewSh->GetGraphicWindow().Invalidate(); - if ( bIsEnabled ) - EnableSetModified( bIsEnabled ); + if (bIsEnabled) + EnableSetModified(bIsEnabled); } - -SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags ) : - SfxObjectShell( i_nSfxCreationFlags ), - pTree ( 0 ), - pEditEngineItemPool ( 0 ), - pEditEngine ( 0 ), - pPrinter ( 0 ), - pTmpPrinter ( 0 ), - nModifyCount ( 0 ), - bIsFormulaArranged ( false ) +SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags ) + : SfxObjectShell(i_nSfxCreationFlags) + , pTree(0) + , pEditEngineItemPool(0) + , pEditEngine(0) + , pPrinter(0) + , pTmpPrinter(0) + , nModifyCount(0) + , bIsFormulaArranged(false) { pCursor = NULL; @@ -674,11 +668,9 @@ SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags ) : StartListening(aFormat); StartListening(*pp->GetConfig()); - SetBaseModel( new SmModel(this) ); + SetBaseModel(new SmModel(this)); } - - SmDocShell::~SmDocShell() { SmModule *pp = SM_MOD(); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index a5c541cce82d..12f5c4ceb83d 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -787,7 +787,6 @@ SfxChildAlignment SmCmdBoxWindow::CheckAlignment(SfxChildAlignment eActual, return eActual; } - void SmCmdBoxWindow::StateChanged( StateChangedType nStateChange ) { if (StateChangedType::InitShow == nStateChange) @@ -804,7 +803,6 @@ void SmCmdBoxWindow::StateChanged( StateChangedType nStateChange ) SfxDockingWindow::StateChanged( nStateChange ); } - IMPL_LINK_NOARG_TYPED( SmCmdBoxWindow, InitialFocusTimerHdl, Timer *, void ) { // We want to have the focus in the edit window once Math has been opened @@ -844,7 +842,6 @@ IMPL_LINK_NOARG_TYPED( SmCmdBoxWindow, InitialFocusTimerHdl, Timer *, void ) } } - void SmCmdBoxWindow::AdjustPosition() { Point aPt; @@ -859,7 +856,6 @@ void SmCmdBoxWindow::AdjustPosition() SetPosPixel( aPos ); } - void SmCmdBoxWindow::ToggleFloatingMode() { SfxDockingWindow::ToggleFloatingMode(); @@ -868,16 +864,12 @@ void SmCmdBoxWindow::ToggleFloatingMode() GetFloatingWindow()->SetMinOutputSizePixel(Size (200, 50)); } - void SmCmdBoxWindow::GetFocus() { if (!bExiting) aEdit->GrabFocus(); } -/**************************************************************************/ - - SFX_IMPL_DOCKINGWINDOW_WITHID(SmCmdBoxWrapper, SID_CMDBOXWINDOW); SmCmdBoxWrapper::SmCmdBoxWrapper(vcl::Window *pParentWindow, sal_uInt16 nId, @@ -892,7 +884,6 @@ SmCmdBoxWrapper::SmCmdBoxWrapper(vcl::Window *pParentWindow, sal_uInt16 nId, static_cast<SfxDockingWindow *>(pWindow.get())->Initialize(pInfo); } - #if OSL_DEBUG_LEVEL > 1 SmCmdBoxWrapper::~SmCmdBoxWrapper() { @@ -906,7 +897,7 @@ struct SmViewShell_Impl SvtMiscOptions aOpts; }; -TYPEINIT1( SmViewShell, SfxViewShell ); +TYPEINIT1(SmViewShell, SfxViewShell); SFX_IMPL_SUPERCLASS_INTERFACE(SmViewShell, SfxViewShell) @@ -931,7 +922,6 @@ void SmViewShell::AdjustPosSizePixel(const Point &rPos, const Size &rSize) aGraphic->SetPosSizePixel(rPos, rSize); } - void SmViewShell::InnerResizePixel(const Point &rOfs, const Size &rSize) { Size aObjSize = GetObjectShell()->GetVisArea().GetSize(); @@ -947,7 +937,6 @@ void SmViewShell::InnerResizePixel(const Point &rOfs, const Size &rSize) GetGraphicWindow().SetTotalSize(); } - void SmViewShell::OuterResizePixel(const Point &rOfs, const Size &rSize) { SmGraphicWindow &rWin = GetGraphicWindow(); @@ -957,13 +946,11 @@ void SmViewShell::OuterResizePixel(const Point &rOfs, const Size &rSize) rWin.Update(); } - void SmViewShell::QueryObjAreaPixel( Rectangle& rRect ) const { rRect.SetSize( GetGraphicWindow().GetSizePixel() ); } - void SmViewShell::SetZoomFactor( const Fraction &rX, const Fraction &rY ) { const Fraction &rFrac = rX < rY ? rX : rY; @@ -974,7 +961,6 @@ void SmViewShell::SetZoomFactor( const Fraction &rX, const Fraction &rY ) SfxViewShell::SetZoomFactor( rX, rY ); } - Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const OUString& rLine) { Size aSize(rDevice.GetTextWidth(rLine), rDevice.GetTextHeight()); @@ -1004,9 +990,9 @@ Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const OUString& rLine) Size SmViewShell::GetTextSize(OutputDevice& rDevice, const OUString& rText, long MaxWidth) { - Size aSize; - Size TextSize; - sal_uInt16 nLines = comphelper::string::getTokenCount(rText, '\n'); + Size aSize; + Size aTextSize; + sal_uInt16 nLines = comphelper::string::getTokenCount(rText, '\n'); for (sal_uInt16 i = 0; i < nLines; i++) { @@ -1041,8 +1027,8 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const OUString& rText, long aText = aLine.copy(0, m); aLine = aLine.replaceAt(0, m, ""); aSize = GetTextLineSize(rDevice, aText); - TextSize.Height() += aSize.Height(); - TextSize.Width() = std::max(TextSize.Width(), std::min(aSize.Width(), MaxWidth)); + aTextSize.Height() += aSize.Height(); + aTextSize.Width() = std::max(aTextSize.Width(), std::min(aSize.Width(), MaxWidth)); aLine = comphelper::string::stripStart(aLine, ' '); aLine = comphelper::string::stripStart(aLine, '\t'); @@ -1052,18 +1038,17 @@ Size SmViewShell::GetTextSize(OutputDevice& rDevice, const OUString& rText, long } else { - TextSize.Height() += aSize.Height(); - TextSize.Width() = std::max(TextSize.Width(), aSize.Width()); + aTextSize.Height() += aSize.Height(); + aTextSize.Width() = std::max(aTextSize.Width(), aSize.Width()); } } - return TextSize; + return aTextSize; } - void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, const OUString& rLine) { - Point aPoint (rPosition); + Point aPoint(rPosition); sal_uInt16 nTabs = comphelper::string::getTokenCount(rLine, '\t'); long nTabPos = 0; @@ -1092,8 +1077,8 @@ void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, co void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const OUString& rText, sal_uInt16 MaxWidth) { sal_uInt16 nLines = comphelper::string::getTokenCount(rText, '\n'); - Point aPoint (rPosition); - Size aSize; + Point aPoint(rPosition); + Size aSize; for (sal_uInt16 i = 0; i < nLines; i++) { @@ -1298,8 +1283,8 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri SfxPrinter* SmViewShell::GetPrinter(bool bCreate) { - SmDocShell *pDoc = GetDoc(); - if ( pDoc->HasPrinter() || bCreate ) + SmDocShell* pDoc = GetDoc(); + if (pDoc->HasPrinter() || bCreate) return pDoc->GetPrinter(); return 0; } @@ -1372,7 +1357,6 @@ void SmViewShell::NextError() ShowError( pErrorDesc ); } - void SmViewShell::PrevError() { SAL_WARN_IF( !GetDoc(), "starmath", "Document missing" ); @@ -1382,7 +1366,6 @@ void SmViewShell::PrevError() ShowError( pErrorDesc ); } - void SmViewShell::Insert( SfxMedium& rMedium ) { SmDocShell *pDoc = GetDoc(); @@ -1890,7 +1873,6 @@ void SmViewShell::GetState(SfxItemSet &rSet) } } - SmViewShell::SmViewShell(SfxViewFrame *pFrame_, SfxViewShell *) : SfxViewShell(pFrame_, SfxViewShellFlags::HAS_PRINTOPTIONS | SfxViewShellFlags::CAN_PRINT) , pImpl(new SmViewShell_Impl) @@ -1927,7 +1909,6 @@ void SmViewShell::Deactivate( bool bIsMDIActivate ) SfxViewShell::Deactivate( bIsMDIActivate ); } - void SmViewShell::Activate( bool bIsMDIActivate ) { SfxViewShell::Activate( bIsMDIActivate ); |