summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r--sc/source/ui/unoobj/addruno.cxx27
-rw-r--r--sc/source/ui/unoobj/docuno.cxx63
-rw-r--r--sc/source/ui/unoobj/fmtuno.cxx41
3 files changed, 50 insertions, 81 deletions
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index 10627222be80..9b3ce8e3d4bc 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -69,7 +69,7 @@ void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
-sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
+sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString, ::formula::FormulaGrammar::AddressConvention eConv )
{
if (!pDocShell)
return sal_False;
@@ -78,7 +78,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
sal_Bool bSuccess = sal_False;
if ( bIsRange )
{
- USHORT nResult = aRange.ParseAny( rUIString, pDoc );
+ USHORT nResult = aRange.ParseAny( rUIString, pDoc, eConv );
if ( nResult & SCA_VALID )
{
if ( ( nResult & SCA_TAB_3D ) == 0 )
@@ -92,7 +92,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString )
}
else
{
- USHORT nResult = aRange.aStart.Parse( rUIString, pDoc );
+ USHORT nResult = aRange.aStart.Parse( rUIString, pDoc, eConv );
if ( nResult & SCA_VALID )
{
if ( ( nResult & SCA_TAB_3D ) == 0 )
@@ -118,6 +118,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp
{MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{0,0,0,0,0,0}
};
static uno::Reference<beans::XPropertySetInfo> aRef(new SfxItemPropertySetInfo( aPropertyMap ));
@@ -131,6 +132,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp
{MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 },
{MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
+ {MAP_CHAR_LEN(SC_UNONAME_XLA1REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
{0,0,0,0,0,0}
};
static uno::Reference<beans::XPropertySetInfo> aRef(new SfxItemPropertySetInfo( aPropertyMap ));
@@ -190,8 +192,11 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
bSuccess = ParseUIString( aUIString );
}
}
- else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) )
+ else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) )
{
+ ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ?
+ ::formula::FormulaGrammar::CONV_OOO : ::formula::FormulaGrammar::CONV_XL_A1;
+
// parse the file format string
rtl::OUString sRepresentation;
if (aValue >>= sRepresentation)
@@ -212,7 +217,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr
}
// parse the rest like a UI string
- bSuccess = ParseUIString( aUIString );
+ bSuccess = ParseUIString( aUIString, eConv );
}
}
else
@@ -265,17 +270,23 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const rtl::OUString&
aRange.aStart.Format( aFormatStr, nFlags, pDoc );
aRet <<= rtl::OUString( aFormatStr );
}
- else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) )
+ else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) )
{
+ ::formula::FormulaGrammar::AddressConvention eConv = aNameStr.EqualsAscii( SC_UNONAME_XLA1REPR ) ?
+ ::formula::FormulaGrammar::CONV_OOO : ::formula::FormulaGrammar::CONV_XL_A1;
+
// generate file format string - always include sheet
String aFormatStr;
- aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc );
+ aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc, eConv );
if ( bIsRange )
{
// manually concatenate range so both parts always have the sheet name
aFormatStr.Append( (sal_Unicode) ':' );
String aSecond;
- aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc );
+ USHORT nFlags = SCA_VALID;
+ if( eConv != ::formula::FormulaGrammar::CONV_XL_A1 )
+ nFlags |= SCA_TAB_3D;
+ aRange.aEnd.Format( aSecond, nFlags, pDoc, eConv );
aFormatStr.Append( aSecond );
}
aRet <<= rtl::OUString( aFormatStr );
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 828ec8f09297..eb493f3be426 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -225,53 +225,53 @@ ScPrintUIOptions::ScPrintUIOptions()
sal_Bool bSuppress = rPrintOpt.GetSkipEmpty();
ResStringArray aStrings( ScResId( SCSTR_PRINT_OPTIONS ) );
- DBG_ASSERT( aStrings.Count() >= 19, "resource incomplete" );
- if( aStrings.Count() < 19 ) // bad resource ?
+ DBG_ASSERT( aStrings.Count() >= 10, "resource incomplete" );
+ if( aStrings.Count() < 10 ) // bad resource ?
return;
m_aUIProperties.realloc( 8 );
// create Section for spreadsheet (results in an extra tab page in dialog)
SvtModuleOptions aOpt;
- String aAppGroupname( aStrings.GetString( 18 ) );
+ String aAppGroupname( aStrings.GetString( 9 ) );
aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ),
aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) );
- m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() );
+ m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) );
// create subgroup for pages
m_aUIProperties[1].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 0 ) ), rtl::OUString() );
// create a bool option for empty pages
m_aUIProperties[2].Value = getBoolControlOpt( rtl::OUString( aStrings.GetString( 1 ) ),
- rtl::OUString( aStrings.GetString( 2 ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsIncludeEmptyPages" ) ),
! bSuppress
);
// create Subgroup for print content
vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
- m_aUIProperties[3].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 6 ) ),
+ m_aUIProperties[3].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 2 ) ),
rtl::OUString(),
aPrintRangeOpt
);
// create a choice for the content to create
- uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpTexts( 3 );
- aChoices[0] = aStrings.GetString( 7 );
- aHelpTexts[0] = aStrings.GetString( 8 );
- aChoices[1] = aStrings.GetString( 9 );
- aHelpTexts[1] = aStrings.GetString( 10 );
- aChoices[2] = aStrings.GetString( 11 );
- aHelpTexts[2] = aStrings.GetString( 12 );
+ uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpIds( 3 );
+ aChoices[0] = aStrings.GetString( 3 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) );
+ aChoices[1] = aStrings.GetString( 4 );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) );
+ aChoices[2] = aStrings.GetString( 5 );
+ aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) );
m_aUIProperties[4].Value = getChoiceControlOpt( rtl::OUString(),
- aHelpTexts,
+ aHelpIds,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ),
aChoices,
nContent );
// create Subgroup for print range
aPrintRangeOpt.mbInternalOnly = sal_True;
- m_aUIProperties[5].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 13 ) ),
+ m_aUIProperties[5].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 6 ) ),
rtl::OUString(),
aPrintRangeOpt
);
@@ -279,13 +279,13 @@ ScPrintUIOptions::ScPrintUIOptions()
// create a choice for the range to print
rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
aChoices.realloc( 2 );
- aHelpTexts.realloc( 2 );
- aChoices[0] = aStrings.GetString( 14 );
- aHelpTexts[0] = aStrings.GetString( 15 );
- aChoices[1] = aStrings.GetString( 16 );
- aHelpTexts[1] = aStrings.GetString( 17 );
+ aHelpIds.realloc( 2 );
+ aChoices[0] = aStrings.GetString( 7 );
+ aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:0" ) );
+ aChoices[1] = aStrings.GetString( 8 );
+ aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:1" ) );
m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(),
- aHelpTexts,
+ aHelpIds,
aPrintRangeName,
aChoices,
0 );
@@ -293,24 +293,11 @@ ScPrintUIOptions::ScPrintUIOptions()
// create a an Edit dependent on "Pages" selected
vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True );
m_aUIProperties[7].Value = getEditControlOpt( rtl::OUString(),
- rtl::OUString(),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ),
rtl::OUString(),
aPageRangeOpt
);
-
- // "Print only selected sheets" isn't needed because of the "Selected Sheets" choice in "Print content"
-#if 0
- // create subgroup for sheets
- m_aUIProperties[8].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 3 ) ), rtl::OUString() );
-
- // create a bool option for selected pages only
- m_aUIProperties[9].Value = getBoolControlOpt( rtl::OUString( aStrings.GetString( 4 ) ),
- rtl::OUString( aStrings.GetString( 5 ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsOnlySelectedSheets" ) ),
- i_bSelectedOnly
- );
-#endif
}
void ScPrintUIOptions::SetDefaults()
@@ -449,6 +436,12 @@ ScSheetSaveData* ScModelObj::GetSheetSaveData()
return NULL;
}
+void ScModelObj::RepaintRange( const ScRange& rRange )
+{
+ if (pDocShell)
+ pDocShell->PostPaint( rRange, PAINT_GRID );
+}
+
uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType )
throw(uno::RuntimeException)
{
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 392533c7cf93..6da02cf9e4e3 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -236,16 +236,11 @@ ScTableConditionalFormat::~ScTableConditionalFormat()
void ScTableConditionalFormat::AddEntry_Impl(const ScCondFormatEntryItem& aEntry)
{
- ScTableConditionalEntry* pNew = new ScTableConditionalEntry(this, aEntry);
+ ScTableConditionalEntry* pNew = new ScTableConditionalEntry(aEntry);
pNew->acquire();
aEntries.Insert( pNew, LIST_APPEND );
}
-void ScTableConditionalFormat::DataChanged()
-{
- // wenn's mal das "lebende Objekt" ist, muss hier was passieren...
-}
-
// XSheetConditionalFormat
ScTableConditionalEntry* ScTableConditionalFormat::GetObjectByIndex_Impl(USHORT nIndex) const
@@ -348,7 +343,6 @@ void SAL_CALL ScTableConditionalFormat::addNew(
}
AddEntry_Impl(aEntry);
- DataChanged();
}
void SAL_CALL ScTableConditionalFormat::removeByIndex( sal_Int32 nIndex )
@@ -360,7 +354,6 @@ void SAL_CALL ScTableConditionalFormat::removeByIndex( sal_Int32 nIndex )
{
aEntries.Remove(pEntry);
pEntry->release();
- DataChanged();
}
}
@@ -371,8 +364,6 @@ void SAL_CALL ScTableConditionalFormat::clear() throw(uno::RuntimeException)
aEntries.First();
while ( ( pEntry = (ScTableConditionalEntry*)aEntries.Remove() ) != NULL )
pEntry->release();
-
- DataChanged();
}
// XEnumerationAccess
@@ -525,19 +516,14 @@ ScTableConditionalFormat* ScTableConditionalFormat::getImplementation(
//UNUSED2008-05 {
//UNUSED2008-05 }
-ScTableConditionalEntry::ScTableConditionalEntry(ScTableConditionalFormat* pPar,
- const ScCondFormatEntryItem& aItem) :
- pParent( pPar ),
+ScTableConditionalEntry::ScTableConditionalEntry(const ScCondFormatEntryItem& aItem) :
aData( aItem )
{
- if (pParent)
- pParent->acquire();
+ // #i113668# only store the settings, keep no reference to parent object
}
ScTableConditionalEntry::~ScTableConditionalEntry()
{
- if (pParent)
- pParent->release();
}
void ScTableConditionalEntry::GetData(ScCondFormatEntryItem& rData) const
@@ -559,8 +545,6 @@ void SAL_CALL ScTableConditionalEntry::setOperator( sheet::ConditionOperator nOp
{
ScUnoGuard aGuard;
aData.meMode = lcl_ConditionOperatorToMode( nOperator );
- if (pParent)
- pParent->DataChanged();
}
rtl::OUString SAL_CALL ScTableConditionalEntry::getFormula1() throw(uno::RuntimeException)
@@ -574,8 +558,6 @@ void SAL_CALL ScTableConditionalEntry::setFormula1( const rtl::OUString& aFormul
{
ScUnoGuard aGuard;
aData.maExpr1 = String( aFormula1 );
- if (pParent)
- pParent->DataChanged();
}
rtl::OUString SAL_CALL ScTableConditionalEntry::getFormula2() throw(uno::RuntimeException)
@@ -589,8 +571,6 @@ void SAL_CALL ScTableConditionalEntry::setFormula2( const rtl::OUString& aFormul
{
ScUnoGuard aGuard;
aData.maExpr2 = String( aFormula2 );
- if (pParent)
- pParent->DataChanged();
}
table::CellAddress SAL_CALL ScTableConditionalEntry::getSourcePosition() throw(uno::RuntimeException)
@@ -608,8 +588,6 @@ void SAL_CALL ScTableConditionalEntry::setSourcePosition( const table::CellAddre
{
ScUnoGuard aGuard;
aData.maPos.Set( (SCCOL)aSourcePosition.Column, (SCROW)aSourcePosition.Row, aSourcePosition.Sheet );
- if (pParent)
- pParent->DataChanged();
}
// XSheetConditionalEntry
@@ -625,8 +603,6 @@ void SAL_CALL ScTableConditionalEntry::setStyleName( const rtl::OUString& aStyle
{
ScUnoGuard aGuard;
aData.maStyle = ScStyleNameConversion::ProgrammaticToDisplayName( aStyleName, SFX_STYLE_FAMILY_PARA );
- if (pParent)
- pParent->DataChanged();
}
//------------------------------------------------------------------------
@@ -739,11 +715,6 @@ ScTableValidationObj::~ScTableValidationObj()
{
}
-void ScTableValidationObj::DataChanged()
-{
- // wenn's mal das "lebende Objekt" ist, muss hier was passieren...
-}
-
// XSheetCondition
sheet::ConditionOperator SAL_CALL ScTableValidationObj::getOperator()
@@ -758,7 +729,6 @@ void SAL_CALL ScTableValidationObj::setOperator( sheet::ConditionOperator nOpera
{
ScUnoGuard aGuard;
nMode = sal::static_int_cast<USHORT>( lcl_ConditionOperatorToMode( nOperator ) );
- DataChanged();
}
rtl::OUString SAL_CALL ScTableValidationObj::getFormula1() throw(uno::RuntimeException)
@@ -772,7 +742,6 @@ void SAL_CALL ScTableValidationObj::setFormula1( const rtl::OUString& aFormula1
{
ScUnoGuard aGuard;
aExpr1 = String( aFormula1 );
- DataChanged();
}
rtl::OUString SAL_CALL ScTableValidationObj::getFormula2() throw(uno::RuntimeException)
@@ -786,7 +755,6 @@ void SAL_CALL ScTableValidationObj::setFormula2( const rtl::OUString& aFormula2
{
ScUnoGuard aGuard;
aExpr2 = String( aFormula2 );
- DataChanged();
}
table::CellAddress SAL_CALL ScTableValidationObj::getSourcePosition() throw(uno::RuntimeException)
@@ -804,7 +772,6 @@ void SAL_CALL ScTableValidationObj::setSourcePosition( const table::CellAddress&
{
ScUnoGuard aGuard;
aSrcPos.Set( (SCCOL)aSourcePosition.Column, (SCROW)aSourcePosition.Row, aSourcePosition.Sheet );
- DataChanged();
}
uno::Sequence<sheet::FormulaToken> SAL_CALL ScTableValidationObj::getTokens( sal_Int32 nIndex )
@@ -963,8 +930,6 @@ void SAL_CALL ScTableValidationObj::setPropertyValue(
if ( aValue >>= nVal )
meGrammar2 = static_cast< FormulaGrammar::Grammar >(nVal);
}
-
- DataChanged();
}
uno::Any SAL_CALL ScTableValidationObj::getPropertyValue( const rtl::OUString& aPropertyName )