summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-01-07 10:51:57 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2011-01-07 10:51:57 +0100
commitc36c24d7c4396dff864b77e91fe36cd7890a5342 (patch)
treeae2badbfe9e824874323983967f98a02c9c09848 /svtools
parent9cb54ddb6ee986202829eab834cb856a4df5c45f (diff)
gridsort: RowHeight belongs to the GridControlModel (not the GridDataModel), too
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/uno/svtxgridcontrol.cxx38
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx4
2 files changed, 26 insertions, 16 deletions
diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx
index c4a524ac5e87..a1cae97b64ff 100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -144,18 +144,35 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An
case BASEPROPERTY_COLUMN_HEADER_HEIGHT:
{
+ sal_Int32 columnHeaderHeight = 0;
if ( !aValue.hasValue() )
{
- sal_Int32 const fontHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
- m_pTableModel->setColumnHeaderHeight( fontHeight );
+ columnHeaderHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
}
else
{
- sal_Int32 nColumnHeaderHeight = 0;
- aValue >>= nColumnHeaderHeight;
- ENSURE_OR_BREAK( nColumnHeaderHeight > 0, "SVTXGridControl::setProperty: illegal column header height!" );
- m_pTableModel->setColumnHeaderHeight( nColumnHeaderHeight );
+ aValue >>= columnHeaderHeight;
}
+ ENSURE_OR_BREAK( columnHeaderHeight > 0, "SVTXGridControl::setProperty: illegal column header height!" );
+ m_pTableModel->setColumnHeaderHeight( columnHeaderHeight );
+ // TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
+ pTable->Invalidate();
+ }
+ break;
+
+ case BASEPROPERTY_ROW_HEIGHT:
+ {
+ sal_Int32 rowHeight = 0;
+ if ( !aValue.hasValue() )
+ {
+ rowHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MAP_APPFONT ).Height();
+ }
+ else
+ {
+ aValue >>= rowHeight;
+ }
+ m_pTableModel->setRowHeight( rowHeight );
+ ENSURE_OR_BREAK( rowHeight > 0, "SVTXGridControl::setProperty: illegal row height!" );
// TODO: the model should broadcast this change itself, and the table should invalidate itself as needed
pTable->Invalidate();
}
@@ -470,14 +487,7 @@ void SAL_CALL SVTXGridControl::dataChanged(const ::com::sun::star::awt::grid::Gr
TableControl* pTable = dynamic_cast< TableControl* >( GetWindow() );
ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::dataChanged: no control (anymore)!" );
- if ( Event.AttributeName.equalsAscii( "RowHeight" ) )
- {
- sal_Int32 rowHeight = m_pTableModel->getRowHeight();
- Event.NewValue>>=rowHeight;
- m_pTableModel->setRowHeight(rowHeight);
- pTable->Invalidate();
- }
- else if ( Event.AttributeName.equalsAscii( "RowHeaders" ) )
+ if ( Event.AttributeName.equalsAscii( "RowHeaders" ) )
{
// TODO: we could do better than this - invalidate the header area only
pTable->Invalidate();
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index f37d5f80ed68..c796352c373d 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -1360,7 +1360,7 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An
case BASEPROPERTY_TREE_DATAMODEL:
onChangeDataModel( rTree, Reference< XTreeDataModel >( aValue, UNO_QUERY ) );
break;
- case BASEPROPERTY_TREE_ROWHEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
{
sal_Int32 nHeight = 0;
if( aValue >>= nHeight )
@@ -1445,7 +1445,7 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru
}
return Any( eSelectionType );
}
- case BASEPROPERTY_TREE_ROWHEIGHT:
+ case BASEPROPERTY_ROW_HEIGHT:
return Any( (sal_Int32)rTree.GetEntryHeight() );
case BASEPROPERTY_TREE_DATAMODEL:
return Any( mxDataModel );