Kaydet (Commit) 60758229 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

refactor "basctl" classes to use RenderContext

Change-Id: I6eb54af9f793c614c823123c6f16a3dc4f3a0c0b
üst 9128ef68
...@@ -78,7 +78,7 @@ char const FilterMask_All[] = "*"; ...@@ -78,7 +78,7 @@ char const FilterMask_All[] = "*";
char const FilterMask_All[] = "*.*"; char const FilterMask_All[] = "*.*";
#endif #endif
} // namespace } // end anonymous namespace
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
...@@ -179,22 +179,13 @@ bool bSourceLinesEnabled = false; ...@@ -179,22 +179,13 @@ bool bSourceLinesEnabled = false;
} // namespace } // namespace
ModulWindow::ModulWindow (ModulWindowLayout* pParent, ScriptDocument const& rDocument,
const OUString& aLibName, const OUString& aName, OUString& aModule)
// ModulWindow : BaseWindow(pParent, rDocument, aLibName, aName)
, rLayout(*pParent)
, nValid(ValidWindow)
, aXEditorWindow(VclPtr<ComplexEditorWindow>::Create(this))
ModulWindow::ModulWindow ( , m_aModule(aModule)
ModulWindowLayout* pParent,
ScriptDocument const& rDocument,
const OUString& aLibName, const OUString& aName, OUString& aModule
) :
BaseWindow(pParent, rDocument, aLibName, aName),
rLayout(*pParent),
nValid(ValidWindow),
aXEditorWindow(VclPtr<ComplexEditorWindow>::Create(this)),
m_aModule(aModule)
{ {
aXEditorWindow->Show(); aXEditorWindow->Show();
SetBackground(); SetBackground();
...@@ -250,14 +241,13 @@ void ModulWindow::GetFocus() ...@@ -250,14 +241,13 @@ void ModulWindow::GetFocus()
void ModulWindow::DoInit() void ModulWindow::DoInit()
{ {
if ( GetVScrollBar() ) if (GetVScrollBar())
GetVScrollBar()->Hide(); GetVScrollBar()->Hide();
GetHScrollBar()->Show(); GetHScrollBar()->Show();
GetEditorWindow().InitScrollBars(); GetEditorWindow().InitScrollBars();
} }
void ModulWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle&)
void ModulWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& )
{ {
} }
...@@ -267,7 +257,6 @@ void ModulWindow::Resize() ...@@ -267,7 +257,6 @@ void ModulWindow::Resize()
Size( GetOutputSizePixel() ) ); Size( GetOutputSizePixel() ) );
} }
void ModulWindow::CheckCompileBasic() void ModulWindow::CheckCompileBasic()
{ {
if ( XModule().Is() ) if ( XModule().Is() )
...@@ -775,7 +764,6 @@ void ModulWindow::EditMacro( const OUString& rMacroName ) ...@@ -775,7 +764,6 @@ void ModulWindow::EditMacro( const OUString& rMacroName )
} }
} }
void ModulWindow::StoreData() void ModulWindow::StoreData()
{ {
// StoreData is called when the BasicManager is destroyed or // StoreData is called when the BasicManager is destroyed or
...@@ -789,13 +777,11 @@ bool ModulWindow::CanClose() ...@@ -789,13 +777,11 @@ bool ModulWindow::CanClose()
return true; return true;
} }
bool ModulWindow::AllowUndo() bool ModulWindow::AllowUndo()
{ {
return GetEditorWindow().CanModify(); return GetEditorWindow().CanModify();
} }
void ModulWindow::UpdateData() void ModulWindow::UpdateData()
{ {
DBG_ASSERT( XModule().Is(), "Kein Modul!" ); DBG_ASSERT( XModule().Is(), "Kein Modul!" );
...@@ -901,7 +887,6 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage ) ...@@ -901,7 +887,6 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
return nCurPage; return nCurPage;
} }
void ModulWindow::ExecuteCommand (SfxRequest& rReq) void ModulWindow::ExecuteCommand (SfxRequest& rReq)
{ {
AssertValidEditEngine(); AssertValidEditEngine();
...@@ -1179,7 +1164,6 @@ void ModulWindow::GetState( SfxItemSet &rSet ) ...@@ -1179,7 +1164,6 @@ void ModulWindow::GetState( SfxItemSet &rSet )
} }
} }
void ModulWindow::DoScroll( ScrollBar* pCurScrollBar ) void ModulWindow::DoScroll( ScrollBar* pCurScrollBar )
{ {
if ( ( pCurScrollBar == GetHScrollBar() ) && GetEditView() ) if ( ( pCurScrollBar == GetHScrollBar() ) && GetEditView() )
...@@ -1193,14 +1177,11 @@ void ModulWindow::DoScroll( ScrollBar* pCurScrollBar ) ...@@ -1193,14 +1177,11 @@ void ModulWindow::DoScroll( ScrollBar* pCurScrollBar )
} }
} }
bool ModulWindow::IsModified() bool ModulWindow::IsModified()
{ {
return GetEditEngine() && GetEditEngine()->IsModified(); return GetEditEngine() && GetEditEngine()->IsModified();
} }
void ModulWindow::GoOnTop() void ModulWindow::GoOnTop()
{ {
GetShell()->GetViewFrame()->ToTop(); GetShell()->GetViewFrame()->ToTop();
...@@ -1234,7 +1215,6 @@ void ModulWindow::ShowCursor( bool bOn ) ...@@ -1234,7 +1215,6 @@ void ModulWindow::ShowCursor( bool bOn )
} }
} }
void ModulWindow::AssertValidEditEngine() void ModulWindow::AssertValidEditEngine()
{ {
if ( !GetEditEngine() ) if ( !GetEditEngine() )
...@@ -1295,7 +1275,7 @@ sal_uInt16 ModulWindow::StartSearchAndReplace( const SvxSearchItem& rSearchItem, ...@@ -1295,7 +1275,7 @@ sal_uInt16 ModulWindow::StartSearchAndReplace( const SvxSearchItem& rSearchItem,
return nFound; return nFound;
} }
::svl::IUndoManager* ModulWindow::GetUndoManager() svl::IUndoManager* ModulWindow::GetUndoManager()
{ {
if ( GetEditEngine() ) if ( GetEditEngine() )
return &GetEditEngine()->GetUndoManager(); return &GetEditEngine()->GetUndoManager();
...@@ -1462,12 +1442,6 @@ void ModulWindow::UpdateModule () ...@@ -1462,12 +1442,6 @@ void ModulWindow::UpdateModule ()
MarkDocumentModified(m_aDocument); MarkDocumentModified(m_aDocument);
} }
// ModulWindowLayout
ModulWindowLayout::ModulWindowLayout (vcl::Window* pParent, ObjectCatalog& rObjectCatalog_) : ModulWindowLayout::ModulWindowLayout (vcl::Window* pParent, ObjectCatalog& rObjectCatalog_) :
Layout(pParent), Layout(pParent),
pChild(0), pChild(0),
...@@ -1495,9 +1469,9 @@ void ModulWindowLayout::UpdateDebug (bool bBasicStopped) ...@@ -1495,9 +1469,9 @@ void ModulWindowLayout::UpdateDebug (bool bBasicStopped)
aStackWindow->UpdateCalls(); aStackWindow->UpdateCalls();
} }
void ModulWindowLayout::Paint (vcl::RenderContext& /*rRenderContext*/, Rectangle const&) void ModulWindowLayout::Paint (vcl::RenderContext& rRenderContext, Rectangle const&)
{ {
DrawText(Point(), IDEResId(RID_STR_NOMODULE).toString()); rRenderContext.DrawText(Point(), IDEResId(RID_STR_NOMODULE).toString());
} }
// virtual // virtual
...@@ -1508,7 +1482,6 @@ void ModulWindowLayout::DataChanged (DataChangedEvent const& rDCEvt) ...@@ -1508,7 +1482,6 @@ void ModulWindowLayout::DataChanged (DataChangedEvent const& rDCEvt)
aSyntaxColors.SettingsChanged(); aSyntaxColors.SettingsChanged();
} }
void ModulWindowLayout::Activating (BaseWindow& rChild) void ModulWindowLayout::Activating (BaseWindow& rChild)
{ {
assert(dynamic_cast<ModulWindow*>(&rChild)); assert(dynamic_cast<ModulWindow*>(&rChild));
...@@ -1563,12 +1536,6 @@ void ModulWindowLayout::OnFirstSize (long const nWidth, long const nHeight) ...@@ -1563,12 +1536,6 @@ void ModulWindowLayout::OnFirstSize (long const nWidth, long const nHeight)
AddToBottom(aStackWindow.get(), Size(nWidth * 0.33, nHeight * 0.25)); AddToBottom(aStackWindow.get(), Size(nWidth * 0.33, nHeight * 0.25));
} }
// SyntaxColors
ModulWindowLayout::SyntaxColors::SyntaxColors () : ModulWindowLayout::SyntaxColors::SyntaxColors () :
pEditor(0) pEditor(0)
{ {
......
...@@ -177,9 +177,9 @@ private: ...@@ -177,9 +177,9 @@ private:
void setBackgroundColor(Color aColor); void setBackgroundColor(Color aColor);
protected: protected:
virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) SAL_OVERRIDE; virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle&) SAL_OVERRIDE;
BreakPoint* FindBreakPoint( const Point& rMousePos ); BreakPoint* FindBreakPoint( const Point& rMousePos );
void ShowMarker( bool bShow ); void ShowMarker(vcl::RenderContext& rRenderContext);
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
......
...@@ -71,23 +71,20 @@ char const FilterMask_All[] = "*"; ...@@ -71,23 +71,20 @@ char const FilterMask_All[] = "*";
TYPEINIT1( DialogWindow, BaseWindow ); TYPEINIT1( DialogWindow, BaseWindow );
DialogWindow::DialogWindow ( DialogWindow::DialogWindow(DialogWindowLayout* pParent, ScriptDocument const& rDocument,
DialogWindowLayout* pParent,
ScriptDocument const& rDocument,
const OUString& aLibName, const OUString& aName, const OUString& aLibName, const OUString& aName,
com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> const& xDialogModel css::uno::Reference<css::container::XNameContainer> const& xDialogModel)
) : : BaseWindow(pParent, rDocument, aLibName, aName)
BaseWindow(pParent, rDocument, aLibName, aName), ,rLayout(*pParent)
rLayout(*pParent), ,pEditor(new DlgEditor(*this, rLayout, rDocument.isDocument()
pEditor(new DlgEditor(*this, rLayout, rDocument.isDocument() ? rDocument.getDocument() : Reference<frame::XModel>(), xDialogModel)), ? rDocument.getDocument()
pUndoMgr(new SfxUndoManager) : Reference<frame::XModel>(), xDialogModel))
,pUndoMgr(new SfxUndoManager)
{ {
InitSettings( true, true, true ); InitSettings( true, true, true );
aOldNotifyUndoActionHdl = pEditor->GetModel().GetNotifyUndoActionHdl(); aOldNotifyUndoActionHdl = pEditor->GetModel().GetNotifyUndoActionHdl();
pEditor->GetModel().SetNotifyUndoActionHdl( pEditor->GetModel().SetNotifyUndoActionHdl(LINK(this, DialogWindow, NotifyUndoActionHdl));
LINK(this, DialogWindow, NotifyUndoActionHdl)
);
SetHelpId( HID_BASICIDE_DIALOGWINDOW ); SetHelpId( HID_BASICIDE_DIALOGWINDOW );
...@@ -108,24 +105,19 @@ void DialogWindow::LoseFocus() ...@@ -108,24 +105,19 @@ void DialogWindow::LoseFocus()
Window::LoseFocus(); Window::LoseFocus();
} }
void DialogWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
void DialogWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect )
{ {
pEditor->Paint( rRect ); pEditor->Paint(rRenderContext, rRect);
} }
void DialogWindow::Resize() void DialogWindow::Resize()
{ {
if ( GetHScrollBar() && GetVScrollBar() ) { if (GetHScrollBar() && GetVScrollBar())
{
pEditor->SetScrollBars( GetHScrollBar(), GetVScrollBar() ); pEditor->SetScrollBars( GetHScrollBar(), GetVScrollBar() );
} }
} }
void DialogWindow::MouseButtonDown( const MouseEvent& rMEvt ) void DialogWindow::MouseButtonDown( const MouseEvent& rMEvt )
{ {
pEditor->MouseButtonDown( rMEvt ); pEditor->MouseButtonDown( rMEvt );
...@@ -134,8 +126,6 @@ void DialogWindow::MouseButtonDown( const MouseEvent& rMEvt ) ...@@ -134,8 +126,6 @@ void DialogWindow::MouseButtonDown( const MouseEvent& rMEvt )
pBindings->Invalidate( SID_SHOW_PROPERTYBROWSER ); pBindings->Invalidate( SID_SHOW_PROPERTYBROWSER );
} }
void DialogWindow::MouseButtonUp( const MouseEvent& rMEvt ) void DialogWindow::MouseButtonUp( const MouseEvent& rMEvt )
{ {
pEditor->MouseButtonUp( rMEvt ); pEditor->MouseButtonUp( rMEvt );
...@@ -155,15 +145,11 @@ void DialogWindow::MouseButtonUp( const MouseEvent& rMEvt ) ...@@ -155,15 +145,11 @@ void DialogWindow::MouseButtonUp( const MouseEvent& rMEvt )
} }
} }
void DialogWindow::MouseMove( const MouseEvent& rMEvt ) void DialogWindow::MouseMove( const MouseEvent& rMEvt )
{ {
pEditor->MouseMove( rMEvt ); pEditor->MouseMove( rMEvt );
} }
void DialogWindow::KeyInput( const KeyEvent& rKEvt ) void DialogWindow::KeyInput( const KeyEvent& rKEvt )
{ {
SfxBindings* pBindings = GetBindingsPtr(); SfxBindings* pBindings = GetBindingsPtr();
...@@ -238,8 +224,6 @@ IMPL_STATIC_LINK( ...@@ -238,8 +224,6 @@ IMPL_STATIC_LINK(
return 0; return 0;
} }
void DialogWindow::DoInit() void DialogWindow::DoInit()
{ {
GetHScrollBar()->Show(); GetHScrollBar()->Show();
...@@ -247,8 +231,6 @@ void DialogWindow::DoInit() ...@@ -247,8 +231,6 @@ void DialogWindow::DoInit()
pEditor->SetScrollBars( GetHScrollBar(), GetVScrollBar() ); pEditor->SetScrollBars( GetHScrollBar(), GetVScrollBar() );
} }
void DialogWindow::DoScroll( ScrollBar* pCurScrollBar ) void DialogWindow::DoScroll( ScrollBar* pCurScrollBar )
{ {
pEditor->DoScroll( pCurScrollBar ); pEditor->DoScroll( pCurScrollBar );
......
...@@ -36,24 +36,24 @@ void LineNumberWindow::dispose() ...@@ -36,24 +36,24 @@ void LineNumberWindow::dispose()
Window::dispose(); Window::dispose();
} }
void LineNumberWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) void LineNumberWindow::Paint( vcl::RenderContext& rRenderContext, const Rectangle&)
{ {
if(SyncYOffset()) if(SyncYOffset())
return; return;
ExtTextEngine* txtEngine = m_pModulWindow->GetEditEngine(); ExtTextEngine* txtEngine = m_pModulWindow->GetEditEngine();
if(!txtEngine) if (!txtEngine)
return; return;
TextView* txtView = m_pModulWindow->GetEditView(); TextView* txtView = m_pModulWindow->GetEditView();
if(!txtView) if (!txtView)
return; return;
GetParent()->Resize(); GetParent()->Resize();
int windowHeight = GetOutputSize().Height(); int windowHeight = rRenderContext.GetOutputSize().Height();
int nLineHeight = GetTextHeight(); int nLineHeight = rRenderContext.GetTextHeight();
if(!nLineHeight) if (!nLineHeight)
{ {
return; return;
} }
...@@ -62,7 +62,7 @@ void LineNumberWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rect ...@@ -62,7 +62,7 @@ void LineNumberWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rect
int nStartLine = startY / nLineHeight + 1; int nStartLine = startY / nLineHeight + 1;
int nEndLine = (startY + windowHeight) / nLineHeight + 1; int nEndLine = (startY + windowHeight) / nLineHeight + 1;
if(txtEngine->GetParagraphCount() + 1 < (unsigned int)nEndLine) if (txtEngine->GetParagraphCount() + 1 < (unsigned int)nEndLine)
nEndLine = txtEngine->GetParagraphCount() + 1; nEndLine = txtEngine->GetParagraphCount() + 1;
// FIXME: it would be best if we could get notified of a font change // FIXME: it would be best if we could get notified of a font change
...@@ -72,15 +72,15 @@ void LineNumberWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rect ...@@ -72,15 +72,15 @@ void LineNumberWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rect
// reserve enough for 3 sigit minimum, with a bit to spare for confort // reserve enough for 3 sigit minimum, with a bit to spare for confort
m_nWidth = m_nBaseWidth * 3 + m_nBaseWidth / 2; m_nWidth = m_nBaseWidth * 3 + m_nBaseWidth / 2;
int i = (nEndLine + 1) / 1000; int i = (nEndLine + 1) / 1000;
while(i) while (i)
{ {
i /= 10; i /= 10;
m_nWidth += m_nBaseWidth; m_nWidth += m_nBaseWidth;
} }
sal_Int64 y = (nStartLine - 1) * (sal_Int64)nLineHeight; sal_Int64 y = (nStartLine - 1) * (sal_Int64)nLineHeight;
for(sal_Int32 n = nStartLine; n <= nEndLine; ++n, y += nLineHeight) for (sal_Int32 n = nStartLine; n <= nEndLine; ++n, y += nLineHeight)
DrawText(Point(0, y - m_nCurYOffset), OUString::number(n)); rRenderContext.DrawText(Point(0, y - m_nCurYOffset), OUString::number(n));
} }
void LineNumberWindow::DataChanged(DataChangedEvent const & rDCEvt) void LineNumberWindow::DataChanged(DataChangedEvent const & rDCEvt)
......
...@@ -26,7 +26,7 @@ private: ...@@ -26,7 +26,7 @@ private:
virtual void DataChanged (DataChangedEvent const& rDCEvt) SAL_OVERRIDE; virtual void DataChanged (DataChangedEvent const& rDCEvt) SAL_OVERRIDE;
protected: protected:
virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) SAL_OVERRIDE; virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
public: public:
LineNumberWindow (vcl::Window* pParent, ModulWindow* pModulWin); LineNumberWindow (vcl::Window* pParent, ModulWindow* pModulWin);
......
...@@ -472,31 +472,29 @@ bool DlgEditor::KeyInput( const KeyEvent& rKEvt ) ...@@ -472,31 +472,29 @@ bool DlgEditor::KeyInput( const KeyEvent& rKEvt )
} }
void DlgEditor::Paint( const Rectangle& rRect ) void DlgEditor::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
{ {
aPaintRect = rRect; aPaintRect = rRect;
mnPaintGuard++; mnPaintGuard++;
Size aMacSize; Size aMacSize;
if( bFirstDraw && if (bFirstDraw && rWindow.IsVisible() && (rRenderContext.GetOutputSize() != aMacSize))
rWindow.IsVisible() &&
(rWindow.GetOutputSize() != aMacSize) )
{ {
bFirstDraw = false; bFirstDraw = false;
// get property set // get property set
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPSet(pDlgEdForm->GetUnoControlModel(), ::com::sun::star::uno::UNO_QUERY); css::uno::Reference<css::beans::XPropertySet> xPSet(pDlgEdForm->GetUnoControlModel(), css::uno::UNO_QUERY);
if ( xPSet.is() ) if (xPSet.is())
{ {
// get dialog size from properties // get dialog size from properties
sal_Int32 nWidth = 0, nHeight = 0; sal_Int32 nWidth = 0, nHeight = 0;
xPSet->getPropertyValue( DLGED_PROP_WIDTH ) >>= nWidth; xPSet->getPropertyValue( DLGED_PROP_WIDTH ) >>= nWidth;
xPSet->getPropertyValue( DLGED_PROP_HEIGHT ) >>= nHeight; xPSet->getPropertyValue( DLGED_PROP_HEIGHT ) >>= nHeight;
if ( nWidth == 0 && nHeight == 0 ) if (nWidth == 0 && nHeight == 0)
{ {
Size aSize = rWindow.PixelToLogic( Size( 400, 300 ) ); Size aSize = rRenderContext.PixelToLogic( Size( 400, 300 ) );
// align with grid // align with grid
Size aGridSize_(long(pDlgEdView->GetSnapGridWidthX()), long(pDlgEdView->GetSnapGridWidthY())); Size aGridSize_(long(pDlgEdView->GetSnapGridWidthX()), long(pDlgEdView->GetSnapGridWidthY()));
...@@ -504,7 +502,7 @@ void DlgEditor::Paint( const Rectangle& rRect ) ...@@ -504,7 +502,7 @@ void DlgEditor::Paint( const Rectangle& rRect )
aSize.Height() -= aSize.Height() % aGridSize_.Height(); aSize.Height() -= aSize.Height() % aGridSize_.Height();
Point aPos; Point aPos;
Size aOutSize = rWindow.GetOutputSize(); Size aOutSize = rRenderContext.GetOutputSize();
aPos.X() = (aOutSize.Width()>>1) - (aSize.Width()>>1); aPos.X() = (aOutSize.Width()>>1) - (aSize.Width()>>1);
aPos.Y() = (aOutSize.Height()>>1) - (aSize.Height()>>1); aPos.Y() = (aOutSize.Height()>>1) - (aSize.Height()>>1);
...@@ -513,7 +511,7 @@ void DlgEditor::Paint( const Rectangle& rRect ) ...@@ -513,7 +511,7 @@ void DlgEditor::Paint( const Rectangle& rRect )
aPos.Y() -= aPos.Y() % aGridSize_.Height(); aPos.Y() -= aPos.Y() % aGridSize_.Height();
// don't put in the corner // don't put in the corner
Point aMinPos = rWindow.PixelToLogic( Point( 30, 20 ) ); Point aMinPos = rRenderContext.PixelToLogic( Point( 30, 20 ) );
if( (aPos.X() < aMinPos.X()) || (aPos.Y() < aMinPos.Y()) ) if( (aPos.X() < aMinPos.X()) || (aPos.Y() < aMinPos.Y()) )
{ {
aPos = aMinPos; aPos = aMinPos;
...@@ -531,40 +529,45 @@ void DlgEditor::Paint( const Rectangle& rRect ) ...@@ -531,40 +529,45 @@ void DlgEditor::Paint( const Rectangle& rRect )
// set position and size of controls // set position and size of controls
if (const size_t nObjCount = pDlgEdPage->GetObjCount()) if (const size_t nObjCount = pDlgEdPage->GetObjCount())
{ {
for ( size_t i = 0 ; i < nObjCount ; ++i ) for (size_t i = 0 ; i < nObjCount ; ++i)
{
if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pDlgEdPage->GetObj(i))) if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pDlgEdPage->GetObj(i)))
{
if (!dynamic_cast<DlgEdForm*>(pDlgEdObj)) if (!dynamic_cast<DlgEdForm*>(pDlgEdObj))
{
pDlgEdObj->SetRectFromProps(); pDlgEdObj->SetRectFromProps();
} }
} }
} }
} }
}
}
}
// repaint, get PageView and prepare Region // repaint, get PageView and prepare Region
SdrPageView* pPgView = pDlgEdView->GetSdrPageView(); SdrPageView* pPgView = pDlgEdView->GetSdrPageView();
const vcl::Region aPaintRectRegion(aPaintRect); const vcl::Region aPaintRectRegion(aPaintRect);
// #i74769# // #i74769#
SdrPaintWindow* pTargetPaintWindow = 0; SdrPaintWindow* pTargetPaintWindow = 0;
// mark repaint start // mark repaint start
if(pPgView) if (pPgView)
{ {
pTargetPaintWindow = pPgView->GetView().BeginDrawLayers(&rWindow, aPaintRectRegion); pTargetPaintWindow = pPgView->GetView().BeginDrawLayers(&rRenderContext, aPaintRectRegion);
OSL_ENSURE(pTargetPaintWindow, "BeginDrawLayers: Got no SdrPaintWindow (!)"); OSL_ENSURE(pTargetPaintWindow, "BeginDrawLayers: Got no SdrPaintWindow (!)");
} }
// draw background self using wallpaper // draw background self using wallpaper
// #i79128# ...and use correct OutDev for that // #i79128# ...and use correct OutDev for that
if(pTargetPaintWindow) if (pTargetPaintWindow)
{ {
OutputDevice& rTargetOutDev = pTargetPaintWindow->GetTargetOutputDevice(); OutputDevice& rTargetOutDev = pTargetPaintWindow->GetTargetOutputDevice();
rTargetOutDev.DrawWallpaper(aPaintRect, Wallpaper(Color(COL_WHITE))); rTargetOutDev.DrawWallpaper(aPaintRect, Wallpaper(Color(COL_WHITE)));
} }
// do paint (unbuffered) and mark repaint end // do paint (unbuffered) and mark repaint end
if(pPgView) if (pPgView)
{ {
// paint of control layer is done in EndDrawLayers anyway... // paint of control layer is done in EndDrawLayers anyway...
pPgView->GetView().EndDrawLayers(*pTargetPaintWindow, true); pPgView->GetView().EndDrawLayers(*pTargetPaintWindow, true);
...@@ -609,9 +612,6 @@ void DlgEditor::SetInsertObj( sal_uInt16 eObj ) ...@@ -609,9 +612,6 @@ void DlgEditor::SetInsertObj( sal_uInt16 eObj )
pDlgEdView->SetCurrentObj( eActObj, DlgInventor ); pDlgEdView->SetCurrentObj( eActObj, DlgInventor );
} }
void DlgEditor::CreateDefaultObject() void DlgEditor::CreateDefaultObject()
{ {
// create object by factory // create object by factory
......
...@@ -62,7 +62,7 @@ private: ...@@ -62,7 +62,7 @@ private:
OUString aCurPath; OUString aCurPath;
protected: protected:
virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& ) SAL_OVERRIDE; virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <vcl/timer.hxx> #include <vcl/timer.hxx>
#include <vcl/idle.hxx> #include <vcl/idle.hxx>
#include <vcl/vclptr.hxx> #include <vcl/vclptr.hxx>
#include <vcl/window.hxx>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
...@@ -184,7 +185,7 @@ public: ...@@ -184,7 +185,7 @@ public:
void MouseButtonDown( const MouseEvent& rMEvt ); void MouseButtonDown( const MouseEvent& rMEvt );
void MouseButtonUp( const MouseEvent& rMEvt ); void MouseButtonUp( const MouseEvent& rMEvt );
void MouseMove( const MouseEvent& rMEvt ); void MouseMove( const MouseEvent& rMEvt );
void Paint( const Rectangle& rRect ); void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect);
bool KeyInput( const KeyEvent& rKEvt ); bool KeyInput( const KeyEvent& rKEvt );
void SetMode (Mode eMode); void SetMode (Mode eMode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment