summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-02 17:28:44 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-04 02:17:26 +0200
commitadc2aebb2828e3570f72f214f31341049eaf6709 (patch)
tree0d6b2220e0b38f8e5ee9a74d1134f56b825b4e9a /sc
parent7d295975c51f198a0e6933f6e4c7d85dfa9e3c8f (diff)
localize all parts of the new cond format dialogs
Change-Id: Ia582433bd126b9e60b7aecdc19bce57b2a6e85a6
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/globstr.hrc11
-rw-r--r--sc/source/ui/condformat/condformathelper.cxx16
-rw-r--r--sc/source/ui/condformat/condformatmgr.cxx23
-rw-r--r--sc/source/ui/inc/condformatmgr.hxx2
-rw-r--r--sc/source/ui/src/globstr.src30
5 files changed, 71 insertions, 11 deletions
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 5ebcb62ddc96..0694946a8311 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -591,7 +591,16 @@
#define STR_PIVOT_GROUP 467
#define STR_HEADER_COND 468
-#define STR_COUNT 469
+#define STR_COND_CONDITION 469
+#define STR_COND_COLORSCALE 470
+#define STR_COND_DATABAR 471
+#define STR_COND_FORMULA 472
+#define STR_COND_BETWEEN 473
+#define STR_COND_NOTBETWEEN 474
+#define STR_COND_UNIQUE 475
+#define STR_COND_DUPLICATE 476
+
+#define STR_COUNT 477
#endif
diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx
index 0ef03e83c1af..341f390dc90f 100644
--- a/sc/source/ui/condformat/condformathelper.cxx
+++ b/sc/source/ui/condformat/condformathelper.cxx
@@ -17,13 +17,13 @@ rtl::OUString getTextForType(ScCondFormatEntryType eType)
switch(eType)
{
case CONDITION:
- return rtl::OUString("Cell value");
+ return ScGlobal::GetRscString(STR_COND_CONDITION);
case COLORSCALE:
- return rtl::OUString("Color scale");
+ return ScGlobal::GetRscString(STR_COND_COLORSCALE);
case DATABAR:
- return rtl::OUString("Data Bar");
+ return ScGlobal::GetRscString(STR_COND_DATABAR);
case FORMULA:
- return rtl::OUString("Formula is");
+ return ScGlobal::GetRscString(STR_COND_FORMULA);
default:
break;
}
@@ -48,13 +48,13 @@ rtl::OUString getExpression(sal_Int32 nIndex)
case 5:
return rtl::OUString("!=");
case 6:
- return rtl::OUString("between");
+ return ScGlobaLL:GetRscString(STR_COND_BETWEEN);
case 7:
- return rtl::OUString("not between");
+ return ScGlobaLL:GetRscString(STR_COND_NOTBETWEEN);
case 8:
- return rtl::OUString("duplicate");
+ return ScGlobaLL:GetRscString(STR_COND_DUPLICATE);
case 9:
- return rtl::OUString("unique");
+ return ScGlobaLL:GetRscString(STR_COND_UNIQUE);
}
return rtl::OUString();
}
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index c8f3ad6c7d13..aee8b6f26dd4 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -62,7 +62,8 @@ ScCondFormatManagerWindow::ScCondFormatManagerWindow(Window* pParent, ScDocument
SetPosSizePixel( Point( 0, aHeadSize.Height() ), Size( aBoxSize.Width(), aBoxSize.Height() - aHeadSize.Height() ) );
SetTabs( &nTabs[0], MAP_PIXEL );
- //maHeaderBar.SetEndDragHdl( LINK( this, ScRangeManagerTable, HeaderEndDragHdl ) );
+ maHeaderBar.SetEndDragHdl( LINK(this, ScCondFormatManagerWindow, HeaderEndDragHdl ) );
+ HeaderEndDragHdl(NULL);
Init();
Show();
@@ -122,6 +123,25 @@ void ScCondFormatManagerWindow::Update()
Init();
}
+IMPL_LINK_NOARG(ScCondFormatManagerWindow, HeaderEndDragHdl)
+{
+ long aTableSize = maHeaderBar.GetSizePixel().Width();
+ long aItemRangeSize = maHeaderBar.GetItemSize(ITEMID_RANGE);
+
+ //calculate column size based on user input and minimum size
+ long aItemCondSize = aTableSize - aItemRangeSize;
+
+ Size aSz;
+ aSz.Width() = aItemRangeSize;
+ SetTab( ITEMID_RANGE, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width(), MAP_APPFONT );
+ maHeaderBar.SetItemSize(ITEMID_RANGE, aItemRangeSize);
+ aSz.Width() += aItemCondSize;
+ SetTab( ITEMID_CONDITION, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width(), MAP_APPFONT );
+ maHeaderBar.SetItemSize(ITEMID_CONDITION, aItemCondSize);
+
+ return 0;
+}
+
ScCondFormatManagerCtrl::ScCondFormatManagerCtrl(Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList, const ScAddress& rPos):
Control(pParent, ScResId(CTRL_TABLE)),
maWdManager(this, pDoc, pFormatList, rPos)
@@ -199,6 +219,7 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl)
mpFormatList->InsertNew(pNewFormat);
maCtrlManager.Update();
}
+ delete pDlg;
return 0;
}
diff --git a/sc/source/ui/inc/condformatmgr.hxx b/sc/source/ui/inc/condformatmgr.hxx
index bf7cfb313483..39bfe3bd0b59 100644
--- a/sc/source/ui/inc/condformatmgr.hxx
+++ b/sc/source/ui/inc/condformatmgr.hxx
@@ -54,6 +54,8 @@ private:
const ScAddress& mrPos;
std::map<SvLBoxEntry*, sal_Int32> maMapLBoxEntryToCondIndex;
+ DECL_LINK( HeaderEndDragHdl, void* );
+
public:
ScCondFormatManagerWindow( Window* pParent, ScDocument* pDoc, ScConditionalFormatList* pFormatList, const ScAddress& rPos );
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 4b2a4ecae4f3..5eec9073943a 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -1861,7 +1861,35 @@ Resource RID_GLOBSTR
};
String STR_HEADER_COND
{
- Text [ en_US ] = "First Condition";
+ Text [ en-US ] = "First Condition";
+ };
+ String STR_COND_CONDITION
+ {
+ Text [ en-US ] = "Condition";
+ };
+ String STR_COND_COLORSCALE
+ {
+ Text [ en-US ] = "ColorScale";
+ };
+ String STR_COND_DATABAR
+ {
+ Text [ en-US ] = "DataBar";
+ };
+ String STR_COND_BETWEEN
+ {
+ Text [ en-US ] = "between";
+ };
+ String STR_COND_NOTBETWEEN
+ {
+ Text [ en-US ] = "not between";
+ };
+ String STR_COND_UNIQUE
+ {
+ Text [ en-US ] = "unique";
+ };
+ String STR_COND_DUPLICATE
+ {
+ Text [ en-US ] = "duplicate";
};
};