sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx | 39 ++++------ sc/source/ui/inc/RandomNumberGeneratorDialog.hxx | 9 +- 2 files changed, 23 insertions(+), 25 deletions(-)
New commits: commit cb9b6d94d805026062ebc6e2f7bdb2f659d9665a Author: Kohei Yoshida <[email protected]> Date: Wed Jan 29 16:48:11 2014 -0500 No need to store the address detail object. Just get one from the document when needed. Change-Id: Id053c70c40e7a7580a3c5969af8d547ac1fcbf4e diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx index 36ba2cb..0c47c5b 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -59,8 +59,7 @@ ScRandomNumberGeneratorDialog::ScRandomNumberGeneratorDialog( ScAnyRefDlg ( pSfxBindings, pChildWindow, pParent, "RandomNumberGeneratorDialog", "modules/scalc/ui/randomnumbergenerator.ui" ), mpViewData ( pViewData ), - mpDoc ( pViewData->GetDocument() ), - maAddressDetails ( mpDoc->GetAddressConvention(), 0, 0 ), + mpDoc( pViewData->GetDocument() ), mbDialogLostFocus( false ) { get(mpInputRangeText, "cell-range-label"); @@ -115,7 +114,7 @@ void ScRandomNumberGeneratorDialog::Init() void ScRandomNumberGeneratorDialog::GetRangeFromSelection() { mpViewData->GetSimpleArea(maInputRange); - OUString aCurrentString(maInputRange.Format(SCR_ABS_3D, mpDoc, maAddressDetails)); + OUString aCurrentString(maInputRange.Format(SCR_ABS_3D, mpDoc, mpDoc->GetAddressConvention())); mpInputRangeEdit->SetText( aCurrentString ); } @@ -142,7 +141,7 @@ sal_Bool ScRandomNumberGeneratorDialog::Close() return DoClose( ScRandomNumberGeneratorDialogWrapper::GetChildWindowId() ); } -void ScRandomNumberGeneratorDialog::SetReference( const ScRange& rReferenceRange, ScDocument* pDocument ) +void ScRandomNumberGeneratorDialog::SetReference( const ScRange& rReferenceRange, ScDocument* pDoc ) { if ( mpInputRangeEdit->IsEnabled() ) { @@ -151,7 +150,7 @@ void ScRandomNumberGeneratorDialog::SetReference( const ScRange& rReferenceRange maInputRange = rReferenceRange; - OUString aReferenceString(maInputRange.Format(SCR_ABS_3D, pDocument, maAddressDetails)); + OUString aReferenceString(maInputRange.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention())); mpInputRangeEdit->SetRefString( aReferenceString ); } } diff --git a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx index a99f47f..b20ce91 100644 --- a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx +++ b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx @@ -54,7 +54,6 @@ private: ScDocument* mpDoc; ScRange maInputRange; - ScAddress::Details maAddressDetails; bool mbDialogLostFocus; commit 9eba10af95cfdcc01ffbdfabfb523a579bd624ea Author: Kohei Yoshida <[email protected]> Date: Wed Jan 29 16:43:28 2014 -0500 Consistency in naming. Change-Id: Id9ac1ec0ec06defd570556f697f947997cb90b38 diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx index ea86fa7..36ba2cb 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -58,10 +58,10 @@ ScRandomNumberGeneratorDialog::ScRandomNumberGeneratorDialog( Window* pParent, ScViewData* pViewData ) : ScAnyRefDlg ( pSfxBindings, pChildWindow, pParent, "RandomNumberGeneratorDialog", "modules/scalc/ui/randomnumbergenerator.ui" ), - mViewData ( pViewData ), - mDocument ( pViewData->GetDocument() ), - mAddressDetails ( mDocument->GetAddressConvention(), 0, 0 ), - mDialogLostFocus( false ) + mpViewData ( pViewData ), + mpDoc ( pViewData->GetDocument() ), + maAddressDetails ( mpDoc->GetAddressConvention(), 0, 0 ), + mbDialogLostFocus( false ) { get(mpInputRangeText, "cell-range-label"); get(mpInputRangeEdit, "cell-range-edit"); @@ -114,8 +114,8 @@ void ScRandomNumberGeneratorDialog::Init() void ScRandomNumberGeneratorDialog::GetRangeFromSelection() { - mViewData->GetSimpleArea(mInputRange); - OUString aCurrentString(mInputRange.Format(SCR_ABS_3D, mDocument, mAddressDetails)); + mpViewData->GetSimpleArea(maInputRange); + OUString aCurrentString(maInputRange.Format(SCR_ABS_3D, mpDoc, maAddressDetails)); mpInputRangeEdit->SetText( aCurrentString ); } @@ -124,9 +124,9 @@ ScRandomNumberGeneratorDialog::~ScRandomNumberGeneratorDialog() void ScRandomNumberGeneratorDialog::SetActive() { - if ( mDialogLostFocus ) + if ( mbDialogLostFocus ) { - mDialogLostFocus = false; + mbDialogLostFocus = false; if( mpInputRangeEdit ) mpInputRangeEdit->GrabFocus(); } @@ -149,9 +149,9 @@ void ScRandomNumberGeneratorDialog::SetReference( const ScRange& rReferenceRange if ( rReferenceRange.aStart != rReferenceRange.aEnd ) RefInputStart( mpInputRangeEdit ); - mInputRange = rReferenceRange; + maInputRange = rReferenceRange; - OUString aReferenceString(mInputRange.Format(SCR_ABS_3D, pDocument, mAddressDetails)); + OUString aReferenceString(maInputRange.Format(SCR_ABS_3D, pDocument, maAddressDetails)); mpInputRangeEdit->SetRefString( aReferenceString ); } } @@ -256,16 +256,16 @@ void ScRandomNumberGeneratorDialog::GenerateNumbers(RNG randomGenerator, OUStrin OUString aUndo = SC_STRLOAD( RID_STATISTICS_DLGS, STR_UNDO_DISTRIBUTION_TEMPLATE); aUndo = aUndo.replaceAll("$(DISTRIBUTION)", aDistributionName); - ScDocShell* pDocShell = mViewData->GetDocShell(); + ScDocShell* pDocShell = mpViewData->GetDocShell(); svl::IUndoManager* pUndoManager = pDocShell->GetUndoManager(); pUndoManager->EnterListAction( aUndo, aUndo ); - SCROW nRowStart = mInputRange.aStart.Row(); - SCROW nRowEnd = mInputRange.aEnd.Row(); - SCCOL nColStart = mInputRange.aStart.Col(); - SCCOL nColEnd = mInputRange.aEnd.Col(); - SCTAB nTabStart = mInputRange.aStart.Tab(); - SCTAB nTabEnd = mInputRange.aEnd.Tab(); + SCROW nRowStart = maInputRange.aStart.Row(); + SCROW nRowEnd = maInputRange.aEnd.Row(); + SCCOL nColStart = maInputRange.aStart.Col(); + SCCOL nColEnd = maInputRange.aEnd.Col(); + SCTAB nTabStart = maInputRange.aStart.Tab(); + SCTAB nTabEnd = maInputRange.aEnd.Tab(); for (SCROW nTab = nTabStart; nTab <= nTabEnd; nTab++) { @@ -280,7 +280,7 @@ void ScRandomNumberGeneratorDialog::GenerateNumbers(RNG randomGenerator, OUStrin pUndoManager->LeaveListAction(); - pDocShell->PostPaint( mInputRange, PAINT_GRID ); + pDocShell->PostPaint( maInputRange, PAINT_GRID ); } IMPL_LINK( ScRandomNumberGeneratorDialog, OkClicked, PushButton*, /*pButton*/ ) @@ -318,7 +318,7 @@ IMPL_LINK( ScRandomNumberGeneratorDialog, GetFocusHandler, Control*, pCtrl ) IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, LoseFocusHandler) { - mDialogLostFocus = !IsActive(); + mbDialogLostFocus = !IsActive(); return 0; } diff --git a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx index 377f8dc..a99f47f 100644 --- a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx +++ b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx @@ -50,13 +50,13 @@ private: CloseButton* mpButtonClose; // Data - ScViewData* mViewData; - ScDocument* mDocument; + ScViewData* mpViewData; + ScDocument* mpDoc; - ScRange mInputRange; - ScAddress::Details mAddressDetails; + ScRange maInputRange; + ScAddress::Details maAddressDetails; - bool mDialogLostFocus; + bool mbDialogLostFocus; void Init(); void GetRangeFromSelection(); _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
