summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2014-08-17 19:57:54 +0200
committerThomas Arnhold <thomas@arnhold.org>2014-08-17 20:48:38 +0200
commit61aaf3814c25b229479ede786521786997aa4f0f (patch)
tree94fc99a4b9eac69954a5685cdcb20a39709447cc /sfx2
parentdc4b9926ec394d57af41457ea891f590dec05d15 (diff)
Customproperties: Position DateTime correctly
No need to store the position of DateField and TimeField, because this will not change if we choose another type. The only thing what changes is the size of the DateField, because both "DateTime" and "Date" use this field. And for this size we just rely on the size of m_aTimeField, because it's the same as m_aDateField (for type DateTime). Change-Id: Ic590c62d82d8f90576479e10be9d422326032d28
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 3376d6d61f5a..8e160d048310 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1468,13 +1468,15 @@ IMPL_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox*, pBox )
pLine->m_aDurationField.Show( CUSTOM_TYPE_DURATION == nType );
pLine->m_aEditButton.Show( CUSTOM_TYPE_DURATION == nType );
pLine->m_aYesNoButton.Show( CUSTOM_TYPE_BOOLEAN == nType );
+
//adjust positions of date and time controls
if ( nType == CUSTOM_TYPE_DATE )
- pLine->m_aDateField.SetPosSizePixel(pLine->m_aValueEdit.GetPosPixel(), pLine->m_aValueEdit.GetSizePixel());
+ pLine->m_aDateField.SetSizePixel( pLine->m_aValueEdit.GetSizePixel() );
else if ( nType == CUSTOM_TYPE_DATETIME)
{
- pLine->m_aDateField.SetPosSizePixel( pLine->m_aDatePos, pLine->m_aDateTimeSize );
- pLine->m_aTimeField.SetPosSizePixel(pLine->m_aTimePos, pLine->m_aDateTimeSize );
+ // because m_aDateField and m_aTimeField have the same size for type "DateTime",
+ // we just rely on m_aTimeField here.
+ pLine->m_aDateField.SetSizePixel( pLine->m_aTimeField.GetSizePixel() );
}
return 0;
@@ -1754,10 +1756,6 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny )
pNewCurrent++;
}
- pNewLine->m_aDatePos = pNewLine->m_aDateField.GetPosPixel();
- pNewLine->m_aTimePos = pNewLine->m_aTimeField.GetPosPixel();
- pNewLine->m_aDateTimeSize = pNewLine->m_aDateField.GetSizePixel();
-
double nTmpValue = 0;
bool bTmpValue = false;
OUString sTmpValue;