diff options
Diffstat (limited to 'dbaccess/source/ui/control/FieldDescControl.cxx')
-rw-r--r-- | dbaccess/source/ui/control/FieldDescControl.cxx | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 353fba74e3e1..e05829656531 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -29,10 +29,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#define ITEMID_HORJUSTIFY SID_ATTR_ALIGN_HOR_JUSTIFY -#define ITEMID_VERJUSTIFY SID_ATTR_ALIGN_VER_JUSTIFY -#define ITEMID_LINEBREAK SID_ATTR_ALIGN_LINEBREAK -#define ITEMID_MARGIN SID_ATTR_ALIGN_MARGIN +#define ITEMID_HORJUSTIFY SID_ATTR_ALIGN_HOR_JUSTIFY +#define ITEMID_VERJUSTIFY SID_ATTR_ALIGN_VER_JUSTIFY +#define ITEMID_LINEBREAK SID_ATTR_ALIGN_LINEBREAK +#define ITEMID_MARGIN SID_ATTR_ALIGN_MARGIN #include "FieldDescControl.hxx" #include "FieldControls.hxx" @@ -51,7 +51,7 @@ #include <svx/svxids.hrc> #include <svx/algitem.hxx> #include <svl/itempool.hxx> -#define _ZFORLIST_DECLARE_TABLE // ohne das bekomme ich einen Compiler-Fehler in <svl/zforlist.hxx> +#define _ZFORLIST_DECLARE_TABLE // ohne das bekomme ich einen Compiler-Fehler in <svl/zforlist.hxx> #include <svl/zforlist.hxx> #include <svl/rngitem.hxx> #include <svl/intitem.hxx> @@ -84,18 +84,18 @@ using namespace ::com::sun::star::util; //================================================================== // fuer die Controls auf der OFieldDescGenPage -#define CONTROL_SPACING_X 18 // 6 -#define CONTROL_SPACING_Y 4 -#define CONTROL_WIDTH_1 160 // 100 -#define CONTROL_WIDTH_2 100 // 60 -#define CONTROL_WIDTH_3 250 -#define CONTROL_WIDTH_4 (CONTROL_WIDTH_3 - 20 - 5) +#define CONTROL_SPACING_X 18 // 6 +#define CONTROL_SPACING_Y 4 +#define CONTROL_WIDTH_1 160 // 100 +#define CONTROL_WIDTH_2 100 // 60 +#define CONTROL_WIDTH_3 250 +#define CONTROL_WIDTH_4 (CONTROL_WIDTH_3 - 20 - 5) -#define SBA_DEF_RANGEFORMAT (100 + 143) // RangeItem -#define SBA_DEF_FMTVALUE (100 + 144) // SfxULONG, Format -#define SBA_ATTR_ALIGN_HOR_JUSTIFY (100 + 145) // SvxHorJustifyItem +#define SBA_DEF_RANGEFORMAT (100 + 143) // RangeItem +#define SBA_DEF_FMTVALUE (100 + 144) // SfxULONG, Format +#define SBA_ATTR_ALIGN_HOR_JUSTIFY (100 + 145) // SvxHorJustifyItem -#define HSCROLL_STEP 20 +#define HSCROLL_STEP 20 namespace @@ -105,7 +105,7 @@ namespace { double nValue = _nValue; sal_Int32 nNumberFormat = ::comphelper::getNumberFormatType(_xNumberFormatter,_nFormatKey); - if( (nNumberFormat & ::com::sun::star::util::NumberFormat::DATE) == ::com::sun::star::util::NumberFormat::DATE + if( (nNumberFormat & ::com::sun::star::util::NumberFormat::DATE) == ::com::sun::star::util::NumberFormat::DATE || (nNumberFormat & ::com::sun::star::util::NumberFormat::DATETIME) == ::com::sun::star::util::NumberFormat::DATETIME ) { nValue = DBTypeConversion::toStandardDbDate(DBTypeConversion::getNULLDate(_xNumberFormatter->getNumberFormatsSupplier()),nValue); @@ -263,11 +263,11 @@ OFieldDescControl::~OFieldDescControl() { ::std::auto_ptr<Window> aTemp(m_pVertScroll); - m_pVertScroll = NULL; + m_pVertScroll = NULL; } { ::std::auto_ptr<Window> aTemp(m_pHorzScroll); - m_pHorzScroll = NULL; + m_pHorzScroll = NULL; } if ( m_bAdded ) ::dbaui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); @@ -410,7 +410,7 @@ void OFieldDescControl::CheckScrollBars() { m_pVertScroll->Show(); m_pVertScroll->SetRangeMax(nActive - nLastVisible); -// m_pVertScroll->SetThumbPos(0); +// m_pVertScroll->SetThumbPos(0); m_pVertScroll->SetPosSizePixel( Point(nNewHWidth, 0), Size(nVScrollWidth, szOverallSize.Height()) ); } @@ -425,7 +425,7 @@ void OFieldDescControl::CheckScrollBars() { m_pHorzScroll->Show(); m_pHorzScroll->SetRangeMax((lMaxXPosition - lMaxXAvailable + HSCROLL_STEP - 1 )/HSCROLL_STEP); -// m_pHorzScroll->SetThumbPos(0); +// m_pHorzScroll->SetThumbPos(0); m_pHorzScroll->SetPosSizePixel( Point(0, nNewVHeight), Size(bNeedVScrollBar ? nNewHWidth : szOverallSize.Width(), nHScrollHeight) ); } @@ -475,12 +475,12 @@ void OFieldDescControl::ScrollAllAggregates() if (nDeltaX || nDeltaY) { - Control* ppAggregates[] = { pRequired, pNumType + Control* ppAggregates[] = { pRequired, pNumType , pAutoIncrement, pDefault , pTextLen, pLength , pScale, m_pColumnName , m_pType, m_pAutoIncrementValue}; - Control* ppAggregatesText[] = { pRequiredText, pNumTypeText + Control* ppAggregatesText[] = { pRequiredText, pNumTypeText , pAutoIncrementText, pDefaultText , pTextLenText, pLengthText , pScaleText, m_pColumnNameText @@ -527,13 +527,13 @@ void OFieldDescControl::SetReadOnly( sal_Bool bReadOnly ) DBG_CHKTHIS(OFieldDescControl,NULL); ////////////////////////////////////////////////////////////////////// // Controls enablen/disablen - Control* ppAggregates[] = { pRequired, pNumType + Control* ppAggregates[] = { pRequired, pNumType , pAutoIncrement, pDefault , pTextLen, pLength , pScale, m_pColumnName , m_pType, m_pAutoIncrementValue , pFormat}; - Control* ppAggregatesText[] = { pRequiredText, pNumTypeText + Control* ppAggregatesText[] = { pRequiredText, pNumTypeText , pAutoIncrementText, pDefaultText , pTextLenText, pLengthText , pScaleText, m_pColumnNameText @@ -729,7 +729,7 @@ IMPL_LINK( OFieldDescControl, FormatClickHdl, Button *, /*pButton*/ ) } // ----------------------------------------------------------------------- -void OFieldDescControl::SetModified(sal_Bool /*bModified*/) +void OFieldDescControl::SetModified(sal_Bool /*bModified*/) { } //------------------------------------------------------------------------ @@ -814,9 +814,9 @@ void OFieldDescControl::ArrangeAggregates() // die Beschreibung eines Controls struct AGGREGATE_DESCRIPTION { - Control* pctrlInputControl; // das eigentliche Control zur Eingabe - Control* pctrlTextControl; // das Label dazu - USHORT nPosSizeArgument; // das zweite Argument fuer SetPosSize + Control* pctrlInputControl; // das eigentliche Control zur Eingabe + Control* pctrlTextControl; // das Label dazu + USHORT nPosSizeArgument; // das zweite Argument fuer SetPosSize }; AGGREGATE_DESCRIPTION adAggregates[] = { { m_pColumnName, m_pColumnNameText, 1}, @@ -924,7 +924,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) pRequired->InsertEntry( aYes ); pRequired->InsertEntry( aNo ); pRequired->SelectEntryPos(1); - + InitializeControl(pRequired,HID_TAB_ENT_REQUIRED,true); } } @@ -1094,7 +1094,7 @@ OPropNumericEditCtrl* OFieldDescControl::CreateNumericControl(USHORT _nHelpStr,s OPropNumericEditCtrl* pControl = new OPropNumericEditCtrl( this, _nHelpStr, _nProperty, WB_BORDER ); pControl->SetDecimalDigits(0); pControl->SetMin(0); - pControl->SetMax(0x7FFFFFFF); // soll draussen geaendert werden, wenn noetig + pControl->SetMax(0x7FFFFFFF); // soll draussen geaendert werden, wenn noetig pControl->SetStrictFormat(TRUE); InitializeControl(pControl,_nHelpId,false); @@ -1170,7 +1170,7 @@ void OFieldDescControl::DeactivateAggregate( EControlType eType ) void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 nCol ) { DBG_CHKTHIS(OFieldDescControl,NULL); - + ////////////////////////////////////////////////////////////////////// // Groesse ermitteln const sal_Int32 nControlHeight = GetMaxControlHeight(); @@ -1228,12 +1228,12 @@ void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 n const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height(); aPosition.Y() += ((nRow+1)*nControl_Spacing_y) + (nRow*nControlHeight); - + ////////////////////////////////////////////////////////////////////// // Control anzeigen (*ppControl)->SetPosSizePixel( aPosition, aSize ); aSize = (*ppControl)->GetSizePixel(); - + (*ppControl)->Show(); } //------------------------------------------------------------------------------ @@ -1461,7 +1461,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) { // disable autoincrement value because it should only be visible when autoincrement is to true DeactivateAggregate( tpAutoIncrementValue ); - pAutoIncrement->SelectEntryPos( 1 ); // no + pAutoIncrement->SelectEntryPos( 1 ); // no ActivateAggregate( tpDefault ); // hat Auswirkungen auf pRequired if(!pFieldDescr->IsPrimaryKey()) @@ -1478,7 +1478,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) if( pBoolDefault ) { // wenn pRequired auf sal_True gesetzt ist, dann darf das sal_Bool Feld nicht den Eintrag <<keiner>> besitzen - ::rtl::OUString sValue; + ::rtl::OUString sValue; pFieldDescr->GetControlDefault() >>= sValue; String sDef = BoolStringUI(sValue); @@ -1507,9 +1507,9 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) if( pRequired ) { if( pFieldDescr->IsNullable() ) - pRequired->SelectEntryPos( 1 ); // no + pRequired->SelectEntryPos( 1 ); // no else - pRequired->SelectEntryPos( 0 ); // yes + pRequired->SelectEntryPos( 0 ); // yes } if( pTextLen ) @@ -1540,7 +1540,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) USHORT nPos = pFieldType.get() ? m_pType->GetEntryPos(String(pFieldDescr->getTypeInfo()->aUIName)) : LISTBOX_ENTRY_NOTFOUND; if(nPos == LISTBOX_ENTRY_NOTFOUND) { - const OTypeInfoMap* pMap = getTypeInfo(); + const OTypeInfoMap* pMap = getTypeInfo(); OTypeInfoMap::const_iterator aIter = pMap->find(pFieldType.get() ? pFieldDescr->getTypeInfo()->nType : pFieldDescr->GetType()); if(aIter == pMap->end() && !pMap->empty()) { @@ -1787,9 +1787,9 @@ void OFieldDescControl::LoseFocus() sal_Bool OFieldDescControl::isCopyAllowed() { sal_Bool bAllowed = (m_pActFocusWindow != NULL) && - (m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample || - m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || - m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || + (m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample || + m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || + m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || m_pActFocusWindow == m_pAutoIncrementValue) && static_cast<Edit*>(m_pActFocusWindow)->GetSelected().Len() != 0; @@ -1799,9 +1799,9 @@ sal_Bool OFieldDescControl::isCopyAllowed() sal_Bool OFieldDescControl::isCutAllowed() { sal_Bool bAllowed = (m_pActFocusWindow != NULL) && - (m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample || - m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || - m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || + (m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample || + m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || + m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || m_pActFocusWindow == m_pAutoIncrementValue) && static_cast<Edit*>(m_pActFocusWindow)->GetSelected().Len() != 0; return bAllowed; @@ -1810,9 +1810,9 @@ sal_Bool OFieldDescControl::isCutAllowed() sal_Bool OFieldDescControl::isPasteAllowed() { sal_Bool bAllowed = (m_pActFocusWindow != NULL) && - (m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample || - m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || - m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || + (m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample || + m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || + m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName || m_pActFocusWindow == m_pAutoIncrementValue); if ( bAllowed ) { @@ -1915,7 +1915,7 @@ String OFieldDescControl::getControlDefault( const OFieldDescription* _pFieldDes ::comphelper::getNumberFormatProperty(xNumberFormatter,nFormatKey,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Locale"))) >>= aLocale; sal_Int32 nNumberFormat = ::comphelper::getNumberFormatType(xNumberFormatter,nFormatKey); - if( (nNumberFormat & ::com::sun::star::util::NumberFormat::DATE) == ::com::sun::star::util::NumberFormat::DATE + if( (nNumberFormat & ::com::sun::star::util::NumberFormat::DATE) == ::com::sun::star::util::NumberFormat::DATE || (nNumberFormat & ::com::sun::star::util::NumberFormat::DATETIME) == ::com::sun::star::util::NumberFormat::DATETIME ) { nValue = DBTypeConversion::toNullDate(DBTypeConversion::getNULLDate(xNumberFormatter->getNumberFormatsSupplier()),nValue); |