Kaydet (Commit) 835556b5 authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

Prefix SvxLineEndWindow members

Change-Id: I0cfe88c65cc75757938a9f8004c219fbe39f88dd
üst 9e4ae869
...@@ -78,11 +78,11 @@ public: ...@@ -78,11 +78,11 @@ public:
class SvxLineEndWindow : public SfxPopupWindow class SvxLineEndWindow : public SfxPopupWindow
{ {
private: private:
XLineEndListRef pLineEndList; XLineEndListRef mpLineEndList;
VclPtr<ValueSet> aLineEndSet; VclPtr<ValueSet> mpLineEndSet;
sal_uInt16 nCols; sal_uInt16 mnCols;
sal_uInt16 nLines; sal_uInt16 mnLines;
Size aBmpSize; Size maBmpSize;
css::uno::Reference< css::frame::XFrame > mxFrame; css::uno::Reference< css::frame::XFrame > mxFrame;
......
...@@ -252,9 +252,9 @@ SvxLineEndWindow::SvxLineEndWindow( ...@@ -252,9 +252,9 @@ SvxLineEndWindow::SvxLineEndWindow(
rFrame, rFrame,
pParentWindow, pParentWindow,
WinBits( WB_STDPOPUP | WB_OWNERDRAWDECORATION ) ), WinBits( WB_STDPOPUP | WB_OWNERDRAWDECORATION ) ),
aLineEndSet ( VclPtr<ValueSet>::Create(this, WinBits( WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT ) )), mpLineEndSet ( VclPtr<ValueSet>::Create(this, WinBits( WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT ) )),
nCols ( 2 ), mnCols ( 2 ),
nLines ( 12 ), mnLines ( 12 ),
mxFrame ( rFrame ) mxFrame ( rFrame )
{ {
SetText( rWndTitle ); SetText( rWndTitle );
...@@ -266,18 +266,18 @@ void SvxLineEndWindow::implInit() ...@@ -266,18 +266,18 @@ void SvxLineEndWindow::implInit()
SfxObjectShell* pDocSh = SfxObjectShell::Current(); SfxObjectShell* pDocSh = SfxObjectShell::Current();
SetHelpId( HID_POPUP_LINEEND ); SetHelpId( HID_POPUP_LINEEND );
aLineEndSet->SetHelpId( HID_POPUP_LINEEND_CTRL ); mpLineEndSet->SetHelpId( HID_POPUP_LINEEND_CTRL );
if ( pDocSh ) if ( pDocSh )
{ {
const SfxPoolItem* pItem = pDocSh->GetItem( SID_LINEEND_LIST ); const SfxPoolItem* pItem = pDocSh->GetItem( SID_LINEEND_LIST );
if( pItem ) if( pItem )
pLineEndList = static_cast<const SvxLineEndListItem*>( pItem )->GetLineEndList(); mpLineEndList = static_cast<const SvxLineEndListItem*>( pItem )->GetLineEndList();
} }
DBG_ASSERT( pLineEndList.is(), "LineEndList not found" ); DBG_ASSERT( mpLineEndList.is(), "LineEndList not found" );
aLineEndSet->SetSelectHdl( LINK( this, SvxLineEndWindow, SelectHdl ) ); mpLineEndSet->SetSelectHdl( LINK( this, SvxLineEndWindow, SelectHdl ) );
aLineEndSet->SetColCount( nCols ); mpLineEndSet->SetColCount( mnCols );
// ValueSet fill with entries of LineEndList // ValueSet fill with entries of LineEndList
FillValueSet(); FillValueSet();
...@@ -285,7 +285,7 @@ void SvxLineEndWindow::implInit() ...@@ -285,7 +285,7 @@ void SvxLineEndWindow::implInit()
AddStatusListener( ".uno:LineEndListState"); AddStatusListener( ".uno:LineEndListState");
//ChangeHelpId( HID_POPUP_LINEENDSTYLE ); //ChangeHelpId( HID_POPUP_LINEENDSTYLE );
aLineEndSet->Show(); mpLineEndSet->Show();
} }
SvxLineEndWindow::~SvxLineEndWindow() SvxLineEndWindow::~SvxLineEndWindow()
...@@ -295,7 +295,7 @@ SvxLineEndWindow::~SvxLineEndWindow() ...@@ -295,7 +295,7 @@ SvxLineEndWindow::~SvxLineEndWindow()
void SvxLineEndWindow::dispose() void SvxLineEndWindow::dispose()
{ {
aLineEndSet.disposeAndClear(); mpLineEndSet.disposeAndClear();
SfxPopupWindow::dispose(); SfxPopupWindow::dispose();
} }
...@@ -303,7 +303,7 @@ IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, void) ...@@ -303,7 +303,7 @@ IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, void)
{ {
std::unique_ptr<XLineEndItem> pLineEndItem; std::unique_ptr<XLineEndItem> pLineEndItem;
std::unique_ptr<XLineStartItem> pLineStartItem; std::unique_ptr<XLineStartItem> pLineStartItem;
sal_uInt16 nId = aLineEndSet->GetSelectItemId(); sal_uInt16 nId = mpLineEndSet->GetSelectItemId();
if( nId == 1 ) if( nId == 1 )
{ {
...@@ -315,12 +315,12 @@ IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, void) ...@@ -315,12 +315,12 @@ IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, void)
} }
else if( nId % 2 ) // beginning of line else if( nId % 2 ) // beginning of line
{ {
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd( (nId - 1) / 2 - 1 ); const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd( (nId - 1) / 2 - 1 );
pLineStartItem.reset(new XLineStartItem(pEntry->GetName(), pEntry->GetLineEnd())); pLineStartItem.reset(new XLineStartItem(pEntry->GetName(), pEntry->GetLineEnd()));
} }
else // end of line else // end of line
{ {
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nId / 2 - 2 ); const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd( nId / 2 - 2 );
pLineEndItem.reset(new XLineEndItem(pEntry->GetName(), pEntry->GetLineEnd())); pLineEndItem.reset(new XLineEndItem(pEntry->GetName(), pEntry->GetLineEnd()));
} }
...@@ -346,7 +346,7 @@ IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, void) ...@@ -346,7 +346,7 @@ IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, void)
/* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() call. /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() call.
This instance may be deleted in the meantime (i.e. when a dialog is opened This instance may be deleted in the meantime (i.e. when a dialog is opened
while in Dispatch()), accessing members will crash in this case. */ while in Dispatch()), accessing members will crash in this case. */
aLineEndSet->SetNoSelection(); mpLineEndSet->SetNoSelection();
SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( mxFrame->getController(), UNO_QUERY ), SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( mxFrame->getController(), UNO_QUERY ),
".uno:LineEndStyle", ".uno:LineEndStyle",
...@@ -356,47 +356,47 @@ IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, void) ...@@ -356,47 +356,47 @@ IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, void)
void SvxLineEndWindow::FillValueSet() void SvxLineEndWindow::FillValueSet()
{ {
if( pLineEndList.is() ) if( mpLineEndList.is() )
{ {
ScopedVclPtrInstance< VirtualDevice > pVD; ScopedVclPtrInstance< VirtualDevice > pVD;
long nCount = pLineEndList->Count(); long nCount = mpLineEndList->Count();
// First entry: no line end. // First entry: no line end.
// An entry is temporarly added to get the UI bitmap // An entry is temporarly added to get the UI bitmap
basegfx::B2DPolyPolygon aNothing; basegfx::B2DPolyPolygon aNothing;
pLineEndList->Insert(o3tl::make_unique<XLineEndEntry>(aNothing, SVX_RESSTR(RID_SVXSTR_NONE))); mpLineEndList->Insert(o3tl::make_unique<XLineEndEntry>(aNothing, SVX_RESSTR(RID_SVXSTR_NONE)));
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nCount); const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd(nCount);
Bitmap aBmp = pLineEndList->GetUiBitmap( nCount ); Bitmap aBmp = mpLineEndList->GetUiBitmap( nCount );
OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" ); OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
aBmpSize = aBmp.GetSizePixel(); maBmpSize = aBmp.GetSizePixel();
pVD->SetOutputSizePixel( aBmpSize, false ); pVD->SetOutputSizePixel( maBmpSize, false );
aBmpSize.Width() = aBmpSize.Width() / 2; maBmpSize.Width() = maBmpSize.Width() / 2;
Point aPt0( 0, 0 ); Point aPt0( 0, 0 );
Point aPt1( aBmpSize.Width(), 0 ); Point aPt1( maBmpSize.Width(), 0 );
pVD->DrawBitmap( Point(), aBmp ); pVD->DrawBitmap( Point(), aBmp );
aLineEndSet->InsertItem(1, Image(pVD->GetBitmap(aPt0, aBmpSize)), pEntry->GetName()); mpLineEndSet->InsertItem(1, Image(pVD->GetBitmap(aPt0, maBmpSize)), pEntry->GetName());
aLineEndSet->InsertItem(2, Image(pVD->GetBitmap(aPt1, aBmpSize)), pEntry->GetName()); mpLineEndSet->InsertItem(2, Image(pVD->GetBitmap(aPt1, maBmpSize)), pEntry->GetName());
pLineEndList->Remove(nCount); mpLineEndList->Remove(nCount);
for( long i = 0; i < nCount; i++ ) for( long i = 0; i < nCount; i++ )
{ {
pEntry = pLineEndList->GetLineEnd( i ); pEntry = mpLineEndList->GetLineEnd( i );
DBG_ASSERT( pEntry, "Could not access LineEndEntry" ); DBG_ASSERT( pEntry, "Could not access LineEndEntry" );
aBmp = pLineEndList->GetUiBitmap( i ); aBmp = mpLineEndList->GetUiBitmap( i );
OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" ); OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
pVD->DrawBitmap( aPt0, aBmp ); pVD->DrawBitmap( aPt0, aBmp );
aLineEndSet->InsertItem((sal_uInt16)((i+1L)*2L+1L), mpLineEndSet->InsertItem((sal_uInt16)((i+1L)*2L+1L),
Image(pVD->GetBitmap(aPt0, aBmpSize)), pEntry->GetName()); Image(pVD->GetBitmap(aPt0, maBmpSize)), pEntry->GetName());
aLineEndSet->InsertItem((sal_uInt16)((i+2L)*2L), mpLineEndSet->InsertItem((sal_uInt16)((i+2L)*2L),
Image(pVD->GetBitmap(aPt1, aBmpSize)), pEntry->GetName()); Image(pVD->GetBitmap(aPt1, maBmpSize)), pEntry->GetName());
} }
nLines = std::min( (sal_uInt16)(nCount + 1), (sal_uInt16) MAX_LINES ); mnLines = std::min( (sal_uInt16)(nCount + 1), (sal_uInt16) MAX_LINES );
aLineEndSet->SetLineCount( nLines ); mpLineEndSet->SetLineCount( mnLines );
SetSize(); SetSize();
} }
...@@ -404,7 +404,7 @@ void SvxLineEndWindow::FillValueSet() ...@@ -404,7 +404,7 @@ void SvxLineEndWindow::FillValueSet()
void SvxLineEndWindow::StartSelection() void SvxLineEndWindow::StartSelection()
{ {
aLineEndSet->StartSelection(); mpLineEndSet->StartSelection();
} }
...@@ -416,10 +416,10 @@ void SvxLineEndWindow::statusChanged( const css::frame::FeatureStateEvent& rEven ...@@ -416,10 +416,10 @@ void SvxLineEndWindow::statusChanged( const css::frame::FeatureStateEvent& rEven
css::uno::Reference< css::uno::XWeak > xWeak; css::uno::Reference< css::uno::XWeak > xWeak;
if ( rEvent.State >>= xWeak ) if ( rEvent.State >>= xWeak )
{ {
pLineEndList.set( static_cast< XLineEndList* >( xWeak.get() ) ); mpLineEndList.set( static_cast< XLineEndList* >( xWeak.get() ) );
DBG_ASSERT( pLineEndList.is(), "LineEndList not found" ); DBG_ASSERT( mpLineEndList.is(), "LineEndList not found" );
aLineEndSet->Clear(); mpLineEndSet->Clear();
FillValueSet(); FillValueSet();
} }
} }
...@@ -427,21 +427,21 @@ void SvxLineEndWindow::statusChanged( const css::frame::FeatureStateEvent& rEven ...@@ -427,21 +427,21 @@ void SvxLineEndWindow::statusChanged( const css::frame::FeatureStateEvent& rEven
void SvxLineEndWindow::SetSize() void SvxLineEndWindow::SetSize()
{ {
sal_uInt16 nItemCount = aLineEndSet->GetItemCount(); sal_uInt16 nItemCount = mpLineEndSet->GetItemCount();
sal_uInt16 nMaxLines = nItemCount / nCols; sal_uInt16 nMaxLines = nItemCount / mnCols;
WinBits nBits = aLineEndSet->GetStyle(); WinBits nBits = mpLineEndSet->GetStyle();
if ( nLines == nMaxLines ) if ( mnLines == nMaxLines )
nBits &= ~WB_VSCROLL; nBits &= ~WB_VSCROLL;
else else
nBits |= WB_VSCROLL; nBits |= WB_VSCROLL;
aLineEndSet->SetStyle( nBits ); mpLineEndSet->SetStyle( nBits );
Size aSize( aBmpSize ); Size aSize( maBmpSize );
aSize.Width() += 6; aSize.Width() += 6;
aSize.Height() += 6; aSize.Height() += 6;
aSize = aLineEndSet->CalcWindowSizePixel( aSize ); aSize = mpLineEndSet->CalcWindowSizePixel( aSize );
aLineEndSet->SetPosSizePixel( Point( 2, 2 ), aSize ); mpLineEndSet->SetPosSizePixel( Point( 2, 2 ), aSize );
aSize.Width() += 4; aSize.Width() += 4;
aSize.Height() += 4; aSize.Height() += 4;
SetOutputSizePixel( aSize ); SetOutputSizePixel( aSize );
...@@ -452,8 +452,8 @@ void SvxLineEndWindow::GetFocus() ...@@ -452,8 +452,8 @@ void SvxLineEndWindow::GetFocus()
SfxPopupWindow::GetFocus(); SfxPopupWindow::GetFocus();
// Grab the focus to the line ends value set so that it can be controlled // Grab the focus to the line ends value set so that it can be controlled
// with the keyboard. // with the keyboard.
if ( aLineEndSet ) if ( mpLineEndSet )
aLineEndSet->GrabFocus(); mpLineEndSet->GrabFocus();
} }
SvxLineEndToolBoxControl::SvxLineEndToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) : SvxLineEndToolBoxControl::SvxLineEndToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) :
......
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