summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authoros <os@openoffice.org>2009-10-12 10:27:34 +0200
committeros <os@openoffice.org>2009-10-12 10:27:34 +0200
commit542fd3d674db56a676df824b341655833096fc71 (patch)
tree39ae5621085c64018b2577356e3c8723e98f527e /sfx2
parent37cafacf3e7bbdf5c77f2011bd32a953549b0a72 (diff)
#i105687# enable number format for custom date/datetime/time data
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/dinfdlg.hxx4
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx22
2 files changed, 24 insertions, 2 deletions
diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx
index 01746d21527f..8228bb071e1a 100644
--- a/sfx2/inc/sfx2/dinfdlg.hxx
+++ b/sfx2/inc/sfx2/dinfdlg.hxx
@@ -424,6 +424,10 @@ struct CustomPropertyLine
CustomPropertiesYesNoButton m_aYesNoButton;
CustomPropertiesRemoveButton m_aRemoveButton;
+ Point m_aDatePos;
+ Point m_aTimePos;
+ Size m_aDateTimeSize;
+
bool m_bIsRemoved;
bool m_bTypeLostFocus;
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 9d9b97d6667e..4d5417864004 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1656,6 +1656,21 @@ IMPL_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox*, pBox )
pLine->m_aDateField.Show( (CUSTOM_TYPE_DATE == nType) || (CUSTOM_TYPE_DATETIME == nType) );
pLine->m_aTimeField.Show( (CUSTOM_TYPE_TIME == nType) || (CUSTOM_TYPE_DATETIME == 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());
+ }
+ 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 );
+ }
+ else if( nType == CUSTOM_TYPE_TIME)
+ {
+ pLine->m_aTimeField.SetPosSizePixel(pLine->m_aValueEdit.GetPosPixel(), pLine->m_aValueEdit.GetSizePixel());
+ }
+
return 0;
}
@@ -1881,6 +1896,10 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
pCurrent++;
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;
@@ -1898,6 +1917,7 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
{
sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( NF_NUMBER_SYSTEM );
m_aNumberFormatter.GetInputLineString( nTmpValue, nIndex, sValue );
+ pNewLine->m_aValueEdit.SetText( sValue );
nType = CUSTOM_TYPE_NUMBER;
}
else if ( rAny >>= bTmpValue )
@@ -1939,8 +1959,6 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
else
pNewLine->m_aYesNoButton.CheckNo();
}
-// else
-// pNewLine->m_aValueEdit.SetText( sValue );
pNewLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( (void*)nType ) );
}