diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-11-26 04:20:38 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-11-26 06:31:24 +0100 |
commit | 59e0854dd302659f67ec0b4b3a18515b26499280 (patch) | |
tree | f13c916020b4f252c819150826e8c911fa54cda6 /sc/source/ui | |
parent | e0765292dc57b2170834805a1eaa5278c90db06a (diff) |
ManageNames: make the header bar work correctly
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/namedlg/namemgrtable.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx index f2b03b11509d..d471c7467cc7 100644 --- a/sc/source/ui/namedlg/namemgrtable.cxx +++ b/sc/source/ui/namedlg/namemgrtable.cxx @@ -44,7 +44,7 @@ #define ITEMID_RANGE 2 #define ITEMID_SCOPE 3 -#define MINSIZE 50 +#define MINSIZE 80 String createEntryString(const ScRangeNameLine& rLine) @@ -173,6 +173,7 @@ std::vector<ScRangeNameLine> ScRangeManagerTable::GetSelectedEntries() namespace { +//ensure that the minimum column size is respected void CalculateItemSize(const long& rTableSize, long& rItemNameSize, long& rItemRangeSize) { long aItemScopeSize = rTableSize - rItemNameSize - rItemRangeSize; @@ -218,16 +219,20 @@ IMPL_LINK( ScRangeManagerTable, HeaderEndDragHdl, void*, EMPTYARG) long aItemNameSize = maHeaderBar.GetItemSize(ITEMID_NAME); long aItemRangeSize = maHeaderBar.GetItemSize(ITEMID_RANGE); + //calculate column size based on user input and minimum size CalculateItemSize(aTableSize, aItemNameSize, aItemRangeSize); long aItemScopeSize = aTableSize - aItemNameSize - aItemRangeSize; Size aSz; aSz.Width() = aItemNameSize; SetTab( ITEMID_NAME, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width(), MAP_APPFONT ); + maHeaderBar.SetItemSize(ITEMID_NAME, aItemNameSize); aSz.Width() += aItemRangeSize; SetTab( ITEMID_RANGE, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width(), MAP_APPFONT ); + maHeaderBar.SetItemSize(ITEMID_RANGE, aItemRangeSize); aSz.Width() += aItemScopeSize; SetTab( ITEMID_SCOPE, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width(), MAP_APPFONT ); + maHeaderBar.SetItemSize(ITEMID_SCOPE, aItemScopeSize); return 0; } |