summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-02-21 17:17:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-02-23 14:28:42 +0000
commit8655095a4910ca795dfd182e6796d9375727a694 (patch)
tree3472e1c3cea9539fc2785c8db99a421a10e93694 /sc/source
parent3c5c43cf2aa354a98f28a466647f4d463cdfdc85 (diff)
try and beat this weird SvxAcceptChgCtr into something sanish
a) convert to .ui b) The accept/reject changes dialogs now have a "close" button and the accept/reject etc buttons are relocated into the main dialog button area rather than as direct children of the view page. They now get disabled on switching to the non-view page. c) Merges the sc redline changes dialog, the sw redline changes dialog and the sw autocorrect changes dialog Change-Id: If0ba376c3f2d36709aeeed995fa9901741434c40
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/inc/acredlin.hrc31
-rw-r--r--sc/source/ui/inc/acredlin.hxx4
-rw-r--r--sc/source/ui/inc/highred.hrc8
-rw-r--r--sc/source/ui/inc/optdlg.hrc1
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx75
-rw-r--r--sc/source/ui/miscdlgs/acredlin.src195
6 files changed, 93 insertions, 221 deletions
diff --git a/sc/source/ui/inc/acredlin.hrc b/sc/source/ui/inc/acredlin.hrc
index dfa474434447..1468c3f4f6c1 100644
--- a/sc/source/ui/inc/acredlin.hrc
+++ b/sc/source/ui/inc/acredlin.hrc
@@ -22,37 +22,6 @@
#define BTN_CANCEL 2
#define BTN_HELP 5
-#define CTR_REDLINING 10
-#define TP_FILTER 11
-#define TP_VIEW 12
-
-#define FT_ASSIGN 14
-#define ED_ASSIGN 15
-#define RB_ASSIGN 16
-
-#define STR_INSERT_COLS 20
-#define STR_INSERT_ROWS 21
-#define STR_INSERT_TABS 22
-#define STR_DELETE_COLS 23
-#define STR_DELETE_ROWS 24
-#define STR_DELETE_TABS 25
-#define STR_MOVE 26
-#define STR_CONTENT 27
-#define STR_REJECT 28
-#define STR_ACCEPTED 29
-#define STR_REJECTED 30
-#define STR_NO_ENTRY 31
-#define STR_CONTENT_WITH_CHILD 32
-#define STR_CHILD_CONTENT 33
-#define STR_CHILD_ORGCONTENT 34
-#define STR_EMPTY 35
-
-// Bitmaps
-#define BMP_STR_CLOSE 41
-#define BMP_STR_OPEN 42
-#define BMP_STR_END 43
-#define BMP_STR_ERROR 44
-
#define SC_CHANGES_COMMENT 49
#define SC_SUB_SORT 50
#define SC_SORT_ACTION 51
diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx
index d9c4b9be5e23..1c756dad466e 100644
--- a/sc/source/ui/inc/acredlin.hxx
+++ b/sc/source/ui/inc/acredlin.hxx
@@ -99,7 +99,7 @@ private:
Timer aSelectionTimer;
Timer aReOpenTimer;
- SvxAcceptChgCtr aAcceptChgCtr;
+ SvxAcceptChgCtr* m_pAcceptChgCtr;
ScViewData* pViewData;
ScDocument* pDoc;
ScRangeName aLocalRangeName;
@@ -107,7 +107,6 @@ private:
SvxTPFilter* pTPFilter;
SvxTPView* pTPView;
SvxRedlinTable* pTheView; // #i48648 now SvHeaderTabListBox
- Size MinSize;
ScRangeList aRangeList;
ScChangeViewSettings aChangeViewSet;
rtl::OUString aStrInsertCols;
@@ -143,7 +142,6 @@ private:
DECL_LINK( FilterHandle, SvxTPFilter* );
DECL_LINK( RefHandle, void* );
DECL_LINK( FilterModified, void* );
- DECL_LINK( MinSizeHandle, SvxAcceptChgCtr*);
DECL_LINK( RejectHandle, SvxTPView*);
DECL_LINK( AcceptHandle, SvxTPView*);
DECL_LINK( RejectAllHandle, void*);
diff --git a/sc/source/ui/inc/highred.hrc b/sc/source/ui/inc/highred.hrc
index 9f3d58940733..9122b8b9c6a6 100644
--- a/sc/source/ui/inc/highred.hrc
+++ b/sc/source/ui/inc/highred.hrc
@@ -26,8 +26,6 @@
#define CB_HIGHLIGHT_REJECT 7
#define FL_FILTER 10
-#define TP_FILTER 11
-#define TP_VIEW 12
#define CB_HIGHLIGHT 13
#define FT_ASSIGN 14
@@ -43,9 +41,3 @@
#define STR_MOVE 26
#define STR_CONTENT 27
#define STR_REJECT 28
-
-// Bitmaps
-#define BMP_STR_CLOSE 31
-#define BMP_STR_OPEN 32
-#define BMP_STR_END 33
-#define BMP_STR_ERROR 34
diff --git a/sc/source/ui/inc/optdlg.hrc b/sc/source/ui/inc/optdlg.hrc
index a1c8e0a13472..a7f655114e48 100644
--- a/sc/source/ui/inc/optdlg.hrc
+++ b/sc/source/ui/inc/optdlg.hrc
@@ -21,7 +21,6 @@
#define TP_GENERAL 1
#define TP_SAVE 2
#define TP_PATH 3
-#define TP_VIEW 5
#define TP_CALC 6
#define TP_USERLISTS 7
#define TP_PRINT 8
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index debae9480d93..7c4ea0846843 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -93,30 +93,29 @@ ScRedlinData::~ScRedlinData()
//============================================================================
// class ScAcceptChgDlg
//----------------------------------------------------------------------------
-ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
- ScViewData* ptrViewData)
-
- : SfxModelessDialog( pB, pCW, pParent, ScResId(RID_SCDLG_CHANGES) ),
- aAcceptChgCtr ( this, ScResId( CTR_REDLINING ) ),
+ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
+ ScViewData* ptrViewData)
+ : SfxModelessDialog(pB, pCW, pParent,
+ "AcceptRejectChangesDialog", "svx/ui/acceptrejectchangesdialog.ui"),
pViewData ( ptrViewData ),
pDoc ( ptrViewData->GetDocument() ),
aLocalRangeName ( *(pDoc->GetRangeName()) ),
- aStrInsertCols (SC_RESSTR(STR_INSERT_COLS)),
- aStrInsertRows (SC_RESSTR(STR_INSERT_ROWS)),
- aStrInsertTabs (SC_RESSTR(STR_INSERT_TABS)),
- aStrDeleteCols (SC_RESSTR(STR_DELETE_COLS)),
- aStrDeleteRows (SC_RESSTR(STR_DELETE_ROWS)),
- aStrDeleteTabs (SC_RESSTR(STR_DELETE_TABS)),
- aStrMove (SC_RESSTR(STR_MOVE)),
- aStrContent (SC_RESSTR(STR_CONTENT)),
- aStrReject (SC_RESSTR(STR_REJECT)),
- aStrAllAccepted (SC_RESSTR(STR_ACCEPTED)),
- aStrAllRejected (SC_RESSTR(STR_REJECTED)),
- aStrNoEntry (SC_RESSTR(STR_NO_ENTRY)),
- aStrContentWithChild (SC_RESSTR(STR_CONTENT_WITH_CHILD)),
- aStrChildContent (SC_RESSTR(STR_CHILD_CONTENT)),
- aStrChildOrgContent (SC_RESSTR(STR_CHILD_ORGCONTENT)),
- aStrEmpty (SC_RESSTR(STR_EMPTY)),
+ aStrInsertCols (SC_RESSTR(STR_CHG_INSERT_COLS)),
+ aStrInsertRows (SC_RESSTR(STR_CHG_INSERT_ROWS)),
+ aStrInsertTabs (SC_RESSTR(STR_CHG_INSERT_TABS)),
+ aStrDeleteCols (SC_RESSTR(STR_CHG_DELETE_COLS)),
+ aStrDeleteRows (SC_RESSTR(STR_CHG_DELETE_ROWS)),
+ aStrDeleteTabs (SC_RESSTR(STR_CHG_DELETE_TABS)),
+ aStrMove (SC_RESSTR(STR_CHG_MOVE)),
+ aStrContent (SC_RESSTR(STR_CHG_CONTENT)),
+ aStrReject (SC_RESSTR(STR_CHG_REJECT)),
+ aStrAllAccepted (SC_RESSTR(STR_CHG_ACCEPTED)),
+ aStrAllRejected (SC_RESSTR(STR_CHG_REJECTED)),
+ aStrNoEntry (SC_RESSTR(STR_CHG_NO_ENTRY)),
+ aStrContentWithChild (SC_RESSTR(STR_CHG_CONTENT_WITH_CHILD)),
+ aStrChildContent (SC_RESSTR(STR_CHG_CHILD_CONTENT)),
+ aStrChildOrgContent (SC_RESSTR(STR_CHG_CHILD_ORGCONTENT)),
+ aStrEmpty (SC_RESSTR(STR_CHG_EMPTY)),
aUnknown(RTL_CONSTASCII_USTRINGPARAM("Unknown")),
bAcceptEnableFlag(true),
bRejectEnableFlag(true),
@@ -126,21 +125,14 @@ ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
bHasFilterEntry(false),
bUseColor(false)
{
- FreeResource();
+ m_pAcceptChgCtr = new SvxAcceptChgCtr(get_content_area());
nAcceptCount=0;
nRejectCount=0;
aReOpenTimer.SetTimeout(50);
aReOpenTimer.SetTimeoutHdl(LINK( this, ScAcceptChgDlg, ReOpenTimerHdl ));
- // dialog is now only hidden, not deleted, on switching views,
- // so there's no need to restore settings when reopening
- MinSize=aAcceptChgCtr.GetMinSizePixel();
- MinSize.Height()+=2;
- MinSize.Width()+=2;
- SetMinOutputSizePixel(MinSize);
-
- pTPFilter=aAcceptChgCtr.GetFilterPage();
- pTPView=aAcceptChgCtr.GetViewPage();
+ pTPFilter=m_pAcceptChgCtr->GetFilterPage();
+ pTPView=m_pAcceptChgCtr->GetViewPage();
pTheView=pTPView->GetTableControl();
aSelectionTimer.SetTimeout(100);
aSelectionTimer.SetTimeoutHdl(LINK( this, ScAcceptChgDlg, UpdateSelectionHdl ));
@@ -166,8 +158,6 @@ ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
Init();
- aAcceptChgCtr.SetMinSizeHdl( LINK( this, ScAcceptChgDlg, MinSizeHandle ));
-
UpdateView();
SvTreeListEntry* pEntry=pTheView->First();
if(pEntry!=NULL)
@@ -175,6 +165,7 @@ ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pP
pTheView->Select(pEntry);
}
}
+
ScAcceptChgDlg::~ScAcceptChgDlg()
{
ClearView();
@@ -185,6 +176,8 @@ ScAcceptChgDlg::~ScAcceptChgDlg()
Link aLink;
pChanges->SetModifiedLink(aLink);
}
+
+ delete m_pAcceptChgCtr;
}
void ScAcceptChgDlg::ReInit(ScViewData* ptrViewData)
@@ -277,13 +270,9 @@ void ScAcceptChgDlg::Init()
pTPFilter->SetRange(aRefStr);
}
- Point aPoint(1,1);
- aAcceptChgCtr.SetPosPixel(aPoint);
InitFilter();
}
-
-
void ScAcceptChgDlg::ClearView()
{
nAcceptCount=0;
@@ -896,15 +885,7 @@ void ScAcceptChgDlg::Resize()
{
SfxModelessDialog::Resize();
Size aOutSize=GetOutputSizePixel();
- aAcceptChgCtr.SetSizePixel(aOutSize);
-}
-
-IMPL_LINK( ScAcceptChgDlg, MinSizeHandle, SvxAcceptChgCtr*, pCtr )
-{
- if(pCtr==&aAcceptChgCtr)
- if(!IsRollUp())
- SetOutputSizePixel(MinSize);
- return 0;
+ m_pAcceptChgCtr->SetSizePixel(aOutSize);
}
IMPL_LINK_NOARG(ScAcceptChgDlg, RefHandle)
@@ -1686,7 +1667,7 @@ IMPL_LINK( ScAcceptChgDlg, ChgTrackModHdl, ScChangeTrack*, pChgTrack)
IMPL_LINK_NOARG(ScAcceptChgDlg, ReOpenTimerHdl)
{
ScSimpleRefDlgWrapper::SetAutoReOpen(true);
- aAcceptChgCtr.ShowFilterPage();
+ m_pAcceptChgCtr->ShowFilterPage();
RefHandle(NULL);
return 0;
diff --git a/sc/source/ui/miscdlgs/acredlin.src b/sc/source/ui/miscdlgs/acredlin.src
index f1190d66ee6c..aff8ab2b1307 100644
--- a/sc/source/ui/miscdlgs/acredlin.src
+++ b/sc/source/ui/miscdlgs/acredlin.src
@@ -17,138 +17,71 @@
*/
#include "acredlin.hrc"
+#include "globstr.hrc"
-ModelessDialog RID_SCDLG_CHANGES
-{
- OutputSize = TRUE ;
- HelpId = CMD_FID_CHG_ACCEPT ;
- Hide = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 282 , 142 ) ;
- Moveable = TRUE ;
- Sizeable = TRUE ;
- Closeable = TRUE ;
- // Dieser Dialog hat einen Cancel-Button !
- Control CTR_REDLINING
- {
- HelpId = HID_SC_REDLIN_CTR ;
- Pos = MAP_APPFONT ( 2 , 2 ) ;
- Size = MAP_APPFONT ( 270 , 105 ) ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 271 , 105 ) ;
- Size = MAP_APPFONT ( 1 , 1 ) ;
- TabStop = FALSE ;
- };
- FixedText FT_ASSIGN
- {
- Hide = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 105 ) ;
- Size = MAP_APPFONT ( 128 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Range" ;
- };
- Edit ED_ASSIGN
- {
- HelpID = "sc:Edit:RID_SCDLG_CHANGES:ED_ASSIGN";
- Hide = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 119 ) ;
- Size = MAP_APPFONT ( 128 , 12 ) ;
- TabStop = TRUE ;
- };
- ImageButton RB_ASSIGN
- {
- HelpID = "sc:ImageButton:RID_SCDLG_CHANGES:RB_ASSIGN";
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 142 , 118 ) ;
- Size = MAP_APPFONT ( 13 , 15 ) ;
- TabStop = FALSE ;
- QuickHelpText [ en-US ] = "Minimize/Maximize" ;
- };
- String STR_INSERT_COLS
- {
- Text [ en-US ] = "Column inserted" ;
- };
- String STR_INSERT_ROWS
- {
- Text [ en-US ] = "Row inserted " ;
- };
- String STR_INSERT_TABS
- {
- Text [ en-US ] = "Sheet inserted " ;
- };
- String STR_DELETE_COLS
- {
- Text [ en-US ] = "Column deleted" ;
- };
- String STR_DELETE_ROWS
- {
- Text [ en-US ] = "Row deleted" ;
- };
- String STR_DELETE_TABS
- {
- Text [ en-US ] = "Sheet deleted" ;
- };
- String STR_MOVE
- {
- Text [ en-US ] = "Range moved" ;
- };
- String STR_CONTENT
- {
- Text [ en-US ] = "Changed contents" ;
- };
- String STR_CONTENT_WITH_CHILD
- {
- Text [ en-US ] = "Changed contents" ;
- };
- String STR_CHILD_CONTENT
- {
- Text [ en-US ] = "Changed to " ;
- };
- String STR_CHILD_ORGCONTENT
- {
- Text [ en-US ] = "Original" ;
- };
- String STR_REJECT
- {
- Text [ en-US ] = "Changes rejected" ;
- };
- String STR_ACCEPTED
- {
- Text [ en-US ] = "Accepted" ;
- };
- String STR_REJECTED
- {
- Text [ en-US ] = "Rejected" ;
- };
- String STR_NO_ENTRY
- {
- Text [ en-US ] = "No Entry" ;
- };
- String STR_EMPTY
- {
- Text [ en-US ] = "<empty>" ;
- };
- Bitmap BMP_STR_CLOSE
- {
- File = "dir-clos.png" ;
- };
- Bitmap BMP_STR_OPEN
- {
- File = "dir-open.png" ;
- };
- Bitmap BMP_STR_END
- {
- File = "basobj2.png" ;
- };
- Bitmap BMP_STR_ERROR
- {
- File = "basbrk.png" ;
- };
- Text [ en-US ] = "Accept or Reject Changes" ;
+String STR_CHG_INSERT_COLS
+{
+ Text [ en-US ] = "Column inserted" ;
+};
+String STR_CHG_INSERT_ROWS
+{
+ Text [ en-US ] = "Row inserted " ;
+};
+String STR_CHG_INSERT_TABS
+{
+ Text [ en-US ] = "Sheet inserted " ;
+};
+String STR_CHG_DELETE_COLS
+{
+ Text [ en-US ] = "Column deleted" ;
+};
+String STR_CHG_DELETE_ROWS
+{
+ Text [ en-US ] = "Row deleted" ;
+};
+String STR_CHG_DELETE_TABS
+{
+ Text [ en-US ] = "Sheet deleted" ;
+};
+String STR_CHG_MOVE
+{
+ Text [ en-US ] = "Range moved" ;
+};
+String STR_CHG_CONTENT
+{
+ Text [ en-US ] = "Changed contents" ;
+};
+String STR_CHG_CONTENT_WITH_CHILD
+{
+ Text [ en-US ] = "Changed contents" ;
+};
+String STR_CHG_CHILD_CONTENT
+{
+ Text [ en-US ] = "Changed to " ;
+};
+String STR_CHG_CHILD_ORGCONTENT
+{
+ Text [ en-US ] = "Original" ;
+};
+String STR_CHG_REJECT
+{
+ Text [ en-US ] = "Changes rejected" ;
+};
+String STR_CHG_ACCEPTED
+{
+ Text [ en-US ] = "Accepted" ;
+};
+String STR_CHG_REJECTED
+{
+ Text [ en-US ] = "Rejected" ;
+};
+String STR_CHG_NO_ENTRY
+{
+ Text [ en-US ] = "No Entry" ;
+};
+String STR_CHG_EMPTY
+{
+ Text [ en-US ] = "<empty>" ;
};
Menu RID_POPUP_CHANGES