[Libreoffice-commits] .: sc/source vbahelper/inc vbahelper/source

2012-04-24 Thread Noel Power
 sc/source/ui/inc/preview.hxx |   10 +++---
 sc/source/ui/inc/prevwsh.hxx |4 +-
 sc/source/ui/vba/vbaworksheets.cxx   |   48 +--
 vbahelper/inc/vbahelper/vbahelper.hxx|1 
 vbahelper/source/vbahelper/vbahelper.cxx |   12 +--
 5 files changed, 61 insertions(+), 14 deletions(-)

New commits:
commit 7ddb8f73c1a5573eedc593168f702287921ecb7a
Author: Noel Power noel.po...@novell.com
Date:   Tue Apr 24 11:23:46 2012 +0100

tweak support Sheets.PrintPreview bnc#75784 allow specific sheet(s) 
selection

this is a followup to commit 17c8f6745f9f98013c1b08de8ec03be66546c7fc

diff --git a/sc/source/ui/inc/preview.hxx b/sc/source/ui/inc/preview.hxx
index f926e1a..6482c05 100644
--- a/sc/source/ui/inc/preview.hxx
+++ b/sc/source/ui/inc/preview.hxx
@@ -130,13 +130,13 @@ public:
 
 virtual void DataChanged( const DataChangedEvent rDCEvt );
 
-voidDataChanged(bool bNewTime = false); // statt 
Invalidate rufen
+SC_DLLPUBLIC voidDataChanged(bool bNewTime = false); // 
statt Invalidate rufen
 voidDoInvalidate();
 
 voidSetXOffset( long nX );
 voidSetYOffset( long nY );
 voidSetZoom(sal_uInt16 nNewZoom);
-voidSetPageNo( long nPage );
+SC_DLLPUBLIC voidSetPageNo( long nPage );
 
 boolGetPageMargins() const { return bPageMargin; }
 voidSetPageMargins( bool bVal )  { bPageMargin = bVal; }
@@ -158,7 +158,7 @@ public:
 boolAllTested() const   { return bValid  nTabsTested = nTabCount; }
 
 sal_uInt16  GetOptimalZoom(bool bWidthOnly);
-longGetFirstPage(SCTAB nTab);
+SC_DLLPUBLIC longGetFirstPage(SCTAB nTab);
 
 voidCalcAll()   { CalcPages(); }
 voidSetInGetState(bool bSet) { bInGetState = bSet; }
@@ -168,8 +168,8 @@ public:
 
 FmFormView* GetDrawView() { return pDrawView; }
 
-void SetSelectedTabs(const ScMarkData rMark);
-const ScMarkData::MarkedTabsType GetSelectedTabs() const;
+SC_DLLPUBLIC void SetSelectedTabs(const ScMarkData rMark);
+SC_DLLPUBLIC const ScMarkData::MarkedTabsType GetSelectedTabs() const;
 };
 
 
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 1ac668a..0664c1e 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -90,7 +90,7 @@ protected:
 virtual voidReadUserDataSequence (const 
::com::sun::star::uno::Sequence  ::com::sun::star::beans::PropertyValue , 
sal_Bool bBrowse = false );
 
 public:
-TYPEINFO();
+TYPEINFO_VISIBILITY( SC_DLLPUBLIC );
 
 SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL)
 SFX_DECL_VIEWFACTORY(ScPreviewShell);
@@ -127,7 +127,7 @@ public:
 
 const ScPreviewLocationData GetLocationData();
 ScDocument* GetDocument();
-ScPreview*  GetPreview() { return pPreview; }
+SC_DLLPUBLIC ScPreview*  GetPreview() { return pPreview; }
 };
 
 
diff --git a/sc/source/ui/vba/vbaworksheets.cxx 
b/sc/source/ui/vba/vbaworksheets.cxx
index 3d218fa..e952d9a 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -57,7 +57,8 @@
 #include markdata.hxx
 
 #include vector
-
+#include prevwsh.hxx
+#include preview.hxx
 using namespace ::ooo::vba;
 using namespace ::com::sun::star;
 
@@ -537,11 +538,52 @@ bool ScVbaWorksheets::nameExists( uno::Reference 
sheet::XSpreadsheetDocument
 return false;
 }
 
-void ScVbaWorksheets::PrintPreview( const css::uno::Any EnableChanges ) throw 
(css::uno::RuntimeException)
+void ScVbaWorksheets::PrintPreview( const css::uno::Any /*EnableChanges*/ ) 
throw (css::uno::RuntimeException)
 {
 // need test, print preview current active sheet
 // !! TODO !! get view shell from controller
-PrintPreviewHelper( EnableChanges, excel::getBestViewShell( mxModel ) );
+ScTabViewShell* pViewShell = excel::getBestViewShell( mxModel );
+SfxViewFrame* pViewFrame = NULL;
+if ( pViewShell )
+pViewFrame = pViewShell-GetViewFrame();
+if ( pViewFrame )
+{
+if ( !pViewFrame-GetFrame().IsInPlace() )
+{
+dispatchExecute( pViewShell, SID_VIEWSHELL1 );
+SfxViewShell*  pShell = SfxViewShell::Get( 
pViewFrame-GetFrame().GetFrameInterface()-getController() );
+
+if (  pShell-ISA( ScPreviewShell ) )
+{
+ScPreviewShell* pPrvShell = static_cast  ScPreviewShell* ( 
pShell );
+ScPreview* pPrvView = pPrvShell-GetPreview();
+ScMarkData aMarkData;
+sal_Int32 nElems = getCount();
+for ( sal_Int32 nItem = 1; nItem = nElems; ++nItem )
+{
+uno::Reference excel::XWorksheet  xSheet( Item( 
uno::makeAny( nItem ), uno::Any() ), uno::UNO_QUERY_THROW );
+ScVbaWorksheet* pSheet = 
excel::getImplFromDocModuleWrapperScVbaWorksheet( xSheet );
+   

[Libreoffice-commits] .: sc/source

2012-04-24 Thread Ivan Timofeev
 sc/source/ui/navipi/navipi.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 1a87849f1971bf6802cc3d6395181b6ff0ceeed1
Author: Ivan Timofeev timofeev@gmail.com
Date:   Tue Apr 24 21:22:16 2012 +0400

fdo#34999: UI: Navigator row selector pane exceeds reserved grey area

diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index c6d4afa..5eabf0a 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -675,7 +675,9 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, 
SfxChildWindowContext* pCW, Win
 
 aTitleBase = GetText();
 
-long nListboxYPos = aTbxCmd.GetPosPixel().Y() + 
aTbxCmd.GetSizePixel().Height() + 4;
+long nListboxYPos =
+Max( aTbxCmd.GetPosPixel().Y() + aTbxCmd.GetSizePixel().Height(),
+ aEdRow.GetPosPixel().Y() + aEdRow.GetSizePixel().Height() ) + 4;
 aLbEntries.SetPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y);
 
 nBorderOffset = aLbEntries.GetPosPixel().X();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-19 Thread Markus Mohrhard
 sc/source/filter/excel/xestyle.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9bdb2bc1a0e5a6173ee3517fa64b9eaea46a4ca6
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Apr 19 16:29:17 2012 +0200

fix ambiguous in win build

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index acb746c..01beec6 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1219,7 +1219,7 @@ void XclExpNumFmt::SaveXml( XclExpXmlStream rStrm, const 
String rFormatCode )
 {
 sax_fastparser::FSHelperPtr rStyleSheet = rStrm.GetCurrentStream();
 rStyleSheet-singleElement( XML_numFmt,
-XML_numFmtId,   OString::valueOf( mnXclNumFmt ).getStr(),
+XML_numFmtId,   OString::valueOf( 
static_castsal_Int32(mnXclNumFmt) ).getStr(),
 XML_formatCode, XclXmlUtils::ToOString( rFormatCode ).getStr(),
 FSEND );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-19 Thread Lubos Lunak
 sc/source/filter/xml/xmlexprt.cxx  |2 --
 sc/source/ui/drawfunc/fuconcustomshape.cxx |1 -
 sc/source/ui/drawfunc/fuconrec.cxx |1 -
 sc/source/ui/drawfunc/fuconuno.cxx |1 -
 4 files changed, 5 deletions(-)

New commits:
commit ee7dacf6f0900b3a62e489e8d7bad315711a704d
Author: Luboš Luňák l.lu...@suse.cz
Date:   Thu Apr 19 17:03:39 2012 +0200

remove unused variables

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 72a1014..531a5c5 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3162,8 +3162,6 @@ void ScXMLExport::WriteShapes(const ScMyCell rMyCell)
 aPoint.X = 2 * aItr-xShape-getPosition().X + 
aItr-xShape-getSize().Width - aPoint.X;
 if ( !aItr-xShape-getShapeType().equals(sCaptionShape) )
 {
-Rectangle aEndRec(pDoc-GetMMRect(aItr-aEndAddress.Col(), 
aItr-aEndAddress.Row(),
-aItr-aEndAddress.Col(), aItr-aEndAddress.Row(), 
aItr-aEndAddress.Tab()));
 rtl::OUString sEndAddress;
 ScRangeStringConverter::GetStringFromAddress(sEndAddress, 
aItr-aEndAddress, pDoc, FormulaGrammar::CONV_OOO);
 AddAttribute(XML_NAMESPACE_TABLE, XML_END_CELL_ADDRESS, 
sEndAddress);
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx 
b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index d86507e..a518e62 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -128,7 +128,6 @@ sal_Bool FuConstCustomShape::MouseButtonUp(const 
MouseEvent rMEvt)
 
 if ( pView-IsCreateObj()  rMEvt.IsLeft() )
 {
-Point aPnt( pWindow-PixelToLogic( rMEvt.GetPosPixel() ) );
 pView-EndCreateObj(SDRCREATE_FORCEEND);
 bReturn = sal_True;
 }
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx 
b/sc/source/ui/drawfunc/fuconrec.cxx
index f50bed1..8ef1ce7 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -125,7 +125,6 @@ sal_Bool FuConstRectangle::MouseButtonUp(const MouseEvent 
rMEvt)
 
 if ( pView-IsCreateObj()  rMEvt.IsLeft() )
 {
-Point aPnt( pWindow-PixelToLogic( rMEvt.GetPosPixel() ) );
 pView-EndCreateObj(SDRCREATE_FORCEEND);
 
 if (aSfxRequest.GetSlot() == SID_DRAW_CAPTION_VERTICAL)
diff --git a/sc/source/ui/drawfunc/fuconuno.cxx 
b/sc/source/ui/drawfunc/fuconuno.cxx
index f1098c6..924ab3e 100644
--- a/sc/source/ui/drawfunc/fuconuno.cxx
+++ b/sc/source/ui/drawfunc/fuconuno.cxx
@@ -109,7 +109,6 @@ sal_Bool FuConstUnoControl::MouseButtonUp(const MouseEvent 
rMEvt)
 
 if ( pView-IsCreateObj()  rMEvt.IsLeft() )
 {
-Point aPnt( pWindow-PixelToLogic( rMEvt.GetPosPixel() ) );
 pView-EndCreateObj(SDRCREATE_FORCEEND);
 bReturn = sal_True;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-18 Thread Noel Power
 sc/source/ui/view/output2.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 808dd658a265f565a638556322250a0957e8e535
Author: Noel Power noel.po...@novell.com
Date:   Wed Apr 18 18:36:25 2012 +0100

make sure nPos is and nChar are reset for string without placeholder

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 6c616eb..bca73f5 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -520,6 +520,11 @@ sal_Bool ScDrawStringsVars::SetText( ScBaseCell* pCell )
 aString.Erase( nPos, 2 );
 }
 }
+else
+{
+nPos = STRING_NOTFOUND;
+nChar = 0x0;
+}
 if (aString.Len()  DRAWTEXT_MAX)
 aString.Erase(DRAWTEXT_MAX);
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-17 Thread Tor Lillqvist
 sc/source/filter/oox/addressconverter.cxx |   11 ---
 sc/source/filter/oox/drawingbase.cxx  |   11 ---
 2 files changed, 22 deletions(-)

New commits:
commit 7c3c0c557e8b293551fb6b1b7a1f39b45a394777
Author: Tor Lillqvist t...@iki.fi
Date:   Tue Apr 17 10:04:17 2012 +0300

WaE: unused functions

diff --git a/sc/source/filter/oox/addressconverter.cxx 
b/sc/source/filter/oox/addressconverter.cxx
index 90c916c..ef7c0fa 100644
--- a/sc/source/filter/oox/addressconverter.cxx
+++ b/sc/source/filter/oox/addressconverter.cxx
@@ -97,17 +97,6 @@ const sal_Unicode BIFF_URL_UNC  = '@';  /// UNC 
path root.
 const sal_Unicode BIFF_DCON_ENCODED = '\x01';   /// First character of an 
encoded path from DCON* records.
 const sal_Unicode BIFF_DCON_INTERN  = '\x02';   /// First character of an 
encoded sheet name from DCON* records.
 
-
-inline sal_uInt8 lclGetBiffAddressSize( bool bCol16Bit, bool bRow32Bit )
-{
-return (bCol16Bit ? 2 : 1) + (bRow32Bit ? 4 : 2);
-}
-
-inline sal_uInt8 lclGetBiffRangeSize( bool bCol16Bit, bool bRow32Bit )
-{
-return 2 * lclGetBiffAddressSize( bCol16Bit, bRow32Bit );
-}
-
 } // namespace
 
 // 
diff --git a/sc/source/filter/oox/drawingbase.cxx 
b/sc/source/filter/oox/drawingbase.cxx
index 330cada..3e3cb64 100644
--- a/sc/source/filter/oox/drawingbase.cxx
+++ b/sc/source/filter/oox/drawingbase.cxx
@@ -61,17 +61,6 @@ inline sal_Int32 lclEmuToHmm( sal_Int64 nValue )
 return (nValue  0) ? -1 : convertEmuToHmm( nValue );
 }
 
-/** Reads the cell anchor model from a BIFF or DFF stream. */
-BinaryInputStream operator( BinaryInputStream rStrm, CellAnchorModel 
rModel )
-{
-// all members are given as 16-bit unsigned values
-rModel.mnCol = rStrm.readuInt16();
-rModel.mnColOffset = rStrm.readuInt16();
-rModel.mnRow = rStrm.readuInt16();
-rModel.mnRowOffset = rStrm.readuInt16();
-return rStrm;
-}
-
 } // namespace
 
 // 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-17 Thread Takeshi Abe
 sc/source/ui/unoobj/datauno.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 84a1ca6d9136c71bf20514307876824c1f915c0a
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Wed Apr 18 03:38:08 2012 +0900

fdo#46983 Macros: Macro to set filter in Calc does not work with 
.StringValue

this fixed a regression slipped into 
8808d77f199720be596a09084fbc36569ed2f1f1

diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 8380c0b..2043e26 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -1324,7 +1324,7 @@ throw(uno::RuntimeException)
 if (!bByEmpty  !rEntry.GetQueryItems().empty())
 {
 const ScQueryEntry::Item rItem = rEntry.GetQueryItems().front();
-aField.IsNumeric = !rItem.meType != ScQueryEntry::ByString;
+aField.IsNumeric = rItem.meType != ScQueryEntry::ByString;
 aField.StringValue   = rItem.maString;
 aField.NumericValue  = rItem.mfVal;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-17 Thread Eike Rathke
 sc/source/ui/inc/mvtabdlg.hxx  |2 ++
 sc/source/ui/miscdlgs/mvtabdlg.cxx |   27 +--
 2 files changed, 19 insertions(+), 10 deletions(-)

New commits:
commit e1ca72ca9f783a2f956f1445ce82cd3eacffe4a2
Author: Eike Rathke er...@redhat.com
Date:   Tue Apr 17 20:57:34 2012 +0200

resolved rhbz#813280 the current document is not always the first in list

i.e. if more than one document open and dialog invoked on any but the first
document.

diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx
index c53a59f..f9c63a3 100644
--- a/sc/source/ui/inc/mvtabdlg.hxx
+++ b/sc/source/ui/inc/mvtabdlg.hxx
@@ -58,6 +58,7 @@ private:
 void ResetRenameInput();
 void CheckNewTabName();
 ScDocument* GetSelectedDoc();
+bool IsCurrentDocSelected() const;
 
 private:
 FixedLine   aFlAction;
@@ -82,6 +83,7 @@ private:
 
 const rtl::OUString maDefaultName;
 
+sal_uInt16  mnCurrentDocPos;
 sal_uInt16  nDocument;
 SCTAB   nTable;
 boolbCopyTable:1;
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx 
b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index 4287e20..b3f30c4 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -70,6 +70,7 @@ ScMoveTableDlg::ScMoveTableDlg(Window* pParent, const 
rtl::OUString rDefault)
 maStrTabNameInvalid( 
ResId::toString(ScResId(STR_TABNAME_WARN_INVALID)) ),
 //
 maDefaultName( rDefault ),
+mnCurrentDocPos( 0 ),
 nDocument   ( 0 ),
 nTable  ( 0 ),
 bCopyTable  ( false ),
@@ -127,8 +128,13 @@ void ScMoveTableDlg::EnableRenameTable(sal_Bool bFlag)
 void ScMoveTableDlg::ResetRenameInput()
 {
 if (mbEverEdited)
+{
 // Don't reset the name when the sheet name has ever been edited.
+// But check the name, as this is also called for change of copy/move
+// buttons and document listbox selection.
+CheckNewTabName();
 return;
+}
 
 if (!aEdTabName.IsEnabled())
 {
@@ -178,19 +184,15 @@ void ScMoveTableDlg::CheckNewTabName()
 return;
 }
 
-bool   bFound = false;
+bool bMoveInCurrentDoc = (aBtnMove.IsChecked()  IsCurrentDocSelected());
+bool bFound = false;
 sal_uInt16 nLast  = aLbTable.GetEntryCount() - 1;
-for ( sal_uInt16 i=0; i=nLast; ++i )
+for ( sal_uInt16 i=0; i=nLast  !bFound; ++i )
 {
 if ( aNewName.equals(aLbTable.GetEntry(i)) )
 {
-if (aBtnMove.IsChecked() 
-aLbDoc.GetSelectEntryPos() == 0 
-maDefaultName.equals(aEdTabName.GetText()))
-
-// Move inside same document, thus same name is allowed.
-bFound = false;
-else
+// Only for move within same document the same name is allowed.
+if (!bMoveInCurrentDoc || !maDefaultName.equals( 
aEdTabName.GetText()))
 bFound = true;
 }
 }
@@ -214,6 +216,11 @@ ScDocument* ScMoveTableDlg::GetSelectedDoc()
 return static_castScDocument*(aLbDoc.GetEntryData(nPos));
 }
 
+bool ScMoveTableDlg::IsCurrentDocSelected() const
+{
+return aLbDoc.GetSelectEntryPos() == mnCurrentDocPos;
+}
+
 //
 
 void ScMoveTableDlg::Init()
@@ -254,7 +261,7 @@ void ScMoveTableDlg::InitDocListBox()
 
 if ( pScSh == SfxObjectShell::Current() )
 {
-nSelPos = i;
+mnCurrentDocPos = nSelPos = i;
 aEntryName += sal_Unicode( ' ' );
 aEntryName += String( ScResId( STR_CURRENTDOC ) );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-17 Thread Caolán McNamara
 sc/source/filter/oox/workbookhelper.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 8ae293f0a1509b26f9a65f9297fddca7b106e46e
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Apr 17 20:49:51 2012 +0100

WaE: MacOSX pScRangeData may be unused uninitialized

diff --git a/sc/source/filter/oox/workbookhelper.cxx 
b/sc/source/filter/oox/workbookhelper.cxx
index 479f504..83c67bd 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -382,8 +382,7 @@ ScRangeData* lcl_addNewByNameAndTokens( ScDocument rDoc, 
ScRangeName* pNames, c
 ScRangeData* WorkbookGlobals::createNamedRangeObject( OUString orName, const 
Sequence FormulaToken rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const
 {
 // create the name and insert it into the Calc document
-Reference XNamedRange  xNamedRange;
-ScRangeData* pScRangeData;
+ScRangeData* pScRangeData = NULL;
 if( !orName.isEmpty() ) try
 {
 // find an unused name
@@ -396,7 +395,7 @@ ScRangeData* WorkbookGlobals::createNamedRangeObject( 
OUString orName, const Se
 ScRangeName* pNames = rDoc.GetRangeName();
 pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, 
rTokens, nIndex, nNameFlags );
 }
-catch( Exception )
+catch (const Exception)
 {
 }
 return pScRangeData;
@@ -405,8 +404,7 @@ ScRangeData* WorkbookGlobals::createNamedRangeObject( 
OUString orName, const Se
 ScRangeData* WorkbookGlobals::createLocalNamedRangeObject( OUString orName, 
const Sequence FormulaToken   rTokens, sal_Int32 nIndex, sal_Int32 
nNameFlags, sal_Int32 nTab ) const
 {
 // create the name and insert it into the Calc document
-Reference XNamedRange  xNamedRange;
-ScRangeData* pScRangeData;
+ScRangeData* pScRangeData = NULL;
 if( !orName.isEmpty() ) try
 {
 // find an unused name
@@ -423,7 +421,7 @@ ScRangeData* WorkbookGlobals::createLocalNamedRangeObject( 
OUString orName, con
 ScRangeName* pNames = rDoc.GetRangeName( nTab );
 pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, 
rTokens, nIndex, nNameFlags );
 }
-catch( Exception )
+catch (const Exception)
 {
 }
 return pScRangeData;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-17 Thread Markus Mohrhard
 sc/source/filter/oox/workbookhelper.cxx |   32 ++--
 1 file changed, 18 insertions(+), 14 deletions(-)

New commits:
commit e5322f13e0d433a7103edbf36cd3d2ab0d3e18c7
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Apr 17 22:10:10 2012 +0200

some more uno removement in oox range name import

diff --git a/sc/source/filter/oox/workbookhelper.cxx 
b/sc/source/filter/oox/workbookhelper.cxx
index 83c67bd..6e5dce8 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -401,29 +401,33 @@ ScRangeData* WorkbookGlobals::createNamedRangeObject( 
OUString orName, const Se
 return pScRangeData;
 }
 
+namespace {
+
+rtl::OUString findUnusedName( const ScRangeName* pRangeName, const 
rtl::OUString rSuggestedName )
+{
+rtl::OUString aNewName = rSuggestedName;
+sal_Int32 nIndex = 0;
+
while(pRangeName-findByUpperName(ScGlobal::pCharClass-uppercase(aNewName)))
+aNewName = rtl::OUStringBuffer(rSuggestedName).append( '_' ).append( 
nIndex++ ).makeStringAndClear();
+
+return aNewName;
+}
+
+}
+
 ScRangeData* WorkbookGlobals::createLocalNamedRangeObject( OUString orName, 
const Sequence FormulaToken   rTokens, sal_Int32 nIndex, sal_Int32 
nNameFlags, sal_Int32 nTab ) const
 {
 // create the name and insert it into the Calc document
 ScRangeData* pScRangeData = NULL;
-if( !orName.isEmpty() ) try
+if( !orName.isEmpty() )
 {
-// find an unused name
-Reference XIndexAccess  xSheets(mxDoc-getSheets(), UNO_QUERY_THROW);
-Reference XSpreadsheet  xSheet (xSheets-getByIndex(nTab), 
UNO_QUERY_THROW);
-Reference com::sun::star::container::XNamed  xNamed(xSheet, 
UNO_QUERY_THROW);
-rtl::OUString aName = xNamed-getName();
-PropertySet aSheetProps( xSheet );
-Reference XNamedRanges  xNamedRanges( aSheetProps.getAnyProperty( 
PROP_NamedRanges ), UNO_QUERY_THROW );
-Reference XNameAccess  xNameAccess( xNamedRanges, UNO_QUERY_THROW );
-orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
-// create the named range
 ScDocument rDoc =  getScDocument();
 ScRangeName* pNames = rDoc.GetRangeName( nTab );
+// find an unused name
+orName = findUnusedName( pNames, orName );
+// create the named range
 pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, 
rTokens, nIndex, nNameFlags );
 }
-catch (const Exception)
-{
-}
 return pScRangeData;
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-17 Thread Markus Mohrhard
 sc/source/filter/oox/workbookhelper.cxx |   39 +---
 1 file changed, 17 insertions(+), 22 deletions(-)

New commits:
commit cbcf7e32ade5b5402845e14065476f5423351ebf
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Apr 17 22:23:08 2012 +0200

forgot the normal range names

diff --git a/sc/source/filter/oox/workbookhelper.cxx 
b/sc/source/filter/oox/workbookhelper.cxx
index 6e5dce8..1110ebc 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -379,28 +379,6 @@ ScRangeData* lcl_addNewByNameAndTokens( ScDocument rDoc, 
ScRangeName* pNames, c
 return pNew;
 }
 
-ScRangeData* WorkbookGlobals::createNamedRangeObject( OUString orName, const 
Sequence FormulaToken rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const
-{
-// create the name and insert it into the Calc document
-ScRangeData* pScRangeData = NULL;
-if( !orName.isEmpty() ) try
-{
-// find an unused name
-PropertySet aDocProps( mxDoc );
-Reference XNamedRanges  xNamedRanges( aDocProps.getAnyProperty( 
PROP_NamedRanges ), UNO_QUERY_THROW );
-Reference XNameAccess  xNameAccess( xNamedRanges, UNO_QUERY_THROW );
-orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
-// create the named range
-ScDocument rDoc =  getScDocument();
-ScRangeName* pNames = rDoc.GetRangeName();
-pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, 
rTokens, nIndex, nNameFlags );
-}
-catch (const Exception)
-{
-}
-return pScRangeData;
-}
-
 namespace {
 
 rtl::OUString findUnusedName( const ScRangeName* pRangeName, const 
rtl::OUString rSuggestedName )
@@ -415,6 +393,23 @@ rtl::OUString findUnusedName( const ScRangeName* 
pRangeName, const rtl::OUString
 
 }
 
+ScRangeData* WorkbookGlobals::createNamedRangeObject( OUString orName, const 
Sequence FormulaToken rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const
+{
+// create the name and insert it into the Calc document
+ScRangeData* pScRangeData = NULL;
+if( !orName.isEmpty() )
+{
+ScDocument rDoc =  getScDocument();
+ScRangeName* pNames = rDoc.GetRangeName();
+// find an unused name
+orName = findUnusedName( pNames, orName );
+// create the named range
+pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, 
rTokens, nIndex, nNameFlags );
+}
+return pScRangeData;
+}
+
+
 ScRangeData* WorkbookGlobals::createLocalNamedRangeObject( OUString orName, 
const Sequence FormulaToken   rTokens, sal_Int32 nIndex, sal_Int32 
nNameFlags, sal_Int32 nTab ) const
 {
 // create the name and insert it into the Calc document
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-16 Thread Kohei Yoshida
 sc/source/ui/inc/output.hxx   |2 -
 sc/source/ui/view/output2.cxx |   59 --
 2 files changed, 35 insertions(+), 26 deletions(-)

New commits:
commit e57525b61af70a6ee33c26f979e724740cca8655
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Mon Apr 16 22:02:12 2012 -0400

fdo#48431: More reliable way to check for RTL text.

This is probably more reliable way to fix fdo#32530 such that it won't
cause the regression in rendering Thai texts as reported in fdo#48431.

diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index f9a14a7..8a3dc2c 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -102,12 +102,12 @@ private:
 longmnPosX;
 longmnPosY;
 longmnInitPosX;
-sal_uInt8   mnScript;
 boolmbBreak;
 boolmbCellIsValue;
 boolmbAsianVertical;
 boolmbPixelToLogic;
 boolmbHyphenatorSet;
+boolmbRTL;
 ScFieldEditEngine*  mpEngine;
 ScBaseCell* mpCell;
 const ScPatternAttr*mpPattern;
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 7913a09..2b99bb8 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -70,10 +70,14 @@
 #include scmod.hxx
 #include fillinfo.hxx
 
+#include com/sun/star/i18n/DirectionProperty.hpp
+
 #include boost/ptr_container/ptr_vector.hpp
 
 #include math.h
 
+using namespace com::sun::star;
+
 //! Autofilter-Breite mit column.cxx zusammenfassen
 #define DROPDOWN_BITMAP_SIZE18
 
@@ -1329,6 +1333,29 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE 
nArrY, long nPosX, long nPosY
 rParam.maClipRect.Justify();
 }
 
+namespace {
+
+bool beginsWithRTLCharacter(const rtl::OUString rStr)
+{
+if (rStr.isEmpty())
+return false;
+
+switch (ScGlobal::pCharClass-getCharacterDirection(rStr, 0))
+{
+case i18n::DirectionProperty_RIGHT_TO_LEFT:
+case i18n::DirectionProperty_RIGHT_TO_LEFT_ARABIC:
+case i18n::DirectionProperty_RIGHT_TO_LEFT_EMBEDDING:
+case i18n::DirectionProperty_RIGHT_TO_LEFT_OVERRIDE:
+return true;
+default:
+;
+}
+
+return false;
+}
+
+}
+
 void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
 {
 OSL_ENSURE( pDev == pRefDevice ||
@@ -1563,18 +1590,8 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
 if (aVars.GetHorJust() == SVX_HOR_JUSTIFY_STANDARD)
 {
 // fdo#32530: Default alignment depends on value vs
-// string, and the script type of the 1st letter.
-sal_uInt8 nScript1st = 0;
-rtl::OUString aStr = aVars.GetString();
-if (!aStr.isEmpty())
-{
-aStr = aStr.copy(0, 1);
-nScript1st = pDoc-GetStringScriptType(aStr);
-if (!nScript1st)
-nScript1st = ScGlobal::GetDefaultScriptType();
-}
-
-if (nScript1st == SCRIPTTYPE_COMPLEX)
+// string, and the direction of the 1st letter.
+if (beginsWithRTLCharacter(aVars.GetString()))
 eOutHorJust = bCellIsValue ? SVX_HOR_JUSTIFY_LEFT 
: SVX_HOR_JUSTIFY_RIGHT;
 else
 eOutHorJust = bCellIsValue ? SVX_HOR_JUSTIFY_RIGHT 
: SVX_HOR_JUSTIFY_LEFT;
@@ -2154,12 +2171,12 @@ ScOutputData::DrawEditParam::DrawEditParam(const 
ScPatternAttr* pPattern, const
 mnArrY(0),
 mnX(0), mnY(0), mnCellX(0), mnCellY(0),
 mnPosX(0), mnPosY(0), mnInitPosX(0),
-mnScript(0),
 mbBreak( (meHorJust == SVX_HOR_JUSTIFY_BLOCK) || 
lcl_GetBoolValue(*pPattern, ATTR_LINEBREAK, pCondSet) ),
 mbCellIsValue(bCellIsValue),
 mbAsianVertical(false),
 mbPixelToLogic(false),
 mbHyphenatorSet(false),
+mbRTL(false),
 mpEngine(NULL),
 mpCell(NULL),
 mpPattern(pPattern),
@@ -2580,8 +2597,8 @@ void ScOutputData::DrawEditStandard(DrawEditParam rParam)
 if (eOutHorJust == SVX_HOR_JUSTIFY_STANDARD)
 {
 // fdo#32530: Default alignment depends on value vs string, and the
-// script type of the 1st letter.
-if (rParam.mnScript == SCRIPTTYPE_COMPLEX)
+// direction of the 1st letter.
+if (rParam.mbRTL)
 eOutHorJust = rParam.mbCellIsValue ? SVX_HOR_JUSTIFY_LEFT : 
SVX_HOR_JUSTIFY_RIGHT;
 else
 eOutHorJust = rParam.mbCellIsValue ? SVX_HOR_JUSTIFY_RIGHT : 
SVX_HOR_JUSTIFY_LEFT;
@@ -4586,20 +4603,13 @@ void 

[Libreoffice-commits] .: sc/source

2012-04-15 Thread Tor Lillqvist
 sc/source/filter/oox/defnamesbuffer.cxx   |8 
 sc/source/filter/oox/drawingmanager.cxx   |6 --
 sc/source/filter/oox/pivottablebuffer.cxx |9 -
 3 files changed, 23 deletions(-)

New commits:
commit bc3f0bd3e28b2be1175db685cbb6d60de495777c
Author: Tor Lillqvist t...@iki.fi
Date:   Sun Apr 15 15:08:50 2012 +0200

WaE: unused functions

diff --git a/sc/source/filter/oox/defnamesbuffer.cxx 
b/sc/source/filter/oox/defnamesbuffer.cxx
index 9f63afc..ea767da 100644
--- a/sc/source/filter/oox/defnamesbuffer.cxx
+++ b/sc/source/filter/oox/defnamesbuffer.cxx
@@ -160,14 +160,6 @@ sal_Unicode lclGetBuiltinIdFromBaseName( const OUString 
rModelName )
 return BIFF_DEFNAME_UNKNOWN;
 }
 
-bool lclIsFilterDatabaseName( const OUString rModelName )
-{
-for( const sal_Char* const* ppcName = sppcFilterDbNames; ppcName  
STATIC_ARRAY_END( sppcFilterDbNames ); ++ppcName )
-if( rModelName.equalsIgnoreAsciiCaseAscii( *ppcName ) )
-return true;
-return false;
-}
-
 OUString lclGetUpcaseModelName( const OUString rModelName )
 {
 // TODO: i18n?
diff --git a/sc/source/filter/oox/drawingmanager.cxx 
b/sc/source/filter/oox/drawingmanager.cxx
index 8c46db1..a667e88 100644
--- a/sc/source/filter/oox/drawingmanager.cxx
+++ b/sc/source/filter/oox/drawingmanager.cxx
@@ -171,12 +171,6 @@ const sal_uInt16 BIFF_OBJCMO_AUTOFILL   = 0x4000;   
/// Automatic fill forma
 
 // 
 
-inline BiffInputStream operator( BiffInputStream rStrm, ShapeAnchor 
rAnchor )
-{
-rAnchor.importBiffAnchor( rStrm );
-return rStrm;
-}
-
 } // namespace
 
 // 
diff --git a/sc/source/filter/oox/pivottablebuffer.cxx 
b/sc/source/filter/oox/pivottablebuffer.cxx
index c203cbf..21659b1 100644
--- a/sc/source/filter/oox/pivottablebuffer.cxx
+++ b/sc/source/filter/oox/pivottablebuffer.cxx
@@ -210,15 +210,6 @@ const sal_Int16 BIFF_PTPAGEFIELDS_ALLITEMS  = 
0x7FFD;
 const sal_Int16 BIFF_PTDATAFIELD_PREVIOUS   = 0x7FFB;
 const sal_Int16 BIFF_PTDATAFIELD_NEXT   = 0x7FFC;
 
-// 
-
-OUString lclReadPivotString( const WorkbookHelper rHelper, BiffInputStream 
rStrm, sal_uInt16 nLen )
-{
-if( nLen == BIFF_PT_NOSTRING )
-return OUString();
-return (rHelper.getBiff() == BIFF8) ? rStrm.readUniStringBody( nLen ) : 
rStrm.readCharArrayUC( nLen, rHelper.getTextEncoding() );
-}
-
 } // namespace
 
 // 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-14 Thread Caolán McNamara
 sc/source/core/data/dpitemdata.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 23067849649518210ee0fdf80fa4b05625f1e6bb
Author: Caolán McNamara caol...@redhat.com
Date:   Sat Apr 14 13:46:07 2012 +0100

valgrind: Conditional jump or move depends on uninitialised value

in ScDPItemData::DisposeString

diff --git a/sc/source/core/data/dpitemdata.cxx 
b/sc/source/core/data/dpitemdata.cxx
index c6fc2dd..83ca357 100644
--- a/sc/source/core/data/dpitemdata.cxx
+++ b/sc/source/core/data/dpitemdata.cxx
@@ -125,7 +125,7 @@ ScDPItemData::ScDPItemData(const rtl::OUString* pStr) :
 mpString(pStr), meType(String), mbStringInterned(true) {}
 
 ScDPItemData::ScDPItemData(sal_Int32 nGroupType, sal_Int32 nValue) :
-meType(GroupValue)
+meType(GroupValue), mbStringInterned(false)
 {
 maGroupValue.mnGroupType = nGroupType;
 maGroupValue.mnValue = nValue;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-14 Thread Eike Rathke
 sc/source/ui/docshell/impex.cxx |  164 +++-
 sc/source/ui/inc/impex.hxx  |   17 +---
 2 files changed, 151 insertions(+), 30 deletions(-)

New commits:
commit 7928b651965f747b02593d2a9fc73fac7c86dbf5
Author: Eike Rathke er...@redhat.com
Date:   Sat Apr 14 18:57:31 2012 +0200

resolved fdo#48621 better handling of broken CSV files

* non-escaped (not doubled) quotes in quoted strings are regarded as broken
  representation and are taken literally, only a quote followed by a 
separator
  ends a field. If not being a separator themselves, trailing blanks between
  the ending quote and the separator are ignored, complementary to leading
  blanks between a separator and a quote.
* quotes in a non-quoted string are taken literally

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index f33a0d7..cf51c07 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -573,6 +573,77 @@ void ScImportExport::WriteUnicodeOrByteEndl( SvStream 
rStrm )
 }
 
 
+enum QuoteType
+{
+FIELDSTART_QUOTE,
+FIRST_QUOTE,
+SECOND_QUOTE,
+FIELDEND_QUOTE,
+DONTKNOW_QUOTE
+};
+
+
+/** Determine if *p is a quote that ends a quoted field.
+
+Precondition: we are parsing a quoted field already and *p is a quote.
+
+@return
+FIELDEND_QUOTE if end of field quote
+DONTKNOW_QUOTE anything else
+ */
+static QuoteType lcl_isFieldEndQuote( const sal_Unicode* p, const sal_Unicode* 
pSeps )
+{
+// Due to broken CSV generators that don't double embedded quotes check if
+// a field separator immediately or with trailing spaces follows the quote,
+// only then end the field, or at end of string.
+while (p[1] == ' ')
+++p;
+if (!p[1] || ScGlobal::UnicodeStrChr( pSeps, p[1]))
+return FIELDEND_QUOTE;
+return DONTKNOW_QUOTE;
+}
+
+
+/** Determine if *p is a quote that is escaped by being doubled or ends a
+quoted field.
+
+Precondition: *p is a quote.
+
+@param nQuotes
+Quote characters encountered so far.
+Odd (after opening quote) means either no embedded quotes or only quote
+pairs so far.
+Even means either not in a quoted field or already one quote
+encountered, the first of a pair.
+
+@return
+FIELDSTART_QUOTE if first quote in a field, either starting content or
+embedded so caller should check beforehand.
+FIRST_QUOTE  if first of a doubled quote
+SECOND_QUOTE if second of a doubled quote
+FIELDEND_QUOTE   if end of field quote
+DONTKNOW_QUOTE   if an unescaped quote we don't consider as end of 
field,
+do not increment nQuotes in caller then!
+ */
+static QuoteType lcl_isEscapedOrFieldEndQuote( sal_Int32 nQuotes, const 
sal_Unicode* p,
+const sal_Unicode* pSeps, sal_Unicode cStr )
+{
+if ((nQuotes % 2) == 0)
+{
+if (p[-1] == cStr)
+return SECOND_QUOTE;
+else
+{
+SAL_WARN( sc, lcl_isEscapedOrFieldEndQuote: really want a 
FIELDSTART_QUOTE?);
+return FIELDSTART_QUOTE;
+}
+}
+if (p[1] == cStr)
+return FIRST_QUOTE;
+return lcl_isFieldEndQuote( p, pSeps);
+}
+
+
 /** Append characters of [p1,p2) to rField.
 
 @returns TRUE if ok; FALSE if data overflow, truncated
@@ -606,7 +677,7 @@ enum DoubledQuoteMode
 };
 
 static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String 
rString,
-sal_Unicode cStr, DoubledQuoteMode eMode, bool rbOverflowCell )
+const sal_Unicode* pSeps, sal_Unicode cStr, DoubledQuoteMode 
eMode, bool rbOverflowCell )
 {
 p++;//! jump over opening quote
 bool bCont;
@@ -621,7 +692,18 @@ static const sal_Unicode* lcl_ScanString( const 
sal_Unicode* p, String rString,
 if( *p == cStr )
 {
 if ( *++p != cStr )
-break;
+{
+// break or continue for loop
+if (eMode == DQM_ESCAPE)
+{
+if (lcl_isFieldEndQuote( p-1, pSeps) == FIELDEND_QUOTE)
+break;
+else
+continue;
+}
+else
+break;
+}
 // doubled quote char
 switch ( eMode )
 {
@@ -815,6 +897,10 @@ bool ScImportExport::Text2Doc( SvStream rStrm )
 {
 bool bOk = true;
 
+sal_Unicode pSeps[2];
+pSeps[0] = cSep;
+pSeps[1] = 0;
+
 SCCOL nStartCol = aRange.aStart.Col();
 SCROW nStartRow = aRange.aStart.Row();
 SCCOL nEndCol = aRange.aEnd.Col();
@@ -843,7 +929,7 @@ bool ScImportExport::Text2Doc( SvStream rStrm )
 aCell.Erase();
 if( *p == cStr )
 {

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-13 Thread Miklos Vajna
 sc/source/filter/inc/stylesbuffer.hxx |   47 
 sc/source/filter/oox/stylesbuffer.cxx |  199 --
 unusedcode.easy   |   21 ---
 3 files changed, 267 deletions(-)

New commits:
commit 574fcec8cd287c868b582bc9a4e5087f6e27d83c
Author: Santiago Martinez smvar...@gmail.com
Date:   Thu Apr 12 19:59:56 2012 +0200

Remove unused code in sc.

diff --git a/sc/source/filter/inc/stylesbuffer.hxx 
b/sc/source/filter/inc/stylesbuffer.hxx
index 185ba98..4facf0f 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -278,8 +278,6 @@ public:
 /** Imports a font style flag from a DXF record. */
 voidimportDxfFlag( sal_Int32 nElement, 
SequenceInputStream rStrm );
 
-/** Imports the FONTCOLOR record from the passed stream. */
-voidimportFontColor( BiffInputStream rStrm );
 /** Sets the font attributes from the font block of a CFRULE record. */
 voidimportCfRule( BiffInputStream rStrm );
 
@@ -311,17 +309,6 @@ public:
 FontPropertyType ePropType ) const;
 
 private:
-/** Reads and sets height and flags. */
-voidimportFontData2( BiffInputStream rStrm );
-/** Reads and sets weight, escapement, underline, family, charset 
(BIFF5+). */
-voidimportFontData5( BiffInputStream rStrm );
-
-/** Reads and sets a byte string as font name. */
-voidimportFontName2( BiffInputStream rStrm );
-/** Reads and sets a Unicode string as font name. */
-voidimportFontName8( BiffInputStream rStrm );
-
-private:
 FontModel   maModel;
 ApiFontData maApiData;
 ApiFontUsedFlagsmaUsedFlags;
@@ -390,16 +377,6 @@ public:
 
 /** Sets the alignment attributes from the passed BIFF12 XF record data. */
 voidsetBiff12Data( sal_uInt32 nFlags );
-/** Sets the alignment attributes from the passed BIFF2 XF record data. */
-voidsetBiff2Data( sal_uInt8 nFlags );
-/** Sets the alignment attributes from the passed BIFF3 XF record data. */
-voidsetBiff3Data( sal_uInt16 nAlign );
-/** Sets the alignment attributes from the passed BIFF4 XF record data. */
-voidsetBiff4Data( sal_uInt16 nAlign );
-/** Sets the alignment attributes from the passed BIFF5 XF record data. */
-voidsetBiff5Data( sal_uInt16 nAlign );
-/** Sets the alignment attributes from the passed BIFF8 XF record data. */
-voidsetBiff8Data( sal_uInt16 nAlign, sal_uInt16 
nMiscAttrib );
 
 /** Final processing after import of all style settings. */
 voidfinalizeImport();
@@ -460,10 +437,6 @@ public:
 
 /** Sets the protection attributes from the passed BIFF12 XF record data. 
*/
 voidsetBiff12Data( sal_uInt32 nFlags );
-/** Sets the protection attributes from the passed BIFF2 XF record data. */
-voidsetBiff2Data( sal_uInt8 nNumFmt );
-/** Sets the protection attributes from the passed BIFF3-BIFF8 XF record 
data. */
-voidsetBiff3Data( sal_uInt16 nProt );
 
 /** Final processing after import of all style settings. */
 voidfinalizeImport();
@@ -559,14 +532,6 @@ public:
 /** Imports a border from a DXF record from the passed stream. */
 voidimportDxfBorder( sal_Int32 nElement, 
SequenceInputStream rStrm );
 
-/** Sets the border attributes from the passed BIFF2 XF record data. */
-voidsetBiff2Data( sal_uInt8 nFlags );
-/** Sets the border attributes from the passed BIFF3/BIFF4 XF record data. 
*/
-voidsetBiff3Data( sal_uInt32 nBorder );
-/** Sets the border attributes from the passed BIFF5 XF record data. */
-voidsetBiff5Data( sal_uInt32 nBorder, sal_uInt32 nArea );
-/** Sets the border attributes from the passed BIFF8 XF record data. */
-voidsetBiff8Data( sal_uInt32 nBorder1, sal_uInt32 nBorder2 
);
 /** Sets the border attributes from the border block of a CFRULE record. */
 voidimportCfRule( BiffInputStream rStrm, sal_uInt32 
nFlags );
 
@@ -691,14 +656,6 @@ public:
 /** Imports gradient stop settings from a DXF record. */
 voidimportDxfStop( SequenceInputStream rStrm );
 
-/** Sets the fill attributes from the passed BIFF2 XF record data. */
-voidsetBiff2Data( sal_uInt8 nFlags );
-/** Sets the fill attributes from the passed BIFF3/BIFF4 XF record data. */
-voidsetBiff3Data( sal_uInt16 nArea );
-/** Sets the fill attributes from the passed BIFF5 XF record data. */
-voidsetBiff5Data( sal_uInt32 nArea );
-/** Sets the fill attributes from the passed BIFF8 XF record data. */
-void  

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-13 Thread Julien Nabet
 sc/source/filter/inc/drawingmanager.hxx |   15 --
 sc/source/filter/oox/drawingmanager.cxx |  165 
 unusedcode.easy |3 
 3 files changed, 183 deletions(-)

New commits:
commit 7b0bf8878b057def9539ddde8aef790e30b58532
Author: Julien Nabet serval2...@yahoo.fr
Date:   Fri Apr 13 20:07:44 2012 +0200

Cleaning sc module (oox)

diff --git a/sc/source/filter/inc/drawingmanager.hxx 
b/sc/source/filter/inc/drawingmanager.hxx
index 6a713e0..c10c5b6 100644
--- a/sc/source/filter/inc/drawingmanager.hxx
+++ b/sc/source/filter/inc/drawingmanager.hxx
@@ -117,13 +117,6 @@ public:
 explicitBiffDrawingObjectBase( const WorksheetHelper rHelper 
);
 virtual ~BiffDrawingObjectBase();
 
-/** Reads the BIFF3 OBJ record, returns a new drawing object. */
-static BiffDrawingObjectRef importObjBiff3( const WorksheetHelper 
rHelper, BiffInputStream rStrm );
-/** Reads the BIFF4 OBJ record, returns a new drawing object. */
-static BiffDrawingObjectRef importObjBiff4( const WorksheetHelper 
rHelper, BiffInputStream rStrm );
-/** Reads the BIFF5 OBJ record, returns a new drawing object. */
-static BiffDrawingObjectRef importObjBiff5( const WorksheetHelper 
rHelper, BiffInputStream rStrm );
-
 /** Sets whether this is an area object (then its width and height must be 
greater than 0). */
 inline void setAreaObj( bool bAreaObj ) { mbAreaObj = bAreaObj; }
 /** If set to true, the object supports a simple on-click macro and/or 
hyperlink. */
@@ -187,14 +180,6 @@ protected:
 const ::com::sun::star::awt::Rectangle rShapeRect 
) const = 0;
 
 private:
-/** Reads the contents of a BIFF3 OBJ record. */
-voidimportObjBiff3( BiffInputStream rStrm );
-/** Reads the contents of a BIFF4 OBJ record. */
-voidimportObjBiff4( BiffInputStream rStrm );
-/** Reads the contents of a BIFF5 OBJ record. */
-voidimportObjBiff5( BiffInputStream rStrm );
-
-private:
 ShapeAnchor maAnchor;   /// Position of the drawing object.
 ::rtl::OUString maObjName;  /// Name of the object.
 ::rtl::OUString maMacroName;/// Name of an attached macro.
diff --git a/sc/source/filter/oox/drawingmanager.cxx 
b/sc/source/filter/oox/drawingmanager.cxx
index 1e00ff7..8c46db1 100644
--- a/sc/source/filter/oox/drawingmanager.cxx
+++ b/sc/source/filter/oox/drawingmanager.cxx
@@ -270,120 +270,6 @@ BiffDrawingObjectBase::~BiffDrawingObjectBase()
 {
 }
 
-/*static*/ BiffDrawingObjectRef BiffDrawingObjectBase::importObjBiff3( const 
WorksheetHelper rHelper, BiffInputStream rStrm )
-{
-BiffDrawingObjectRef xDrawingObj;
-
-if( rStrm.getRemaining() = 30 )
-{
-sal_uInt16 nObjType;
-rStrm.skip( 4 );
-rStrm  nObjType;
-switch( nObjType )
-{
-case BIFF_OBJTYPE_GROUP:xDrawingObj.reset( new 
BiffGroupObject( rHelper ) );break;
-case BIFF_OBJTYPE_LINE: xDrawingObj.reset( new 
BiffLineObject( rHelper ) ); break;
-case BIFF_OBJTYPE_RECTANGLE:xDrawingObj.reset( new 
BiffRectObject( rHelper ) ); break;
-case BIFF_OBJTYPE_OVAL: xDrawingObj.reset( new 
BiffOvalObject( rHelper ) ); break;
-case BIFF_OBJTYPE_ARC:  xDrawingObj.reset( new 
BiffArcObject( rHelper ) );  break;
-#if 0
-case BIFF_OBJTYPE_CHART:xDrawingObj.reset( new 
XclImpChartObj( rHelper ) ); break;
-case BIFF_OBJTYPE_TEXT: xDrawingObj.reset( new 
XclImpTextObj( rHelper ) );  break;
-case BIFF_OBJTYPE_BUTTON:   xDrawingObj.reset( new 
XclImpButtonObj( rHelper ) );break;
-case BIFF_OBJTYPE_PICTURE:  xDrawingObj.reset( new 
XclImpPictureObj( rHelper ) );   break;
-#endif
-default:
-#if 0
-OSL_ENSURE( false, BiffDrawingObjectBase::importObjBiff3 - 
unknown object type );
-#endif
-xDrawingObj.reset( new BiffPlaceholderObject( rHelper ) );
-}
-}
-
-xDrawingObj-importObjBiff3( rStrm );
-return xDrawingObj;
-}
-
-/*static*/ BiffDrawingObjectRef BiffDrawingObjectBase::importObjBiff4( const 
WorksheetHelper rHelper, BiffInputStream rStrm )
-{
-BiffDrawingObjectRef xDrawingObj;
-
-if( rStrm.getRemaining() = 30 )
-{
-sal_uInt16 nObjType;
-rStrm.skip( 4 );
-rStrm  nObjType;
-switch( nObjType )
-{
-case BIFF_OBJTYPE_GROUP:xDrawingObj.reset( new 
BiffGroupObject( rHelper ) );break;
-case BIFF_OBJTYPE_LINE: xDrawingObj.reset( new 
BiffLineObject( rHelper ) ); break;
-case BIFF_OBJTYPE_RECTANGLE:xDrawingObj.reset( new 
BiffRectObject( rHelper ) ); break;
-case BIFF_OBJTYPE_OVAL: xDrawingObj.reset( new 
BiffOvalObject( rHelper ) ); 

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-13 Thread Julien Nabet
 sc/source/filter/inc/commentsbuffer.hxx   |8 --
 sc/source/filter/inc/querytablebuffer.hxx |7 --
 sc/source/filter/inc/richstring.hxx   |7 --
 sc/source/filter/inc/scenariobuffer.hxx   |3 -
 sc/source/filter/oox/commentsbuffer.cxx   |   46 
 sc/source/filter/oox/querytablebuffer.cxx |   65 ---
 sc/source/filter/oox/richstring.cxx   |   83 --
 sc/source/filter/oox/scenariobuffer.cxx   |   35 
 unusedcode.easy   |9 ---
 9 files changed, 263 deletions(-)

New commits:
commit bb5fa5773461e14de153266ccfa36e5f454ff9b8
Author: Julien Nabet serval2...@yahoo.fr
Date:   Fri Apr 13 22:57:19 2012 +0200

Cleaning sc (oox)

diff --git a/sc/source/filter/inc/commentsbuffer.hxx 
b/sc/source/filter/inc/commentsbuffer.hxx
index 9827b82..b02e209 100644
--- a/sc/source/filter/inc/commentsbuffer.hxx
+++ b/sc/source/filter/inc/commentsbuffer.hxx
@@ -81,14 +81,6 @@ public:
 voidfinalizeImport();
 
 private:
-/** Reads a BIFF2-BIFF5 NOTE record. */
-voidimportNoteBiff2( BiffInputStream rStrm );
-/** Reads a BIFF8 NOTE record. */
-voidimportNoteBiff8( BiffInputStream rStrm );
-/** Reads a NOTESOUND record. */
-voidimportNoteSound( BiffInputStream rStrm );
-
-private:
 CommentModelmaModel;
 };
 
diff --git a/sc/source/filter/inc/querytablebuffer.hxx 
b/sc/source/filter/inc/querytablebuffer.hxx
index 8496e40..79116ec 100644
--- a/sc/source/filter/inc/querytablebuffer.hxx
+++ b/sc/source/filter/inc/querytablebuffer.hxx
@@ -70,13 +70,6 @@ public:
 /** Imports query table settings from the QUERYTABLE record. */
 voidimportQueryTable( SequenceInputStream rStrm );
 
-/** Imports query table settings from the QUERYTABLE record. */
-voidimportQueryTable( BiffInputStream rStrm );
-/** Imports query table settings from the QUERYTABLEREFRESH record. */
-voidimportQueryTableRefresh( BiffInputStream rStrm );
-/** Imports query table settings from the QUERYTABLESETTINGS record. */
-voidimportQueryTableSettings( BiffInputStream rStrm );
-
 /** Inserts a web query into the sheet. */
 voidfinalizeImport();
 
diff --git a/sc/source/filter/inc/richstring.hxx 
b/sc/source/filter/inc/richstring.hxx
index 07a645a..95dd4f5 100644
--- a/sc/source/filter/inc/richstring.hxx
+++ b/sc/source/filter/inc/richstring.hxx
@@ -251,13 +251,6 @@ public:
 /** Imports a Unicode rich-string from the passed record stream. */
 voidimportString( SequenceInputStream rStrm, bool bRich );
 
-/** Imports nChars byte characters from the passed BIFF stream and appends 
a new text portion. */
-voidimportCharArray( BiffInputStream rStrm, sal_uInt16 
nChars, rtl_TextEncoding eTextEnc );
-/** Imports a byte string from the passed BIFF stream and appends new text 
portions. */
-voidimportByteString( BiffInputStream rStrm, 
rtl_TextEncoding eTextEnc, BiffStringFlags nFlags = BIFF_STR_DEFAULT );
-/** Imports a Unicode rich-string from the passed BIFF stream and appends 
new text portions. */
-voidimportUniString( BiffInputStream rStrm, 
BiffStringFlags nFlags = BIFF_STR_DEFAULT );
-
 /** Final processing after import of all strings. */
 voidfinalizeImport();
 
diff --git a/sc/source/filter/inc/scenariobuffer.hxx 
b/sc/source/filter/inc/scenariobuffer.hxx
index 4205d8b..3e5c203 100644
--- a/sc/source/filter/inc/scenariobuffer.hxx
+++ b/sc/source/filter/inc/scenariobuffer.hxx
@@ -79,9 +79,6 @@ public:
 /** Imports a new cell for this scenario from a INPUTCELLS record. */
 voidimportInputCells( SequenceInputStream rStrm );
 
-/** Imports a scenario definition from a SCENARIO record. */
-voidimportScenario( BiffInputStream rStrm );
-
 /** Creates the scenario in the Calc document. */
 voidfinalizeImport();
 
diff --git a/sc/source/filter/oox/commentsbuffer.cxx 
b/sc/source/filter/oox/commentsbuffer.cxx
index 0ea4ca2..3bbf751 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -220,52 +220,6 @@ void Comment::finalizeImport()
 
 // private 
 
-void Comment::importNoteBiff2( BiffInputStream rStrm )
-{
-sal_uInt16 nTotalLen;
-rStrm  nTotalLen;
-sal_uInt16 nPartLen = ::std::min( nTotalLen, static_cast sal_uInt16 ( 
rStrm.getRemaining() ) );
-RichStringRef xNoteText = createText();
-xNoteText-importCharArray( rStrm, nPartLen, getTextEncoding() );
-
-nTotalLen = nTotalLen - nPartLen;   // operator-=() gives compiler warning
-while( (nTotalLen  0)  (rStrm.getNextRecId() == BIFF_ID_NOTE)  
rStrm.startNextRecord() )

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-13 Thread Julien Nabet
 sc/source/filter/inc/pivotcachebuffer.hxx |4 
 sc/source/filter/inc/pivottablebuffer.hxx |   15 --
 sc/source/filter/oox/pivotcachebuffer.cxx |   19 ---
 sc/source/filter/oox/pivottablebuffer.cxx |  158 --
 unusedcode.easy   |8 -
 5 files changed, 204 deletions(-)

New commits:
commit e00e693d2b3c39246328a99adc142284edbed285
Author: Julien Nabet serval2...@yahoo.fr
Date:   Fri Apr 13 23:11:31 2012 +0200

Some cleaning sc (oox)

diff --git a/sc/source/filter/inc/pivotcachebuffer.hxx 
b/sc/source/filter/inc/pivotcachebuffer.hxx
index cb57fef..31be3e4 100644
--- a/sc/source/filter/inc/pivotcachebuffer.hxx
+++ b/sc/source/filter/inc/pivotcachebuffer.hxx
@@ -455,10 +455,6 @@ public:
 WorksheetHelper rSheetHelper, sal_Int32 nRowIdx ) 
const;
 
 private:
-/** Reads the worksheet source range from the DCONREF record. */
-voidimportDConRef( BiffInputStream rStrm );
-/** Reads the defined name used for source data from the DCONNAME record. 
*/
-voidimportDConName( BiffInputStream rStrm );
 /** Reads the sheet name and URL from the DCONREF, DCONNAME, or DCONBINAME 
records. */
 voidimportDConUrl( BiffInputStream rStrm );
 
diff --git a/sc/source/filter/inc/pivottablebuffer.hxx 
b/sc/source/filter/inc/pivottablebuffer.hxx
index 3be8691..a907b3f 100644
--- a/sc/source/filter/inc/pivottablebuffer.hxx
+++ b/sc/source/filter/inc/pivottablebuffer.hxx
@@ -154,10 +154,6 @@ public:
 /** Imports pivot field item reference settings from the PTREFERENCEITEM 
record. */
 voidimportPTReferenceItem( SequenceInputStream rStrm );
 
-/** Imports pivot field settings from the PTFIELD and following records. */
-voidimportPTField( BiffInputStream rStrm );
-/** Imports pivot field settings from the PTFIELD2 record. */
-voidimportPTField2( BiffInputStream rStrm );
 /** Imports settings of an item in this pivot field from the PTFITEM 
record. */
 voidimportPTFItem( BiffInputStream rStrm );
 
@@ -348,17 +344,6 @@ public:
 /** Reads the settings of a field located in the data dimension from the 
PTDATAFIELD record. */
 voidimportPTDataField( SequenceInputStream rStrm );
 
-/** Reads global pivot table settings from the PTDEFINITION record. */
-voidimportPTDefinition( BiffInputStream rStrm, sal_Int16 
nSheet );
-/** Reads additional global pivot table settings from the PTDEFINITION2 
record. */
-voidimportPTDefinition2( BiffInputStream rStrm );
-/** Reads the indexes of all fields located in the row or column dimension 
from a PTROWCOLFIELDS record. */
-voidimportPTRowColFields( BiffInputStream rStrm );
-/** Reads the settings of all fields located in the page dimension from a 
PTPAGEFIELDS record. */
-voidimportPTPageFields( BiffInputStream rStrm );
-/** Reads the settings of a field located in the data dimension from a 
PTDATAFIELD record. */
-voidimportPTDataField( BiffInputStream rStrm );
-
 /** Creates and returns a new pivot table field. */
 PivotTableFieldcreateTableField();
 /** Creates and returns a new pivot table filter. */
diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx 
b/sc/source/filter/oox/pivotcachebuffer.cxx
index 2a07a61..395c2a8 100644
--- a/sc/source/filter/oox/pivotcachebuffer.cxx
+++ b/sc/source/filter/oox/pivotcachebuffer.cxx
@@ -1330,25 +1330,6 @@ void PivotCache::importPCItemIndexList( BiffInputStream 
rStrm, WorksheetHelper
 
 // private 
 
-void PivotCache::importDConRef( BiffInputStream rStrm )
-{
-BinRange aBinRange;
-aBinRange.read( rStrm, false ); // always 8-bit column indexes
-// store range address unchecked with sheet index 0, will be 
resolved/checked later
-getAddressConverter().convertToCellRangeUnchecked( 
maSheetSrcModel.maRange, aBinRange, 0 );
-
-// the URL with (required) sheet name and optional URL of an external 
document
-importDConUrl( rStrm );
-OSL_ENSURE( !maSheetSrcModel.maSheet.isEmpty(), PivotCache::importDConRef 
- missing sheet name );
-}
-
-void PivotCache::importDConName( BiffInputStream rStrm )
-{
-maSheetSrcModel.maDefName = (getBiff() == BIFF8) ? rStrm.readUniString() : 
rStrm.readByteStringUC( false, getTextEncoding() );
-OSL_ENSURE( !maSheetSrcModel.maDefName.isEmpty(), 
PivotCache::importDConName - missing defined name );
-importDConUrl( rStrm );
-}
-
 void PivotCache::importDConUrl( BiffInputStream rStrm )
 {
 // the URL with sheet name and optional URL of an external document
diff --git a/sc/source/filter/oox/pivottablebuffer.cxx 
b/sc/source/filter/oox/pivottablebuffer.cxx
index 0a5dc73..c203cbf 100644
--- 

[Libreoffice-commits] .: sc/source

2012-04-12 Thread Eike Rathke
 sc/source/ui/docshell/impex.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 2a2d04dff73b85185f7da59fea173a8bffb7c190
Author: Eike Rathke er...@redhat.com
Date:   Fri Apr 13 01:37:00 2012 +0200

one more lcl_appendLineData() for line size 64k

Though this specific piece of code is not used in CSV import it may act on
long lines now.

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index a8790bb..6227c3a 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -634,7 +634,13 @@ static const sal_Unicode* lcl_ScanString( const 
sal_Unicode* p, String rString,
 break;
 case DQM_CONCAT :
 if ( p0+1  p )
-rString.Append( p0, 
sal::static_int_castxub_StrLen( (p-1) - p0 ) );  // first part
+{
+// first part
+if (!lcl_appendLineData( rString, p0, p-1))
+{
+/* TODO: warning at UI, data truncated */
+}
+}
 p0 = ++p;   // text of next part starts here
 break;
 case DQM_SEPARATE :
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-12 Thread Eike Rathke
 sc/source/ui/docshell/impex.cxx |   14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 9f77876a96911a7138aa2081077a03abd34a9cf4
Author: Eike Rathke er...@redhat.com
Date:   Fri Apr 13 01:43:59 2012 +0200

two additional places to raise data truncated error for fdo#48516

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 6227c3a..f33a0d7 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -606,7 +606,7 @@ enum DoubledQuoteMode
 };
 
 static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String 
rString,
-sal_Unicode cStr, DoubledQuoteMode eMode )
+sal_Unicode cStr, DoubledQuoteMode eMode, bool rbOverflowCell )
 {
 p++;//! jump over opening quote
 bool bCont;
@@ -637,9 +637,7 @@ static const sal_Unicode* lcl_ScanString( const 
sal_Unicode* p, String rString,
 {
 // first part
 if (!lcl_appendLineData( rString, p0, p-1))
-{
-/* TODO: warning at UI, data truncated */
-}
+rbOverflowCell = true;
 }
 p0 = ++p;   // text of next part starts here
 break;
@@ -656,9 +654,7 @@ static const sal_Unicode* lcl_ScanString( const 
sal_Unicode* p, String rString,
 if ( p0  p )
 {
 if (!lcl_appendLineData( rString, p0, ((*p || *(p-1) == cStr) ? 
p-1 : p)))
-{
-/* TODO: warning at UI, data truncated */
-}
+rbOverflowCell = true;
 }
 } while ( bCont );
 return p;
@@ -847,7 +843,7 @@ bool ScImportExport::Text2Doc( SvStream rStrm )
 aCell.Erase();
 if( *p == cStr )
 {
-p = lcl_ScanString( p, aCell, cStr, DQM_KEEP );
+p = lcl_ScanString( p, aCell, cStr, DQM_KEEP, 
bOverflowCell );
 while( *p  *p != cSep )
 p++;
 if( *p )
@@ -1449,7 +1445,7 @@ const sal_Unicode* 
ScImportExport::ScanNextFieldFromString( const sal_Unicode* p
 {
 rbIsQuoted = true;
 const sal_Unicode* p1;
-p1 = p = lcl_ScanString( p, rField, cStr, DQM_ESCAPE );
+p1 = p = lcl_ScanString( p, rField, cStr, DQM_ESCAPE, rbOverflowCell );
 while ( *p  !ScGlobal::UnicodeStrChr( pSeps, *p ) )
 p++;
 // Append remaining unquoted and undelimited data (dirty, dirty) to
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-11 Thread Kohei Yoshida
 sc/source/filter/oox/sharedformulabuffer.cxx |  213 ---
 1 file changed, 213 deletions(-)

New commits:
commit ddfa209fc0422c544292ad23413851d1b654de7c
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Apr 11 20:06:02 2012 -0400

Removed the source file of SharedFormulaBuffer, which is no longer used.

It has been replaced by SheetDataBuffer.

diff --git a/sc/source/filter/oox/sharedformulabuffer.cxx 
b/sc/source/filter/oox/sharedformulabuffer.cxx
deleted file mode 100644
index 9646534..000
--- a/sc/source/filter/oox/sharedformulabuffer.cxx
+++ /dev/null
@@ -1,213 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- *
- * 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
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * http://www.openoffice.org/license.html
- * for a copy of the LGPLv3 License.
- *
- /
-
-#include com/sun/star/sheet/XFormulaTokens.hpp
-#include rtl/ustrbuf.hxx
-#include oox/helper/propertyset.hxx
-#include addressconverter.hxx
-#include biffinputstream.hxx
-#include formulaparser.hxx
-
-namespace oox {
-namespace xls {
-
-// 
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sheet;
-using namespace ::com::sun::star::table;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
-// 
-
-namespace {
-
-bool operator==( const CellAddress rAddr1, const CellAddress rAddr2 )
-{
-return
-(rAddr1.Sheet == rAddr2.Sheet) 
-(rAddr1.Column == rAddr2.Column) 
-(rAddr1.Row == rAddr2.Row);
-}
-
-bool lclContains( const CellRangeAddress rRange, const CellAddress rAddr )
-{
-return
-(rRange.Sheet == rAddr.Sheet) 
-(rRange.StartColumn = rAddr.Column)  (rAddr.Column = 
rRange.EndColumn) 
-(rRange.StartRow = rAddr.Row)  (rAddr.Row = rRange.EndRow);
-}
-
-} // namespace
-
-// 
-
-ExtCellFormulaContext::ExtCellFormulaContext( const WorksheetHelper rHelper,
-const Reference XFormulaTokens  rxTokens, const CellAddress 
rCellPos ) :
-SimpleFormulaContext( rxTokens, false, false ),
-WorksheetHelper( rHelper )
-{
-setBaseAddress( rCellPos );
-}
-
-void ExtCellFormulaContext::setSharedFormula( const CellAddress rBaseAddr )
-{
-getSharedFormulas().setSharedFormulaCell( *this, rBaseAddr );
-}
-
-// 
-
-SharedFormulaBuffer::SharedFormulaBuffer( const WorksheetHelper rHelper ) :
-WorksheetHelper( rHelper )
-{
-}
-
-void SharedFormulaBuffer::importSharedFmla( const OUString rFormula, const 
OUString rSharedRange, sal_Int32 nSharedId, const CellAddress rBaseAddr )
-{
-CellRangeAddress aFmlaRange;
-if( getAddressConverter().convertToCellRange( aFmlaRange, rSharedRange, 
getSheetIndex(), true, true ) )
-{
-// create the defined name representing the shared formula
-OSL_ENSURE( lclContains( aFmlaRange, rBaseAddr ), 
SharedFormulaBuffer::importSharedFmla - invalid range for shared formula );
-BinAddress aMapKey( nSharedId, 0 );
-Reference XNamedRange  xNamedRange = createDefinedName( aMapKey );
-// convert the formula definition
-Reference XFormulaTokens  xTokens( xNamedRange, UNO_QUERY );
-if( xTokens.is() )
-{
-SimpleFormulaContext aContext( xTokens, true, false );
-aContext.setBaseAddress( rBaseAddr );
-getFormulaParser().importFormula( aContext, rFormula );
-updateCachedCell( rBaseAddr, aMapKey );
-}
-}
-}
-
-void SharedFormulaBuffer::importSharedFmla( SequenceInputStream rStrm, const 
CellAddress rBaseAddr )
-{
-BinRange aRange;
-rStrm  aRange;
-CellRangeAddress aFmlaRange;
-if( getAddressConverter().convertToCellRange( 

[Libreoffice-commits] .: sc/source

2012-04-11 Thread Kohei Yoshida
 sc/source/ui/inc/tpformula.hxx |9 -
 1 file changed, 9 deletions(-)

New commits:
commit c510670e3cab5322ed82e5702f6f6e311c9823f6
Author: Albert Thuswaldner albert.thuswald...@gmail.com
Date:   Thu Apr 12 01:01:06 2012 +0200

removed unused includes in tpformula.hxx

diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index 033f61d..c547849 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -35,14 +35,6 @@
 #include vcl/edit.hxx
 #include vcl/button.hxx
 
-#include memory
-
-#include boost/shared_ptr.hpp
-
-class ScAppOptions;
-class SfxItemSet;
-class Window;
-
 class ScTpFormulaOptions : public SfxTabPage
 {
 public:
@@ -50,7 +42,6 @@ public:
 
 static  SfxTabPage* Create (Window* pParent, const SfxItemSet rCoreSet);
 
-//  static  USHORT* GetRanges();
 virtual sal_Bool FillItemSet(SfxItemSet rCoreSet);
 virtual void Reset( const SfxItemSet rCoreSet );
 virtual int DeactivatePage(SfxItemSet* pSet = NULL);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source tools/inc tools/source

2012-04-10 Thread Eike Rathke
 sc/source/filter/dif/difimp.cxx |   60 ++---
 sc/source/filter/inc/dif.hxx|5 -
 sc/source/ui/dbgui/asciiopt.cxx |   12 +--
 sc/source/ui/dbgui/csvgrid.cxx  |   25 +++
 sc/source/ui/dbgui/csvtablebox.cxx  |4 -
 sc/source/ui/dbgui/scuiasciiopt.cxx |4 -
 sc/source/ui/docshell/impex.cxx |  125 +---
 sc/source/ui/inc/asciiopt.hxx   |6 -
 sc/source/ui/inc/csvcontrol.hxx |2 
 sc/source/ui/inc/csvgrid.hxx|4 -
 sc/source/ui/inc/csvtablebox.hxx|2 
 sc/source/ui/inc/impex.hxx  |9 +-
 sc/source/ui/inc/scuiasciiopt.hxx   |4 -
 sc/source/ui/vba/vbarange.cxx   |6 -
 tools/inc/tools/stream.hxx  |   67 +--
 tools/source/stream/stream.cxx  |   51 ++
 16 files changed, 267 insertions(+), 119 deletions(-)

New commits:
commit 8cd05e9cf1152b21528c6f1a5bda3d949dc49791
Author: Eike Rathke er...@redhat.com
Date:   Tue Apr 10 18:30:07 2012 +0200

resolved fdo#48501 enable line size 64k in SvStream::Read*Line()

CSV and other text formats may come with line sizes 64k that so far were
truncated due to limitations in ByteString/UniString/String, even if one 
line
consists of several fields that each are 64k.

Introduced additional SvStream methods that read into rtl::OString and
rtl::OUString and let SvStream::ReadUniOrByteStringLine() fill solely an
rtl::OUString.

Made Calc CSV import use those.

diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index 19189a1..1ffae6a 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -312,7 +312,7 @@ TOPIC DifParser::GetNextTopic( void )
 };
 
 STATE   eS = S_START;
-String  aLine;
+rtl::OUString   aLine;
 
 nVector = 0;
 nVal = 0;
@@ -360,7 +360,7 @@ TOPIC DifParser::GetNextTopic( void )
 break;
 case S_VectorVal:
 {
-const sal_Unicode*  pCur = aLine.GetBuffer();
+const sal_Unicode*  pCur = aLine.getStr();
 
 pCur = ScanIntVal( pCur, nVector );
 
@@ -375,10 +375,11 @@ TOPIC DifParser::GetNextTopic( void )
 }
 break;
 case S_Data:
-OSL_ENSURE( aLine.Len() = 2,
+OSL_ENSURE( aLine.getLength() = 2,
 +GetNextTopic(): String ist zu kurz! );
-if( aLine.Len()  2 )
-aData = aLine.Copy( 1, aLine.Len() - 2 );
+OSL_ENSURE( aLine.getLength() - 2 = STRING_MAXLEN, 
GetNextTopic(): line doesn't fit into data);
+if( aLine.getLength()  2 )
+aData = aLine.copy( 1, aLine.getLength() - 2 );
 else
 aData.Erase();
 eS = S_END;
@@ -448,16 +449,16 @@ DATASET DifParser::GetNumberDataset( const sal_Unicode* 
pPossibleNumericData )
 return eRet;
 }
 
-bool DifParser::ReadNextLine( String rStr )
+bool DifParser::ReadNextLine( rtl::OUString rStr )
 {
-if( aLookAheadLine.Len() == 0 )
+if( aLookAheadLine.isEmpty() )
 {
 return rIn.ReadUniOrByteStringLine( rStr, rIn.GetStreamCharSet() );
 }
 else
 {
 rStr = aLookAheadLine;
-aLookAheadLine.Erase();
+aLookAheadLine = rtl::OUString();
 return true;
 }
 }
@@ -469,10 +470,10 @@ bool DifParser::LookAhead()
 const sal_Unicode* pAktBuffer;
 bool bValidStructure = false;
 
-OSL_ENSURE( aLookAheadLine.Len() == 0, *DifParser::LookAhead(): LookAhead 
called twice in a row );
+OSL_ENSURE( aLookAheadLine.isEmpty(), *DifParser::LookAhead(): LookAhead 
called twice in a row );
 rIn.ReadUniOrByteStringLine( aLookAheadLine, rIn.GetStreamCharSet() );
 
-pAktBuffer = aLookAheadLine.GetBuffer();
+pAktBuffer = aLookAheadLine.getStr();
 
 switch( *pAktBuffer )
 {
@@ -493,7 +494,7 @@ bool DifParser::LookAhead()
 }
 break;
 case '1':   // String Data
-if( Is1_0( aLookAheadLine.GetBuffer() ) )
+if( Is1_0( aLookAheadLine.getStr() ) )
 {
 bValidStructure = true;
 }
@@ -505,12 +506,12 @@ bool DifParser::LookAhead()
 DATASET DifParser::GetNextDataset( void )
 {
 DATASET eRet = D_UNKNOWN;
-String  aLine;
+rtl::OUString   aLine;
 const sal_Unicode*  pAktBuffer;
 
 ReadNextLine( aLine );
 
-pAktBuffer = aLine.GetBuffer();
+pAktBuffer = aLine.getStr();
 
 switch( *pAktBuffer )
 {
@@ -520,9 +521,9 @@ DATASET DifParser::GetNextDataset( void )
 if( Is1_0( pAktBuffer ) )
 {
 ReadNextLine( aLine );
-if( IsBOT( aLine.GetBuffer() ) )
+if( IsBOT( aLine.getStr() ) )
 eRet = 

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-09 Thread Julien Nabet
 sc/source/filter/inc/commentsbuffer.hxx   |2 --
 sc/source/filter/inc/condformatbuffer.hxx |2 --
 sc/source/filter/inc/stylesbuffer.hxx |2 --
 sc/source/filter/oox/commentsbuffer.cxx   |   29 -
 sc/source/filter/oox/condformatbuffer.cxx |5 -
 sc/source/filter/oox/stylesbuffer.cxx |   15 ---
 unusedcode.easy   |3 ---
 7 files changed, 58 deletions(-)

New commits:
commit b3e2cbc68f3501d3925f8789b1addc8ad4f8e9c0
Author: Julien Nabet serval2...@yahoo.fr
Date:   Mon Apr 9 11:37:16 2012 +0200

Dump other unused functions in oox

diff --git a/sc/source/filter/inc/commentsbuffer.hxx 
b/sc/source/filter/inc/commentsbuffer.hxx
index 81143a9..9827b82 100644
--- a/sc/source/filter/inc/commentsbuffer.hxx
+++ b/sc/source/filter/inc/commentsbuffer.hxx
@@ -73,8 +73,6 @@ public:
 voidimportCommentPr( const AttributeList rAttribs );
 /** Imports a cell comment from the passed stream of a COMMENT record. */
 voidimportComment( SequenceInputStream rStrm );
-/** Imports a cell comment from the passed stream of a NOTE record. */
-voidimportNote( BiffInputStream rStrm );
 
 /** Creates and returns a new rich-string object for the comment text. */
 RichStringRef   createText();
diff --git a/sc/source/filter/inc/condformatbuffer.hxx 
b/sc/source/filter/inc/condformatbuffer.hxx
index 393a9d0..e236375 100644
--- a/sc/source/filter/inc/condformatbuffer.hxx
+++ b/sc/source/filter/inc/condformatbuffer.hxx
@@ -168,8 +168,6 @@ public:
 CondFormatRef   importConditionalFormatting( const AttributeList 
rAttribs );
 /** Imports settings from the CONDFORMATTING record. */
 CondFormatRef   importCondFormatting( SequenceInputStream rStrm );
-/** Imports settings from the CFHEADER record. */
-voidimportCfHeader( BiffInputStream rStrm );
 
 /** Creates all conditional formatting in the Calc document. */
 voidfinalizeImport();
diff --git a/sc/source/filter/inc/stylesbuffer.hxx 
b/sc/source/filter/inc/stylesbuffer.hxx
index 22af2be..409af4d 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -148,8 +148,6 @@ public:
 voidimportPaletteColor( const AttributeList rAttribs );
 /** Appends a new color from the passed RGBCOLOR record. */
 voidimportPaletteColor( SequenceInputStream rStrm );
-/** Imports the PALETTE record from the passed stream. */
-voidimportPalette( BiffInputStream rStrm );
 
 /** Rturns the RGB value of the color with the passed index. */
 sal_Int32   getColor( sal_Int32 nPaletteIdx ) const;
diff --git a/sc/source/filter/oox/commentsbuffer.cxx 
b/sc/source/filter/oox/commentsbuffer.cxx
index a1bef7d..0ea4ca2 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -145,35 +145,6 @@ void Comment::importComment( SequenceInputStream rStrm )
 getAddressConverter().convertToCellRangeUnchecked( maModel.maRange, 
aBinRange, getSheetIndex() );
 }
 
-void Comment::importNote( BiffInputStream rStrm )
-{
-BinAddress aBinAddr;
-rStrm  aBinAddr;
-// cell range will be checked while inserting the comment into the document
-getAddressConverter().convertToCellRangeUnchecked( maModel.maRange, 
BinRange( aBinAddr ), getSheetIndex() );
-
-// remaining record data is BIFF dependent
-switch( getBiff() )
-{
-case BIFF2:
-case BIFF3:
-importNoteBiff2( rStrm );
-break;
-case BIFF4:
-case BIFF5:
-importNoteBiff2( rStrm );
-// in BIFF4 and BIFF5, comments can have an associated sound
-if( (rStrm.getNextRecId() == BIFF_ID_NOTESOUND)  
rStrm.startNextRecord() )
-importNoteSound( rStrm );
-break;
-case BIFF8:
-importNoteBiff8( rStrm );
-break;
-case BIFF_UNKNOWN:
-break;
-}
-}
-
 RichStringRef Comment::createText()
 {
 maModel.mxText.reset( new RichString( *this ) );
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index b10210f..2985a8f 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -735,11 +735,6 @@ CondFormatRef CondFormatBuffer::importCondFormatting( 
SequenceInputStream rStrm
 return xCondFmt;
 }
 
-void CondFormatBuffer::importCfHeader( BiffInputStream rStrm )
-{
-createCondFormat()-importCfHeader( rStrm );
-}
-
 void CondFormatBuffer::finalizeImport()
 {
 maCondFormats.forEachMem( CondFormat::finalizeImport );
diff --git a/sc/source/filter/oox/stylesbuffer.cxx 
b/sc/source/filter/oox/stylesbuffer.cxx
index 11a5608..26b146a 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ 

[Libreoffice-commits] .: sc/source sd/source unusedcode.easy

2012-04-09 Thread Julien Nabet
 sc/source/filter/inc/numberformatsbuffer.hxx   |2 
 sc/source/filter/inc/pivotcachebuffer.hxx  |2 
 sc/source/filter/inc/scenariobuffer.hxx|2 
 sc/source/filter/inc/stylesbuffer.hxx  |5 
 sc/source/filter/oox/numberformatsbuffer.cxx   |   28 ---
 sc/source/filter/oox/pivotcachebuffer.cxx  |   30 ---
 sc/source/filter/oox/scenariobuffer.cxx|   11 -
 sc/source/filter/oox/stylesbuffer.cxx  |  152 -
 sd/source/ui/inc/View.hxx  |2 
 sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx |   37 
 sd/source/ui/slidesorter/cache/SlsGenericPageCache.hxx |6 
 sd/source/ui/view/sdview4.cxx  |   53 -
 unusedcode.easy|6 
 13 files changed, 336 deletions(-)

New commits:
commit b42c792f50ed11a3efc9c20a4e7eed5163fdaed7
Author: Julien Nabet serval2...@yahoo.fr
Date:   Mon Apr 9 13:00:31 2012 +0200

Remove some unused methods

diff --git a/sc/source/filter/inc/numberformatsbuffer.hxx 
b/sc/source/filter/inc/numberformatsbuffer.hxx
index 6df9586..ac9a63b 100644
--- a/sc/source/filter/inc/numberformatsbuffer.hxx
+++ b/sc/source/filter/inc/numberformatsbuffer.hxx
@@ -111,8 +111,6 @@ public:
 NumberFormatRef importNumFmt( const AttributeList rAttribs );
 /** Inserts a new number format code from a NUMFMT record. */
 voidimportNumFmt( SequenceInputStream rStrm );
-/** Inserts a new number format code from a FORMAT record. */
-voidimportFormat( BiffInputStream rStrm );
 
 /** Final processing after import of all style settings. */
 voidfinalizeImport();
diff --git a/sc/source/filter/inc/pivotcachebuffer.hxx 
b/sc/source/filter/inc/pivotcachebuffer.hxx
index 7e7c16f..2fd32fe 100644
--- a/sc/source/filter/inc/pivotcachebuffer.hxx
+++ b/sc/source/filter/inc/pivotcachebuffer.hxx
@@ -414,8 +414,6 @@ public:
 /** Reads sheet source settings from the PCDSHEETSOURCE record. */
 voidimportPCDSheetSource( SequenceInputStream rStrm, 
const ::oox::core::Relations rRelations );
 
-/** Reads cache source settings from the PCDSOURCE record. */
-voidimportPCDSource( BiffInputStream rStrm );
 /** Reads pivot cache global settings from the PCDEFINITION record. */
 voidimportPCDefinition( BiffInputStream rStrm );
 
diff --git a/sc/source/filter/inc/scenariobuffer.hxx 
b/sc/source/filter/inc/scenariobuffer.hxx
index dc996c7..4205d8b 100644
--- a/sc/source/filter/inc/scenariobuffer.hxx
+++ b/sc/source/filter/inc/scenariobuffer.hxx
@@ -114,8 +114,6 @@ public:
 voidimportScenarios( const AttributeList rAttribs );
 /** Imports sheet scenario settings from a SCENARIOS record. */
 voidimportScenarios( SequenceInputStream rStrm );
-/** Imports sheet scenario settings from a SCENARIOS record. */
-voidimportScenarios( BiffInputStream rStrm );
 
 /** Creates and returns a new scenario in this collection. */
 Scenario   createScenario();
diff --git a/sc/source/filter/inc/stylesbuffer.hxx 
b/sc/source/filter/inc/stylesbuffer.hxx
index 409af4d..07f2a7a 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -280,8 +280,6 @@ public:
 /** Imports a font style flag from a DXF record. */
 voidimportDxfFlag( sal_Int32 nElement, 
SequenceInputStream rStrm );
 
-/** Imports the FONT record from the passed stream. */
-voidimportFont( BiffInputStream rStrm );
 /** Imports the FONTCOLOR record from the passed stream. */
 voidimportFontColor( BiffInputStream rStrm );
 /** Sets the font attributes from the font block of a CFRULE record. */
@@ -783,9 +781,6 @@ public:
 /** Imports the XF record from the passed stream. */
 voidimportXf( SequenceInputStream rStrm, bool bCellXf );
 
-/** Imports the XF record from the passed stream. */
-voidimportXf( BiffInputStream rStrm );
-
 /** Final processing after import of all style settings. */
 voidfinalizeImport();
 
diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx 
b/sc/source/filter/oox/numberformatsbuffer.cxx
index 1eab9e5..5133a91 100644
--- a/sc/source/filter/oox/numberformatsbuffer.cxx
+++ b/sc/source/filter/oox/numberformatsbuffer.cxx
@@ -2019,34 +2019,6 @@ void NumberFormatsBuffer::importNumFmt( 
SequenceInputStream rStrm )
 createNumFmt( nNumFmtId, aFmtCode );
 }
 
-void NumberFormatsBuffer::importFormat( BiffInputStream rStrm )
-{
-OUString aFmtCode;
-switch( getBiff() )
-{
-case BIFF2:
-case BIFF3:
-aFmtCode = rStrm.readByteStringUC( false, getTextEncoding() );
-break;
-case BIFF4:
- 

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-09 Thread Julien Nabet
 sc/source/filter/inc/biffinputstream.hxx|3 
 sc/source/filter/inc/excelhandlers.hxx  |   12 
 sc/source/filter/inc/pivottablefragment.hxx |   15 
 sc/source/filter/inc/querytablefragment.hxx |   14 
 sc/source/filter/inc/sheetdatacontext.hxx   |   57 ---
 sc/source/filter/inc/workbookhelper.hxx |2 
 sc/source/filter/oox/biffinputstream.cxx|5 
 sc/source/filter/oox/excelhandlers.cxx  |6 
 sc/source/filter/oox/pivottablefragment.cxx |   22 -
 sc/source/filter/oox/querytablefragment.cxx |   17 -
 sc/source/filter/oox/sheetdatacontext.cxx   |  429 
 sc/source/filter/oox/workbookhelper.cxx |   59 ---
 unusedcode.easy |9 
 13 files changed, 650 deletions(-)

New commits:
commit 26398f9dbf7134f79993f2f8258613124ac2483b
Author: Julien Nabet serval2...@yahoo.fr
Date:   Mon Apr 9 13:34:35 2012 +0200

cleaning in oox part

diff --git a/sc/source/filter/inc/biffinputstream.hxx 
b/sc/source/filter/inc/biffinputstream.hxx
index 47ee2b0..dd931dd 100644
--- a/sc/source/filter/inc/biffinputstream.hxx
+++ b/sc/source/filter/inc/biffinputstream.hxx
@@ -227,9 +227,6 @@ public:
 /** Closes the input stream but not the wrapped stream. */
 virtual voidclose();
 
-/** Returns the absolute position in the wrapped binary stream. */
-sal_Int64   tellBase() const;
-
 // BinaryInputStream interface (stream read access) ---
 
 /** Reads nBytes bytes to the passed sequence.
diff --git a/sc/source/filter/inc/excelhandlers.hxx 
b/sc/source/filter/inc/excelhandlers.hxx
index 2051a55..56e47fd 100644
--- a/sc/source/filter/inc/excelhandlers.hxx
+++ b/sc/source/filter/inc/excelhandlers.hxx
@@ -205,18 +205,6 @@ protected:
 
 // 
 
-/** Fragment handler derived from the WorksheetHelper helper class.
-
-Used to import sheet fragments.
- */
-class BiffWorksheetFragmentBase : public BiffFragmentHandler, public 
WorksheetHelper
-{
-protected:
-explicitBiffWorksheetFragmentBase(
-const WorksheetHelper rHelper,
-const BiffWorkbookFragmentBase rParent );
-};
-
 } // namespace xls
 } // namespace oox
 
diff --git a/sc/source/filter/inc/pivottablefragment.hxx 
b/sc/source/filter/inc/pivottablefragment.hxx
index 5053c72..6e09312 100644
--- a/sc/source/filter/inc/pivottablefragment.hxx
+++ b/sc/source/filter/inc/pivottablefragment.hxx
@@ -96,21 +96,6 @@ private:
 };
 
 // 
-// 
-
-class BiffPivotTableContext : public BiffWorksheetContextBase
-{
-public:
-explicitBiffPivotTableContext( const WorksheetHelper rHelper 
);
-
-/** Imports all records related to the current pivot table. */
-virtual voidimportRecord( BiffInputStream rStrm );
-
-private:
-PivotTable mrPivotTable;
-};
-
-// 
 
 } // namespace xls
 } // namespace oox
diff --git a/sc/source/filter/inc/querytablefragment.hxx 
b/sc/source/filter/inc/querytablefragment.hxx
index 5609eb0..5a01a04 100644
--- a/sc/source/filter/inc/querytablefragment.hxx
+++ b/sc/source/filter/inc/querytablefragment.hxx
@@ -57,20 +57,6 @@ private:
 
 // 
 
-class BiffQueryTableContext : public BiffWorksheetContextBase
-{
-public:
-explicitBiffQueryTableContext( const WorksheetHelper rHelper 
);
-
-/** Imports all records related to the current query table. */
-virtual voidimportRecord( BiffInputStream rStrm );
-
-private:
-QueryTable mrQueryTable;
-};
-
-// 
-
 } // namespace xls
 } // namespace oox
 
diff --git a/sc/source/filter/inc/sheetdatacontext.hxx 
b/sc/source/filter/inc/sheetdatacontext.hxx
index 324b12a..05c8768 100644
--- a/sc/source/filter/inc/sheetdatacontext.hxx
+++ b/sc/source/filter/inc/sheetdatacontext.hxx
@@ -130,63 +130,6 @@ private:
 
 // 
 
-/** This class implements importing row settings and all cells of a sheet.
- */
-class BiffSheetDataContext : public BiffWorksheetContextBase, private 
SheetDataContextBase
-{
-public:
-explicitBiffSheetDataContext( const WorksheetHelper rHelper );
-
-/** Tries to import a sheet data record. */
-virtual voidimportRecord( BiffInputStream rStrm );
-
-private:
-/** Imports row settings from a ROW record. */
-voidimportRow( BiffInputStream rStrm );
-
-/** Reads an XF identifier and initializes a new cell. */
-boolreadCellXfId( BiffInputStream 

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-08 Thread Julien Nabet
 sc/source/filter/inc/viewsettings.hxx |9 --
 sc/source/filter/oox/viewsettings.cxx |  109 --
 unusedcode.easy   |4 -
 3 files changed, 122 deletions(-)

New commits:
commit ade4aac3dcaa29872f0f8a81e5e332f5566faddf
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Apr 8 13:33:05 2012 +0200

Clean oox::xls::SheetViewSettings

diff --git a/sc/source/filter/inc/viewsettings.hxx 
b/sc/source/filter/inc/viewsettings.hxx
index dde5451..c5a7f93 100644
--- a/sc/source/filter/inc/viewsettings.hxx
+++ b/sc/source/filter/inc/viewsettings.hxx
@@ -127,15 +127,6 @@ public:
 /** Imports the CHARTSHEETVIEW record containing view settings of a chart 
sheet. */
 voidimportChartSheetView( SequenceInputStream rStrm );
 
-/** Imports the WINDOW2 record containing sheet view settings. */
-voidimportWindow2( BiffInputStream rStrm );
-/** Imports the PANE record containing sheet pane settings. */
-voidimportPane( BiffInputStream rStrm );
-/** Imports the SCL record containing sheet zoom settings. */
-voidimportScl( BiffInputStream rStrm );
-/** Imports the SELECTION record containing selection settings for a pane. 
*/
-voidimportSelection( BiffInputStream rStrm );
-
 /** Converts all imported sheet view settings. */
 voidfinalizeImport();
 
diff --git a/sc/source/filter/oox/viewsettings.cxx 
b/sc/source/filter/oox/viewsettings.cxx
index 10e9f9f..3503011 100644
--- a/sc/source/filter/oox/viewsettings.cxx
+++ b/sc/source/filter/oox/viewsettings.cxx
@@ -364,115 +364,6 @@ void SheetViewSettings::importChartSheetView( 
SequenceInputStream rStrm )
 rModel.mbZoomToFit = getFlag( nFlags, BIFF12_CHARTSHEETVIEW_ZOOMTOFIT );
 }
 
-void SheetViewSettings::importWindow2( BiffInputStream rStrm )
-{
-OSL_ENSURE( maSheetViews.empty(), SheetViewSettings::importWindow2 - 
multiple WINDOW2 records );
-SheetViewModel rModel = *createSheetView();
-if( getBiff() == BIFF2 )
-{
-rModel.mbShowFormulas = rStrm.readuInt8() != 0;
-rModel.mbShowGrid = rStrm.readuInt8() != 0;
-rModel.mbShowHeadings = rStrm.readuInt8() != 0;
-rModel.mnPaneState = (rStrm.readuInt8() == 0) ? XML_split : XML_frozen;
-rModel.mbShowZeros = rStrm.readuInt8() != 0;
-BinAddress aFirstPos;
-rStrm  aFirstPos;
-rModel.maFirstPos = getAddressConverter().createValidCellAddress( 
aFirstPos, getSheetIndex(), false );
-rModel.mbDefGridColor = rStrm.readuInt8() != 0;
-rModel.maGridColor.importColorRgb( rStrm );
-}
-else
-{
-sal_uInt16 nFlags;
-BinAddress aFirstPos;
-rStrm  nFlags  aFirstPos;
-
-rModel.maFirstPos = getAddressConverter().createValidCellAddress( 
aFirstPos, getSheetIndex(), false );
-rModel.mnPaneState= getFlagValue( nFlags, BIFF_WINDOW2_FROZEN, 
getFlagValue( nFlags, BIFF_WINDOW2_FROZENNOSPLIT, XML_frozen, XML_frozenSplit 
), XML_split );
-rModel.mbSelected = getFlag( nFlags, BIFF_WINDOW2_SELECTED );
-rModel.mbRightToLeft  = getFlag( nFlags, BIFF_WINDOW2_RIGHTTOLEFT );
-rModel.mbDefGridColor = getFlag( nFlags, BIFF_WINDOW2_DEFGRIDCOLOR );
-rModel.mbShowFormulas = getFlag( nFlags, BIFF_WINDOW2_SHOWFORMULAS );
-rModel.mbShowGrid = getFlag( nFlags, BIFF_WINDOW2_SHOWGRID );
-rModel.mbShowHeadings = getFlag( nFlags, BIFF_WINDOW2_SHOWHEADINGS );
-rModel.mbShowZeros= getFlag( nFlags, BIFF_WINDOW2_SHOWZEROS );
-rModel.mbShowOutline  = getFlag( nFlags, BIFF_WINDOW2_SHOWOUTLINE );
-
-if( getBiff() == BIFF8 )
-{
-rModel.mnViewType = getFlagValue( nFlags, 
BIFF_WINDOW2_PAGEBREAKMODE, XML_pageBreakPreview, XML_normal );
-
-rModel.maGridColor.importColorId( rStrm );
-// zoom data not included in chart sheets
-if( (getSheetType() != SHEETTYPE_CHARTSHEET)  
(rStrm.getRemaining() = 6) )
-{
-rStrm.skip( 2 );
-sal_uInt16 nPageZoom, nNormalZoom;
-rStrm  nPageZoom  nNormalZoom;
-rModel.mnSheetLayoutZoom = nPageZoom;
-rModel.mnNormalZoom = nNormalZoom;
-}
-}
-else
-{
-rModel.maGridColor.importColorRgb( rStrm );
-}
-}
-}
-
-void SheetViewSettings::importPane( BiffInputStream rStrm )
-{
-OSL_ENSURE( !maSheetViews.empty(), SheetViewSettings::importPane - 
missing leading WINDOW2 record );
-if( !maSheetViews.empty() )
-{
-sal_uInt8 nActivePaneId;
-sal_uInt16 nSplitX, nSplitY;
-BinAddress aSecondPos;
-rStrm  nSplitX  nSplitY  aSecondPos  nActivePaneId;
-
-SheetViewModel rModel = *maSheetViews.back();
-rModel.mfSplitX = nSplitX;
-rModel.mfSplitY = nSplitY;
-rModel.maSecondPos = 

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-08 Thread Julien Nabet
 sc/source/filter/inc/workbooksettings.hxx |   14 ---
 sc/source/filter/oox/workbooksettings.cxx |   38 --
 unusedcode.easy   |7 -
 3 files changed, 59 deletions(-)

New commits:
commit 2283607f49146c8b1e6dd618d5fa1f89f7804797
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Apr 8 13:59:17 2012 +0200

Clean oox::xls::WorkbookSettings

diff --git a/sc/source/filter/inc/workbooksettings.hxx 
b/sc/source/filter/inc/workbooksettings.hxx
index 07683d4..ed47d54 100644
--- a/sc/source/filter/inc/workbooksettings.hxx
+++ b/sc/source/filter/inc/workbooksettings.hxx
@@ -111,20 +111,6 @@ public:
 
 /** Sets the save external linked values flag, e.g. from the WSBOOL 
record. */
 voidsetSaveExtLinkValues( bool bSaveExtLinks );
-/** Imports the CALCCOUNT record. */
-voidimportCalcCount( BiffInputStream rStrm );
-/** Imports the CALCMODE record. */
-voidimportCalcMode( BiffInputStream rStrm );
-/** Imports the DELTA record. */
-voidimportDelta( BiffInputStream rStrm );
-/** Imports the ITERATION record. */
-voidimportIteration( BiffInputStream rStrm );
-/** Imports the REFMODE record. */
-voidimportRefMode( BiffInputStream rStrm );
-/** Imports the SAVERECALC record. */
-voidimportSaveRecalc( BiffInputStream rStrm );
-/** Imports the UNCALCED record. */
-voidimportUncalced( BiffInputStream rStrm );
 
 /** Converts the imported workbook settings. */
 voidfinalizeImport();
diff --git a/sc/source/filter/oox/workbooksettings.cxx 
b/sc/source/filter/oox/workbooksettings.cxx
index 0bdbf41..5d0048f 100644
--- a/sc/source/filter/oox/workbooksettings.cxx
+++ b/sc/source/filter/oox/workbooksettings.cxx
@@ -195,44 +195,6 @@ void WorkbookSettings::setSaveExtLinkValues( bool 
bSaveExtLinks )
 maBookSettings.mbSaveExtLinkValues = bSaveExtLinks;
 }
 
-void WorkbookSettings::importCalcCount( BiffInputStream rStrm )
-{
-maCalcSettings.mnIterateCount = rStrm.readuInt16();
-}
-
-void WorkbookSettings::importCalcMode( BiffInputStream rStrm )
-{
-sal_Int16 nCalcMode = rStrm.readInt16() + 1;
-static const sal_Int32 spnCalcModes[] = { XML_autoNoTable, XML_manual, 
XML_auto };
-maCalcSettings.mnCalcMode = STATIC_ARRAY_SELECT( spnCalcModes, nCalcMode, 
XML_auto );
-}
-
-void WorkbookSettings::importDelta( BiffInputStream rStrm )
-{
-rStrm  maCalcSettings.mfIterateDelta;
-}
-
-void WorkbookSettings::importIteration( BiffInputStream rStrm )
-{
-maCalcSettings.mbIterate = rStrm.readuInt16() != 0;
-}
-
-void WorkbookSettings::importRefMode( BiffInputStream rStrm )
-{
-maCalcSettings.mnRefMode = (rStrm.readuInt16() == 0) ? XML_R1C1 : XML_A1;
-}
-
-void WorkbookSettings::importSaveRecalc( BiffInputStream rStrm )
-{
-maCalcSettings.mbCalcOnSave = rStrm.readuInt16() != 0;
-}
-
-void WorkbookSettings::importUncalced( BiffInputStream )
-{
-// existence of this record indicates incomplete recalc
-maCalcSettings.mbCalcCompleted = false;
-}
-
 void WorkbookSettings::finalizeImport()
 {
 // default settings
diff --git a/unusedcode.easy b/unusedcode.easy
index 4fc0cb6..eb7fa0a 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -819,13 +819,6 @@ oox::xls::WorkbookGlobals::createBuffersPerSheet(short)
 oox::xls::WorkbookGlobals::setCodePage(unsigned short)
 oox::xls::WorkbookGlobals::setIsWorkbookFile()
 oox::xls::WorkbookHelper::setAppFontEncoding(unsigned short)
-oox::xls::WorkbookSettings::importCalcCount(oox::xls::BiffInputStream)
-oox::xls::WorkbookSettings::importCalcMode(oox::xls::BiffInputStream)
-oox::xls::WorkbookSettings::importDelta(oox::xls::BiffInputStream)
-oox::xls::WorkbookSettings::importIteration(oox::xls::BiffInputStream)
-oox::xls::WorkbookSettings::importRefMode(oox::xls::BiffInputStream)
-oox::xls::WorkbookSettings::importSaveRecalc(oox::xls::BiffInputStream)
-oox::xls::WorkbookSettings::importUncalced(oox::xls::BiffInputStream)
 oox::xls::WorksheetHelper::getBiffDrawing() const
 oox::xls::WorksheetHelper::setDefaultColumnFormat(int, int, int)
 oox::xls::WorksheetHelper::setLabelRanges(oox::xls::ApiCellRangeList const, 
oox::xls::ApiCellRangeList const)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-08 Thread Caolán McNamara
 sc/source/filter/inc/richstring.hxx   |2 
 sc/source/filter/inc/workbooksettings.hxx |3 -
 sc/source/filter/inc/worksheethelper.hxx  |8 ---
 sc/source/filter/oox/richstring.cxx   |9 
 sc/source/filter/oox/workbooksettings.cxx |5 --
 sc/source/filter/oox/worksheethelper.cxx  |   67 --
 unusedcode.easy   |3 -
 7 files changed, 97 deletions(-)

New commits:
commit b68c42fd68760cbce0a0ca4ac81d4aeaf777e7fa
Author: Caolán McNamara caol...@redhat.com
Date:   Sun Apr 8 16:29:57 2012 +0100

callcatcher: reduce WorksheetHelper

diff --git a/sc/source/filter/inc/richstring.hxx 
b/sc/source/filter/inc/richstring.hxx
index 588deae..07a645a 100644
--- a/sc/source/filter/inc/richstring.hxx
+++ b/sc/source/filter/inc/richstring.hxx
@@ -164,8 +164,6 @@ public:
 voidimportPhoneticPr( const AttributeList rAttribs );
 /** Imports phonetic settings from the PHONETICPR record. */
 voidimportPhoneticPr( SequenceInputStream rStrm );
-/** Imports phonetic settings from the PHONETICPR record. */
-voidimportPhoneticPr( BiffInputStream rStrm );
 
 /** Imports phonetic settings from a rich string. */
 voidimportStringData( SequenceInputStream rStrm );
diff --git a/sc/source/filter/inc/workbooksettings.hxx 
b/sc/source/filter/inc/workbooksettings.hxx
index ed47d54..2346708 100644
--- a/sc/source/filter/inc/workbooksettings.hxx
+++ b/sc/source/filter/inc/workbooksettings.hxx
@@ -109,9 +109,6 @@ public:
 /** Imports the CALCPR record containing workbook calculation settings. */
 voidimportCalcPr( SequenceInputStream rStrm );
 
-/** Sets the save external linked values flag, e.g. from the WSBOOL 
record. */
-voidsetSaveExtLinkValues( bool bSaveExtLinks );
-
 /** Converts the imported workbook settings. */
 voidfinalizeImport();
 
diff --git a/sc/source/filter/inc/worksheethelper.hxx 
b/sc/source/filter/inc/worksheethelper.hxx
index facb12e..93d8089 100644
--- a/sc/source/filter/inc/worksheethelper.hxx
+++ b/sc/source/filter/inc/worksheethelper.hxx
@@ -248,19 +248,13 @@ public:
 SheetViewSettings  getSheetViewSettings() const;
 /** Returns the VML drawing page for this sheet (OOXML/BIFF12 only). */
 VmlDrawing getVmlDrawing() const;
-/** Returns the BIFF drawing page for this sheet (BIFF2-BIFF8 only). */
-BiffSheetDrawing   getBiffDrawing() const;
 
-/** Changes the current sheet type. */
-voidsetSheetType( WorksheetType eSheetType );
 /** Sets a column or row page break described in the passed struct. */
 voidsetPageBreak( const PageBreakModel rModel, bool 
bRowBreak );
 /** Inserts the hyperlink URL into the spreadsheet. */
 voidsetHyperlink( const HyperlinkModel rModel );
 /** Inserts the data validation settings into the spreadsheet. */
 voidsetValidation( const ValidationModel rModel );
-/** Sets the passed label ranges to the current sheet. */
-voidsetLabelRanges( const ApiCellRangeList rColRanges, 
const ApiCellRangeList rRowRanges );
 /** Sets the path to the DrawingML fragment of this sheet. */
 voidsetDrawingPath( const ::rtl::OUString rDrawingPath );
 /** Sets the path to the legacy VML drawing fragment of this sheet. */
@@ -279,8 +273,6 @@ public:
 /** Sets default width for all columns. This function overrides the base
 width set with the setBaseColumnWidth() function. */
 voidsetDefaultColumnWidth( double fWidth );
-/** Converts default cell formatting for a range of columns. */
-voidsetDefaultColumnFormat( sal_Int32 nFirstCol, sal_Int32 
nLastCol, sal_Int32 nXfId );
 /** Sets column settings for a specific range of columns.
 @descr  Column default formatting is converted directly, other settings
 are cached and converted in the finalizeWorksheetImport() call. */
diff --git a/sc/source/filter/oox/richstring.cxx 
b/sc/source/filter/oox/richstring.cxx
index 28c0d0c..823d9de 100644
--- a/sc/source/filter/oox/richstring.cxx
+++ b/sc/source/filter/oox/richstring.cxx
@@ -251,15 +251,6 @@ void PhoneticSettings::importPhoneticPr( 
SequenceInputStream rStrm )
 maModel.setBiffData( nType, nAlignment );
 }
 
-void PhoneticSettings::importPhoneticPr( BiffInputStream rStrm )
-{
-sal_uInt16 nFontId, nFlags;
-rStrm  nFontId  nFlags;
-maModel.mnFontId = nFontId;
-maModel.setBiffData( extractValue sal_Int32 ( nFlags, 0, 2 ), 
extractValue sal_Int32 ( nFlags, 2, 2 ) );
-// following: range list with cells showing phonetic text
-}
-
 void PhoneticSettings::importStringData( SequenceInputStream rStrm )
 {
 sal_uInt16 nFontId, nFlags;
diff --git a/sc/source/filter/oox/workbooksettings.cxx 

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-08 Thread Julien Nabet
 sc/source/filter/inc/autofiltercontext.hxx|   15 --
 sc/source/filter/inc/biffcodec.hxx|3 
 sc/source/filter/inc/drawingmanager.hxx   |2 
 sc/source/filter/inc/externallinkfragment.hxx |   28 
 sc/source/filter/oox/autofiltercontext.cxx|   17 --
 sc/source/filter/oox/biffcodec.cxx|8 -
 sc/source/filter/oox/drawingmanager.cxx   |   37 -
 sc/source/filter/oox/externallinkfragment.cxx |  172 --
 unusedcode.easy   |4 
 9 files changed, 286 deletions(-)

New commits:
commit 6266d51db89429f16d4e4bc4ccb4c896096cda90
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Apr 8 19:18:42 2012 +0200

Keep on cleaning oox

diff --git a/sc/source/filter/inc/autofiltercontext.hxx 
b/sc/source/filter/inc/autofiltercontext.hxx
index 6583fd3..e10f24e 100644
--- a/sc/source/filter/inc/autofiltercontext.hxx
+++ b/sc/source/filter/inc/autofiltercontext.hxx
@@ -94,21 +94,6 @@ private:
 
 // 
 
-class BiffAutoFilterContext : public BiffWorksheetContextBase
-{
-public:
-explicitBiffAutoFilterContext( const WorksheetHelper rHelper, 
AutoFilter rAutoFilter );
-
-protected:
-/** Imports all records related to the current auto filter. */
-virtual voidimportRecord( BiffInputStream rStrm );
-
-private:
-AutoFilter mrAutoFilter;
-};
-
-// 
-
 } // namespace xls
 } // namespace oox
 
diff --git a/sc/source/filter/inc/biffcodec.hxx 
b/sc/source/filter/inc/biffcodec.hxx
index 672a816..704df9f 100644
--- a/sc/source/filter/inc/biffcodec.hxx
+++ b/sc/source/filter/inc/biffcodec.hxx
@@ -168,9 +168,6 @@ class BiffCodecHelper : public WorkbookHelper
 public:
 explicitBiffCodecHelper( const WorkbookHelper rHelper );
 
-/** Implementation helper, reads the FILEPASS and returns a decoder 
object. */
-static BiffDecoderRef implReadFilePass( BiffInputStream rStrm, BiffType 
eBiff );
-
 /** Clones the contained decoder object if existing and sets it at the 
passed stream. */
 voidcloneDecoder( BiffInputStream rStrm );
 
diff --git a/sc/source/filter/inc/drawingmanager.hxx 
b/sc/source/filter/inc/drawingmanager.hxx
index b80d79f..6a713e0 100644
--- a/sc/source/filter/inc/drawingmanager.hxx
+++ b/sc/source/filter/inc/drawingmanager.hxx
@@ -422,8 +422,6 @@ public:
 explicitBiffDrawingBase( const WorksheetHelper rHelper,
 const ::com::sun::star::uno::Reference 
::com::sun::star::drawing::XDrawPage  rxDrawPage );
 
-/** Imports a plain OBJ record (without leading DFF data). */
-voidimportObj( BiffInputStream rStrm );
 /** Sets the object with the passed identifier to be skipped on import. */
 voidsetSkipObj( sal_uInt16 nObjId );
 
diff --git a/sc/source/filter/inc/externallinkfragment.hxx 
b/sc/source/filter/inc/externallinkfragment.hxx
index 8324f4f..3c90791 100644
--- a/sc/source/filter/inc/externallinkfragment.hxx
+++ b/sc/source/filter/inc/externallinkfragment.hxx
@@ -113,34 +113,6 @@ private:
 };
 
 // 
-// 
-
-class BiffExternalSheetDataContext : public BiffWorkbookContextBase
-{
-public:
-explicitBiffExternalSheetDataContext( const WorkbookHelper 
rHelper, bool bImportDefNames );
-virtual ~BiffExternalSheetDataContext();
-
-/** Tries to import a record related to external links and defined names. 
*/
-virtual voidimportRecord( BiffInputStream rStrm );
-
-private:
-voidimportExternSheet( BiffInputStream rStrm );
-voidimportExternalBook( BiffInputStream rStrm );
-voidimportExternalName( BiffInputStream rStrm );
-voidimportXct( BiffInputStream rStrm );
-voidimportCrn( BiffInputStream rStrm );
-voidimportDefinedName( BiffInputStream rStrm );
-
-/** Sets the passed cell value to the passed position in the sheet cache. 
*/
-voidsetCellValue( const BinAddress rBinAddr, const 
::com::sun::star::uno::Any rValue );
-
-private:
-ExternalLinkRef mxExtLink;  /// Current external link.
-::com::sun::star::uno::Reference 
::com::sun::star::sheet::XExternalSheetCache 
-mxSheetCache;   /// The sheet cache used to 
store external cell values.
-boolmbImportDefNames;
-};
 
 } // namespace xls
 } // namespace oox
diff --git a/sc/source/filter/oox/autofiltercontext.cxx 
b/sc/source/filter/oox/autofiltercontext.cxx
index c58cb4d..52f6f0a 100644
--- a/sc/source/filter/oox/autofiltercontext.cxx
+++ 

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-07 Thread Julien Nabet
 sc/source/filter/inc/worksheetsettings.hxx |   19 --
 sc/source/filter/oox/worksheetsettings.cxx |   82 -
 unusedcode.easy|9 ---
 3 files changed, 110 deletions(-)

New commits:
commit b63afcd27df0eb7123782b7d80bc0963df9fedb9
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Apr 7 23:14:32 2012 +0200

Clean oox::xls::WorksheetSettings

diff --git a/sc/source/filter/inc/worksheetsettings.hxx 
b/sc/source/filter/inc/worksheetsettings.hxx
index 175c61d..26e8019 100644
--- a/sc/source/filter/inc/worksheetsettings.hxx
+++ b/sc/source/filter/inc/worksheetsettings.hxx
@@ -109,25 +109,6 @@ public:
 /** Imports phonetic settings from the PHONETICPR record. */
 voidimportPhoneticPr( SequenceInputStream rStrm );
 
-/** Imports sheet properties from a SHEETEXT record. */
-voidimportSheetExt( BiffInputStream rStrm );
-/** Imports sheet properties from a SHEETPR record. */
-voidimportSheetPr( BiffInputStream rStrm );
-/** Imports protection status from the PROTECT record. */
-voidimportProtect( BiffInputStream rStrm );
-/** Imports object protection status from the OBJECTPROTECT record. */
-voidimportObjectProtect( BiffInputStream rStrm );
-/** Imports scenario protection status from the SCENPROTECT record. */
-voidimportScenProtect( BiffInputStream rStrm );
-/** Imports sheet password hash from the PASSWORD record. */
-voidimportPassword( BiffInputStream rStrm );
-/** Imports protection settings from the SHEETPROTECTION record. */
-voidimportSheetProtection( BiffInputStream rStrm );
-/** Imports the VBA code module name from the CODENAME record. */
-voidimportCodeName( BiffInputStream rStrm );
-/** Imports phonetic settings from the PHONETICPR record. */
-voidimportPhoneticPr( BiffInputStream rStrm );
-
 /** Converts the imported worksheet settings. */
 voidfinalizeImport();
 
diff --git a/sc/source/filter/oox/worksheetsettings.cxx 
b/sc/source/filter/oox/worksheetsettings.cxx
index 768041b..3010aec 100644
--- a/sc/source/filter/oox/worksheetsettings.cxx
+++ b/sc/source/filter/oox/worksheetsettings.cxx
@@ -237,88 +237,6 @@ void WorksheetSettings::importPhoneticPr( 
SequenceInputStream rStrm )
 maPhoneticSett.importPhoneticPr( rStrm );
 }
 
-void WorksheetSettings::importSheetExt( BiffInputStream rStrm )
-{
-rStrm.skip( 16 );
-sal_uInt32 nFlags;
-rStrm  nFlags;
-sal_uInt8 nColorIdx = extractValue sal_uInt8 ( nFlags, 0, 7 );
-if( nColorIdx != BIFF_SHEETEXT_NOTABCOLOR )
-maSheetSettings.maTabColor.setPaletteClr( nColorIdx );
-}
-
-void WorksheetSettings::importSheetPr( BiffInputStream rStrm )
-{
-sal_uInt16 nFlags;
-rStrm  nFlags;
-// worksheet vs. dialogsheet
-if( getFlag( nFlags, BIFF_SHEETPR_DIALOGSHEET ) )
-{
-OSL_ENSURE( getSheetType() == SHEETTYPE_WORKSHEET, 
WorksheetSettings::importSheetPr - unexpected sheet type );
-setSheetType( SHEETTYPE_DIALOGSHEET );
-}
-// outline settings
-maSheetSettings.mbApplyStyles  = getFlag( nFlags, BIFF_SHEETPR_APPLYSTYLES 
);
-maSheetSettings.mbSummaryRight = getFlag( nFlags, 
BIFF_SHEETPR_SYMBOLSRIGHT );
-maSheetSettings.mbSummaryBelow = getFlag( nFlags, 
BIFF_SHEETPR_SYMBOLSBELOW );
-// fit printout to width/height
-getPageSettings().setFitToPagesMode( getFlag( nFlags, 
BIFF_SHEETPR_FITTOPAGES ) );
-// save external linked values, in BIFF5-BIFF8 moved to BOOKBOOK record
-if( getBiff() = BIFF4 )
-getWorkbookSettings().setSaveExtLinkValues( !getFlag( nFlags, 
BIFF_SHEETPR_SKIPEXT ) );
-}
-
-void WorksheetSettings::importProtect( BiffInputStream rStrm )
-{
-maSheetProt.mbSheet = rStrm.readuInt16() != 0;
-}
-
-void WorksheetSettings::importObjectProtect( BiffInputStream rStrm )
-{
-maSheetProt.mbObjects = rStrm.readuInt16() != 0;
-}
-
-void WorksheetSettings::importScenProtect( BiffInputStream rStrm )
-{
-maSheetProt.mbScenarios = rStrm.readuInt16() != 0;
-}
-
-void WorksheetSettings::importPassword( BiffInputStream rStrm )
-{
-rStrm  maSheetProt.mnPasswordHash;
-}
-
-void WorksheetSettings::importSheetProtection( BiffInputStream rStrm )
-{
-sal_uInt32 nFlags = rStrm.readuInt32();
-// set flag means protection is disabled
-maSheetProt.mbObjects  = !getFlag( nFlags, BIFF_SHEETPROT_OBJECTS 
);
-maSheetProt.mbScenarios= !getFlag( nFlags, 
BIFF_SHEETPROT_SCENARIOS );
-maSheetProt.mbFormatCells  = !getFlag( nFlags, 
BIFF_SHEETPROT_FORMAT_CELLS );
-maSheetProt.mbFormatColumns= !getFlag( nFlags, 
BIFF_SHEETPROT_FORMAT_COLUMNS );
-maSheetProt.mbFormatRows   = !getFlag( nFlags, 
BIFF_SHEETPROT_FORMAT_ROWS );
-maSheetProt.mbInsertColumns= !getFlag( nFlags, 

[Libreoffice-commits] .: sc/source unusedcode.easy

2012-04-06 Thread Julien Nabet
 sc/source/filter/inc/pagesettings.hxx |   25 
 sc/source/filter/oox/pagesettings.cxx |  100 --
 unusedcode.easy   |   12 
 3 files changed, 137 deletions(-)

New commits:
commit c1036d7ab06e6b85763e90659c08e1f450ff50ab
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Apr 7 01:20:48 2012 +0200

Remove unused code oox::xls::PageSettings

diff --git a/sc/source/filter/inc/pagesettings.hxx 
b/sc/source/filter/inc/pagesettings.hxx
index 0ce662c..5ff75bc 100644
--- a/sc/source/filter/inc/pagesettings.hxx
+++ b/sc/source/filter/inc/pagesettings.hxx
@@ -125,31 +125,6 @@ public:
 /** Imports the PICTURE record from the passed stream. */
 voidimportPicture( const ::oox::core::Relations 
rRelations, SequenceInputStream rStrm );
 
-/** Imports the LEFTMARGIN record from the passed BIFF stream. */
-voidimportLeftMargin( BiffInputStream rStrm );
-/** Imports the RIGHTMARGIN record from the passed BIFF stream. */
-voidimportRightMargin( BiffInputStream rStrm );
-/** Imports the TOPMARGIN record from the passed BIFF stream. */
-voidimportTopMargin( BiffInputStream rStrm );
-/** Imports the BOTTOMMARGIN record from the passed BIFF stream. */
-voidimportBottomMargin( BiffInputStream rStrm );
-/** Imports the SETUP record from the passed BIFF stream. */
-voidimportPageSetup( BiffInputStream rStrm );
-/** Imports the HCENTER record from the passed BIFF stream. */
-voidimportHorCenter( BiffInputStream rStrm );
-/** Imports the VCENTER record from the passed BIFF stream. */
-voidimportVerCenter( BiffInputStream rStrm );
-/** Imports the PRINTHEADERS record from the passed BIFF stream. */
-voidimportPrintHeaders( BiffInputStream rStrm );
-/** Imports the PRINTGRIDLINES record from the passed BIFF stream. */
-voidimportPrintGridLines( BiffInputStream rStrm );
-/** Imports the HEADER record from the passed BIFF stream. */
-voidimportHeader( BiffInputStream rStrm );
-/** Imports the FOOTER record from the passed BIFF stream. */
-voidimportFooter( BiffInputStream rStrm );
-/** Imports the PICTURE record from the passed BIFF stream. */
-voidimportPicture( BiffInputStream rStrm );
-
 /** Sets whether percentual scaling or fit to width/height scaling is 
used. */
 voidsetFitToPagesMode( bool bFitToPages );
 
diff --git a/sc/source/filter/oox/pagesettings.cxx 
b/sc/source/filter/oox/pagesettings.cxx
index 6f140b1..8fcbd72 100644
--- a/sc/source/filter/oox/pagesettings.cxx
+++ b/sc/source/filter/oox/pagesettings.cxx
@@ -328,106 +328,6 @@ void PageSettings::importPicture( const Relations 
rRelations, SequenceInputStre
 importPictureData( rRelations, BiffHelper::readString( rStrm ) );
 }
 
-void PageSettings::importLeftMargin( BiffInputStream rStrm )
-{
-rStrm  maModel.mfLeftMargin;
-}
-
-void PageSettings::importRightMargin( BiffInputStream rStrm )
-{
-rStrm  maModel.mfRightMargin;
-}
-
-void PageSettings::importTopMargin( BiffInputStream rStrm )
-{
-rStrm  maModel.mfTopMargin;
-}
-
-void PageSettings::importBottomMargin( BiffInputStream rStrm )
-{
-rStrm  maModel.mfBottomMargin;
-}
-
-void PageSettings::importPageSetup( BiffInputStream rStrm )
-{
-sal_uInt16 nPaperSize, nScale, nFirstPage, nFitToWidth, nFitToHeight, 
nFlags;
-rStrm  nPaperSize  nScale  nFirstPage  nFitToWidth  nFitToHeight 
 nFlags;
-
-maModel.mnPaperSize  = nPaperSize;   // equal in BIFF and OOX
-maModel.mnScale  = nScale;
-maModel.mnFirstPage  = nFirstPage;
-maModel.mnFitToWidth = nFitToWidth;
-maModel.mnFitToHeight= nFitToHeight;
-maModel.mnOrientation= getFlagValue( nFlags, BIFF_PAGESETUP_PORTRAIT, 
XML_portrait, XML_landscape );
-maModel.mnPageOrder  = getFlagValue( nFlags, BIFF_PAGESETUP_INROWS, 
XML_overThenDown, XML_downThenOver );
-maModel.mbValidSettings  = !getFlag( nFlags, BIFF_PAGESETUP_INVALID );
-maModel.mbUseFirstPage   = true;
-maModel.mbBlackWhite = getFlag( nFlags, BIFF_PAGESETUP_BLACKWHITE );
-
-if( getBiff() = BIFF5 )
-{
-sal_uInt16 nHorPrintRes, nVerPrintRes, nCopies;
-rStrm  nHorPrintRes  nVerPrintRes  maModel.mfHeaderMargin  
maModel.mfFooterMargin  nCopies;
-
-maModel.mnCopies   = nCopies;
-maModel.mnOrientation  = getFlagValue( nFlags, 
BIFF_PAGESETUP_DEFAULTORIENT, XML_default, maModel.mnOrientation );
-maModel.mnHorPrintRes  = nHorPrintRes;
-maModel.mnVerPrintRes  = nVerPrintRes;
-maModel.mnCellComments = getFlagValue( nFlags, 
BIFF_PAGESETUP_PRINTNOTES, XML_asDisplayed, XML_none );
-maModel.mbUseFirstPage = getFlag( nFlags, BIFF_PAGESETUP_USEFIRSTPAGE 
);
-

[Libreoffice-commits] .: sc/source

2012-04-05 Thread Caolán McNamara
 sc/source/ui/app/scdll.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 8ae3e12fa8f1a1410622bc2bea1eccdec86e0acf
Author: Winfried Donkers o...@dci-electronics.nl
Date:   Thu Apr 5 11:58:32 2012 +0200

remove unused code

diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 2d9af16..505e9fd 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -202,7 +202,6 @@ void ScDLL::Init()
 SvxLineEndToolBoxControl::RegisterControl(SID_ATTR_LINEEND_STYLE,  
 pMod);
 SvxStyleToolBoxControl  ::RegisterControl(SID_STYLE_APPLY, 
 pMod);
 SvxFontNameToolBoxControl   ::RegisterControl(SID_ATTR_CHAR_FONT,  
 pMod);
-//  SvxFontHeightToolBoxControl 
::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod);
 SvxColorExtToolBoxControl   ::RegisterControl(SID_ATTR_CHAR_COLOR, 
 pMod);
 SvxColorExtToolBoxControl   ::RegisterControl(SID_BACKGROUND_COLOR,
 pMod);
 SvxFrameToolBoxControl  ::RegisterControl(SID_ATTR_BORDER, 
 pMod);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-05 Thread Caolán McNamara
 sc/source/filter/oox/formulaparser.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 735a2cba30c55b5aff4883389f65255fb2d07458
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Apr 5 15:43:49 2012 +0100

cppcheck Uninitialized variable

diff --git a/sc/source/filter/oox/formulaparser.cxx 
b/sc/source/filter/oox/formulaparser.cxx
index eeb683f..aa4c0f7 100644
--- a/sc/source/filter/oox/formulaparser.cxx
+++ b/sc/source/filter/oox/formulaparser.cxx
@@ -2613,6 +2613,7 @@ bool BiffFormulaParserImpl::readNlrSAddrAddData( BiffNlr 
orNlr, BiffInputStream
 
 bool BiffFormulaParserImpl::readNlrSRangeAddData( BiffNlr orNlr, bool 
orbIsRow, BiffInputStream rStrm )
 {
+orbIsRow = false;
 swapStreamPosition( rStrm );
 // read number of cell addresses and relative flag
 sal_uInt32 nCount;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source sfx2/inc sfx2/source sw/source

2012-04-05 Thread Ivan Timofeev
 sc/source/ui/view/tabview.cxx|   25 +
 sfx2/inc/sfx2/viewsh.hxx |   11 ---
 sfx2/source/view/viewimp.hxx |3 ---
 sfx2/source/view/viewsh.cxx  |8 
 sw/source/ui/uiview/viewport.cxx |   38 ++
 5 files changed, 11 insertions(+), 74 deletions(-)

New commits:
commit c5154a179f435cc23798057895b0db8312bcd6f6
Author: Ivan Timofeev timofeev@gmail.com
Date:   Thu Apr 5 21:08:26 2012 +0400

SfxViewShell::GetScrollingMode always returns SCROLLING_DEFAULT

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index a2784e1..219f9d2 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -407,13 +407,6 @@ void ScTabView::DoResize( const Point rOffset, const 
Size rSize, bool bInner )
 bool bHOutline   = bOutlMode  lcl_HasColOutline(aViewData);
 bool bVOutline   = bOutlMode  lcl_HasRowOutline(aViewData);
 
-//  Scrollbar-Einstellungen koennen vom Sfx ueberschrieben werden:
-SfxScrollingMode eMode = aViewData.GetViewShell()-GetScrollingMode();
-if ( eMode == SCROLLING_NO )
-bHScroll = bVScroll = false;
-else if ( eMode == SCROLLING_YES || eMode == SCROLLING_AUTO )   //! Auto 
???
-bHScroll = bVScroll = true;
-
 if ( aViewData.GetDocShell()-IsPreview() )
 bHScroll = bVScroll = bTabControl = bHeaders = bOutlMode = bHOutline = 
bVOutline = false;
 
@@ -899,16 +892,7 @@ void ScTabView::GetBorderSize( SvBorder rBorder, const 
Size /* rSize */ )
 
 IMPL_LINK_NOARG(ScTabView, TabBarResize)
 {
-sal_Bool bHScrollMode = aViewData.IsHScrollMode();
-
-//  Scrollbar-Einstellungen koennen vom Sfx ueberschrieben werden:
-SfxScrollingMode eMode = aViewData.GetViewShell()-GetScrollingMode();
-if ( eMode == SCROLLING_NO )
-bHScrollMode = false;
-else if ( eMode == SCROLLING_YES || eMode == SCROLLING_AUTO )   //! Auto 
???
-bHScrollMode = sal_True;
-
-if( bHScrollMode )
+if (aViewData.IsHScrollMode())
 {
 const long nOverlap = 0;// ScrollBar::GetWindowOverlapPixel();
 long nSize = pTabControl-GetSplitSize();
@@ -1572,13 +1556,6 @@ void ScTabView::UpdateShow()
 sal_Bool bShowH = ( aViewData.GetHSplitMode() != SC_SPLIT_NONE );
 sal_Bool bShowV = ( aViewData.GetVSplitMode() != SC_SPLIT_NONE );
 
-//  Scrollbar-Einstellungen koennen vom Sfx ueberschrieben werden:
-SfxScrollingMode eMode = aViewData.GetViewShell()-GetScrollingMode();
-if ( eMode == SCROLLING_NO )
-bHScrollMode = bVScrollMode = false;
-else if ( eMode == SCROLLING_YES || eMode == SCROLLING_AUTO )   //! Auto 
???
-bHScrollMode = bVScrollMode = sal_True;
-
 if ( aViewData.GetDocShell()-IsPreview() )
 bHScrollMode = bVScrollMode = bTabMode = bHeader = bOutlMode = 
bHOutline = bVOutline = false;
 
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index 869de36..d2da4cb 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -83,14 +83,6 @@ class NotifyEvent;
 #define SFX_PRINTERROR_NONE  0
 #define SFX_PRINTERROR_BUSY  1
 
-enum SfxScrollingMode
-{
-SCROLLING_NO,
-SCROLLING_YES,
-SCROLLING_AUTO,
-SCROLLING_DEFAULT
-};
-
 // Verified using www.apple.com and Netscape 3.01
 #define DEFAULT_MARGIN_WIDTH 8
 #define DEFAULT_MARGIN_HEIGHT 12
@@ -207,9 +199,6 @@ public:
 virtual voidJumpToMark( const String rMark );
 voidVisAreaChanged(const Rectangle rRect);
 
-// Behavior Flags
-SfxScrollingModeGetScrollingMode() const;
-
 // Misc
 virtual sal_uInt16  PrepareClose( sal_Bool bUI = sal_True, 
sal_Bool bForBrowsing = sal_False );
 virtual String  GetSelectionText( sal_Bool bCompleteWords = 
sal_False );
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 3d77c18..31dfdc7 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -63,11 +63,8 @@ struct SfxViewShell_Impl
 boolm_bHasPrintOptions;
 boolm_bPlugInsActive;
 boolm_bIsShowView;
-// FIXME UNUSED ???
-//boolm_bOwnsMenu;
 boolm_bGotOwnership;
 boolm_bGotFrameOwnership;
-SfxScrollingModem_eScroll;
 sal_uInt16  m_nFamily;
 ::rtl::ReferenceSfxBaseController m_pController;
 ::std::auto_ptr ::svt::AcceleratorExecute m_pAccExec;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 3c6a2de..dc7cdf6 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -301,7 +301,6 @@ SfxViewShell_Impl::SfxViewShell_Impl(sal_uInt16 const 
nFlags)
 ,   m_bIsShowView(SFX_VIEW_NO_SHOW != (nFlags  SFX_VIEW_NO_SHOW))
 ,   m_bGotOwnership(false)
 ,   

[Libreoffice-commits] .: sc/source

2012-04-05 Thread Eike Rathke
 sc/source/ui/unoobj/scdetect.cxx |   16 
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 0de1b33bf73f075cff12fbe288129b2afff8216d
Author: Eike Rathke er...@redhat.com
Date:   Thu Apr 5 19:48:10 2012 +0200

resolved fdo#48347 do not override preselected CSV with SYLK detection

diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 0efb037..fdab373 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -444,8 +444,10 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 bool bIsXLS = false;
 SvStream* pStream = aMedium.GetInStream();
 const SfxFilter* pPreselectedFilter = pFilter;
+bool bCsvSelected = (pPreselectedFilter ?
+pPreselectedFilter-GetFilterName().EqualsAscii( 
pFilterAscii ) : false);
 if ( pPreselectedFilter  ( ( 
pPreselectedFilter-GetName().SearchAscii(Excel) != STRING_NOTFOUND ) ||
-( !aPreselectedFilterName.Len()  
pPreselectedFilter-GetFilterName().EqualsAscii( pFilterAscii ) ) ) )
+( !aPreselectedFilterName.Len()  bCsvSelected ) ) )
 bIsXLS = true;
 pFilter = 0;
 if ( pStream )
@@ -676,9 +678,15 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 
 for ( nFilter = 0 ; nFilter  nFilterCount ; nFilter++ 
)
 {
+pSearch = ppFilterPatterns[ nFilter ];
+if (bCsvSelected  pSearch == pSylk)
+// SYLK 4 characters is really too weak to
+// override preselected CSV, already ID;Name
+// would trigger that. fdo#48347
+continue;
+
 rStr.Seek( 0 ); // am Anfang war alles Uebel...
 rStr  nAkt;
-pSearch = ppFilterPatterns[ nFilter ];
 bSync = sal_True;
 while( !rStr.IsEof()  bSync )
 {
@@ -759,7 +767,7 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 }
 else if ( 
pPreselectedFilter-GetName().EqualsAscii(pFilterDBase)  lcl_MayBeDBase( rStr 
) )
 pFilter = pPreselectedFilter;
-else if ( 
pPreselectedFilter-GetFilterName().EqualsAscii(pFilterAscii)  bMaybeText )
+else if ( bCsvSelected  bMaybeText )
 pFilter = pPreselectedFilter;
 else if ( 
HTMLParser::IsHTMLFormat(aHeader.getStr()) )
 {
@@ -789,7 +797,7 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 {
 // 0-length stream, preselected Text/CSV is ok, user
 // may want to write to that file later.
-if ( 
pPreselectedFilter-GetFilterName().EqualsAscii(pFilterAscii) )
+if ( bCsvSelected )
 pFilter = pPreselectedFilter;
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-04 Thread Michael Stahl
 sc/source/core/data/sortparam.cxx  |   40 +
 sc/source/ui/docshell/dbdocfun.cxx |5 ++--
 2 files changed, 18 insertions(+), 27 deletions(-)

New commits:
commit 61af0e1c3c1c9003c741d64840f9b6f39ea87ead
Author: Michael Stahl mst...@redhat.com
Date:   Wed Apr 4 20:37:04 2012 +0200

ScDBDocFunc::Sort: work around STL assertion in sc_unoapi

from dbdocfun.cxx:588:
error: attempt to subscript container with out-of-bounds index 0,
but container only holds 0 elements.

The code in sortparam.cxx still looks quite wrong, and
in table3.cxx there are various arrays hard-coded to size 3...

(regression from a02b445c39d969fedc554fc2c500b88a27a13906)

diff --git a/sc/source/core/data/sortparam.cxx 
b/sc/source/core/data/sortparam.cxx
index 069e410..21bf327 100644
--- a/sc/source/core/data/sortparam.cxx
+++ b/sc/source/core/data/sortparam.cxx
@@ -175,8 +175,6 @@ ScSortParam::ScSortParam( const ScSubTotalParam rSub, 
const ScSortParam rOld )
 aCollatorLocale( rOld.aCollatorLocale ), aCollatorAlgorithm( 
rOld.aCollatorAlgorithm ),
 nCompatHeader( rOld.nCompatHeader )
 {
-sal_uInt16 nNewCount = 0;
-sal_uInt16 nSortSize = GetSortKeyCount();
 sal_uInt16 i;
 
 //  zuerst die Gruppen aus den Teilergebnissen
@@ -184,42 +182,34 @@ ScSortParam::ScSortParam( const ScSubTotalParam rSub, 
const ScSortParam rOld )
 for (i=0; iMAXSUBTOTAL; i++)
 if (rSub.bGroupActive[i])
 {
-if (nNewCount  nSortSize)
-{
-maKeyState[nNewCount].bDoSort = true;
-maKeyState[nNewCount].nField = rSub.nField[i];
-maKeyState[nNewCount].bAscending = rSub.bAscending;
-++nNewCount;
-}
+#if 0
+// FIXME this crashes in sc_unoapi currently; table3.cxx has nMaxSorts = 3...
+ScSortKeyState key;
+key.bDoSort = true;
+key.nField = rSub.nField[i];
+key.bAscending = rSub.bAscending;
+maKeyState.push_back(key);
+#endif
 }
 
 //  dann dahinter die alten Einstellungen
-for (i=0; inSortSize; i++)
+for (i=0; i  rOld.GetSortKeyCount(); i++)
 if (rOld.maKeyState[i].bDoSort)
 {
 SCCOLROW nThisField = rOld.maKeyState[i].nField;
 bool bDouble = false;
-for (sal_uInt16 j=0; jnNewCount; j++)
+for (sal_uInt16 j = 0; j  GetSortKeyCount(); j++)
 if ( maKeyState[j].nField == nThisField )
 bDouble = true;
 if (!bDouble)   // ein Feld nicht zweimal eintragen
 {
-if (nNewCount  nSortSize)
-{
-maKeyState[nNewCount].bDoSort = true;
-maKeyState[nNewCount].nField = nThisField;
-maKeyState[nNewCount].bAscending = 
rOld.maKeyState[i].bAscending;
-++nNewCount;
-}
+ScSortKeyState key;
+key.bDoSort = true;
+key.nField = nThisField;
+key.bAscending = rOld.maKeyState[i].bAscending;
+maKeyState.push_back(key);
 }
 }
-
-for (i=nNewCount; inSortSize; i++)   // Rest loeschen
-{
-maKeyState[nNewCount].bDoSort = false;
-maKeyState[nNewCount].nField = 0;
-maKeyState[nNewCount].bAscending = true;
-}
 }
 
 //
diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index a54f906..c315147 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -585,7 +585,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam 
rSortParam,
 }
 
 // don't call ScDocument::Sort with an empty SortParam (may be empty here 
if bCopy is set)
-if ( aLocalParam.maKeyState[0].bDoSort )
+if (aLocalParam.GetSortKeyCount()  aLocalParam.maKeyState[0].bDoSort)
 pDoc-Sort( nTab, aLocalParam, bRepeatQuery );
 
 sal_Bool bSave = sal_True;
@@ -593,7 +593,8 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam 
rSortParam,
 {
 ScSortParam aOldSortParam;
 pDBData-GetSortParam( aOldSortParam );
-if ( aOldSortParam.maKeyState[0].bDoSort  aOldSortParam.bInplace )   
// Inplace-Sortierung gemerkt?
+if (aOldSortParam.GetSortKeyCount() 
+aOldSortParam.maKeyState[0].bDoSort  aOldSortParam.bInplace)
 {
 bSave = false;
 aOldSortParam.nDestCol = rSortParam.nDestCol;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-04 Thread Eike Rathke
 sc/source/ui/dbgui/scuiasciiopt.cxx |1 -
 sc/source/ui/inc/scuiasciiopt.hxx   |1 -
 2 files changed, 2 deletions(-)

New commits:
commit fe753d02207829282d2f40f72090988922fa9594
Author: Eike Rathke er...@redhat.com
Date:   Wed Apr 4 21:16:52 2012 +0200

removed unused member variable

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 2a3a2b9..fefb255 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -248,7 +248,6 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String 
aDatName,
 
 aCharSetUser( ScResId( SCSTR_CHARSET_USER ) ),
 aColumnUser ( ScResId( SCSTR_COLUMN_USER ) ),
-aFldSepList ( ScResId( SCSTR_FIELDSEP ) ),
 aTextSepList( ScResId( SCSTR_TEXTSEP ) ),
 mcTextSep   ( ScAsciiOptions::cDefaultTextSep ),
 maStrTextToColumns( ScResId( STR_TEXTTOCOLUMNS ) ),
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx 
b/sc/source/ui/inc/scuiasciiopt.hxx
index e638230..c07f6f4 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -87,7 +87,6 @@ class ScImportAsciiDlg : public ModalDialog
 
 String  aCharSetUser;
 String  aColumnUser;
-String  aFldSepList;
 String  aTextSepList;
 String  maFieldSeparators;  // selected field 
separators
 sal_Unicode mcTextSep;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-04 Thread Eike Rathke
 sc/source/ui/unoobj/scdetect.cxx |   22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)

New commits:
commit 09d98dfe89a651c1b33a07c3d23e20b266d163e7
Author: Eike Rathke er...@redhat.com
Date:   Wed Apr 4 23:39:17 2012 +0200

resolved fdo#46699 do not write compound document header when reading 
0-length file

Creating an SotStorage with a 0-length stream has the side-effect of 
creating
the compound document (aka OLE storage) header on the stream and effectively
writing that to disk, thus garbling the empty file.

diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 55ae121..1fb1a84 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -450,8 +450,17 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 pFilter = 0;
 if ( pStream )
 {
-SotStorageRef aStorage = new SotStorage ( pStream, false );
-if ( !aStorage-GetError() )
+pStream-Seek( STREAM_SEEK_TO_END);
+sal_Size nSize = pStream-Tell();
+pStream-Seek( 0);
+// Do not attempt to create an SotStorage on a
+// 0-length stream as that would create the compound
+// document header on the stream and effectively write to
+// disk!
+SotStorageRef aStorage;
+if (nSize  0)
+aStorage = new SotStorage ( pStream, false );
+if ( aStorage.Is()  !aStorage-GetError() )
 {
 // Excel-5: detect through contained streams
 // there are some excel formats from 3rd party 
vendors that need to be distinguished
@@ -522,7 +531,7 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 }
 }
 }
-else
+else if (nSize  0)
 {
 SvStream rStr = *pStream;
 
@@ -767,6 +776,13 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 pFilter = pPreselectedFilter;
 }
 }
+else
+{
+// 0-length stream, preselected Text/CSV is ok, user
+// may want to write to that file later.
+if ( 
pPreselectedFilter-GetFilterName().EqualsAscii(pFilterAscii) )
+pFilter = pPreselectedFilter;
+}
 }
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-04 Thread Eike Rathke
 sc/source/ui/unoobj/scdetect.cxx |   39 ---
 1 file changed, 24 insertions(+), 15 deletions(-)

New commits:
commit a5eadc6aaafec92df23c57e258882a2c98ece0ad
Author: Eike Rathke er...@redhat.com
Date:   Thu Apr 5 02:01:26 2012 +0200

resolved fdo#40021 don't let CSV import get confused by erroneous HTML 
detection

HTMLParser::IsHTMLFormat() is convinced that anything containing a valid 
HTML
tag would indeed be HTML, which is a rather idiotic assumption for us in the
case of foo br bar with a preselected CSV filter. So keep this 
detection to
the end.

The original order where preselected CSV had precedence over others was 
changed
with 9f1cc58c20ee365ff2a158ad69c1091e6ad11ac6

diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 1fb1a84..0efb037 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -734,6 +734,7 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 // further checks for filters only if they are 
preselected: ASCII, HTML, RTF, DBase
 // without the preselection other filters (Writer) 
take precedence
 // DBase can't be detected reliably, so it also 
needs preselection
+
 bool bMaybeText = lcl_MayBeAscii( rStr );
 
 // get file header
@@ -741,21 +742,7 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 const sal_Size nTrySize = 80;
 rtl::OString aHeader = read_uInt8s_ToOString(rStr, 
nTrySize);
 
-if ( HTMLParser::IsHTMLFormat(aHeader.getStr()) )
-{
-// test for HTML
-if ( 
pPreselectedFilter-GetName().EqualsAscii(pFilterHtml) )
-{
-pFilter = pPreselectedFilter;
-}
-else
-{
-pFilter = aMatcher.GetFilter4FilterName( 
String::CreateFromAscii(pFilterHtmlWeb) );
-if ( bIsXLS )
-bFakeXLS = true;
-}
-}
-else if ( aHeader.copy(0, 5).equalsL({\\rtf, 5) )
+if ( aHeader.copy(0, 5).equalsL({\\rtf, 5) )
 {
 // test for RTF
 pFilter = aMatcher.GetFilter4FilterName( 
String::CreateFromAscii(pFilterRtf) );
@@ -774,6 +761,28 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 pFilter = pPreselectedFilter;
 else if ( 
pPreselectedFilter-GetFilterName().EqualsAscii(pFilterAscii)  bMaybeText )
 pFilter = pPreselectedFilter;
+else if ( 
HTMLParser::IsHTMLFormat(aHeader.getStr()) )
+{
+// test for HTML
+
+// HTMLParser::IsHTMLFormat() is convinced that
+// anything containing a valid HTML tag would
+// indeed be HTML, which is a rather idiotic
+// assumption for us in the case of
+// foo br bar with a preselected CSV
+// filter. So keep this detection to the end.
+
+if ( 
pPreselectedFilter-GetName().EqualsAscii(pFilterHtml) )
+{
+pFilter = pPreselectedFilter;
+}
+else
+{
+pFilter = aMatcher.GetFilter4FilterName( 
String::CreateFromAscii(pFilterHtmlWeb) );
+if ( bIsXLS )
+bFakeXLS = true;
+}
+}
 }
 }
 else
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-03 Thread Eike Rathke
 sc/source/core/tool/stringutil.cxx |   52 +
 1 file changed, 42 insertions(+), 10 deletions(-)

New commits:
commit 35fed09a0c5560b56ba53c64da8dea28bf88acff
Author: Eike Rathke er...@redhat.com
Date:   Tue Apr 3 20:57:19 2012 +0200

resolved fdo#39716 CSV import numbers in scientific notation

diff --git a/sc/source/core/tool/stringutil.cxx 
b/sc/source/core/tool/stringutil.cxx
index 58e84e9..263e22c 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -48,9 +48,15 @@ ScSetStringParam::ScSetStringParam() :
 bool ScStringUtil::parseSimpleNumber(
 const OUString rStr, sal_Unicode dsep, sal_Unicode gsep, double rVal)
 {
-if (gsep == 0x00A0)
-// unicode space to ascii space
-gsep = 0x0020;
+// Actually almost the entire pre-check is unnecessary and we could call
+// rtl::math::stringToDouble() just after having exchanged ascii space with
+// non-breaking space, if it wasn't for check of grouped digits. The NaN
+// and Inf cases that are accepted by stringToDouble() could be detected
+// using rtl::math::isFinite() on the result.
+
+/* TODO: The grouped digits check isn't even valid for locales that do not
+ * group in thousands ... e.g. Indian locales. But that's something also
+ * the number scanner doesn't implement yet, only the formatter. */
 
 OUStringBuffer aBuf;
 
@@ -60,6 +66,7 @@ bool ScStringUtil::parseSimpleNumber(
 const sal_Unicode* pLast = p + (n-1);
 sal_Int32 nPosDSep = -1, nPosGSep = -1;
 sal_uInt32 nDigitCount = 0;
+sal_Int32 nPosExponent = -1;
 
 // Skip preceding spaces.
 for (i = 0; i  n; ++i, ++p)
@@ -88,9 +95,9 @@ bool ScStringUtil::parseSimpleNumber(
 for (i = 0; i  n; ++i, ++p)
 {
 sal_Unicode c = *p;
-if (c == 0x00A0)
-// unicode space to ascii space
-c = 0x0020;
+if (c == 0x0020  gsep == 0x00A0)
+// ascii space to unicode space if that is group separator
+c = 0x00A0;
 
 if (sal_Unicode('0') = c  c = sal_Unicode('9'))
 {
@@ -132,17 +139,40 @@ bool ScStringUtil::parseSimpleNumber(
 // must be exactly 3 digits since the last group separator.
 return false;
 
+if (nPosExponent = 0)
+// not allowed in exponent.
+return false;
+
 nPosGSep = i;
 nDigitCount = 0;
 }
 else if (c == sal_Unicode('-') || c == sal_Unicode('+'))
 {
-// A sign must be the first character if it's given.
-if (i == 0)
+// A sign must be the first character if it's given, or immediately
+// follow the exponent character if present.
+if (i == 0 || (nPosExponent = 0  i == nPosExponent + 1))
 aBuf.append(c);
 else
 return false;
 }
+else if (c == sal_Unicode('E') || c == sal_Unicode('e'))
+{
+// this is an exponent designator.
+
+if (nPosExponent = 0)
+// Only one exponent allowed.
+return false;
+
+if (nPosGSep = 0  nDigitCount != 3)
+// must be exactly 3 digits since the last group separator.
+return false;
+
+aBuf.append(c);
+nPosExponent = i;
+nPosDSep = -1;
+nPosGSep = -1;
+nDigitCount = 0;
+}
 else
 return false;
 }
@@ -155,8 +185,10 @@ bool ScStringUtil::parseSimpleNumber(
 
 rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
 sal_Int32 nParseEnd = 0;
-rVal = ::rtl::math::stringToDouble(aBuf.makeStringAndClear(), dsep, gsep, 
eStatus, nParseEnd);
-if (eStatus != rtl_math_ConversionStatus_Ok)
+OUString aString( aBuf.makeStringAndClear());
+rVal = ::rtl::math::stringToDouble( aString, dsep, gsep, eStatus, 
nParseEnd);
+if (eStatus != rtl_math_ConversionStatus_Ok || nParseEnd  
aString.getLength())
+// Not a valid number or not entire string consumed.
 return false;
 
 return true;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-27 Thread Caolán McNamara
 sc/source/filter/xml/XMLStylesExportHelper.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 1192b227544c87f25a367ebff478cbdc190dad02
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Mar 27 13:03:21 2012 +0100

Resolves: rhbz#802173 crash in ScRowStyles::GetStyleNameIndex

diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx 
b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index a04c75b..48d9502 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -1290,6 +1290,9 @@ void ScRowStyles::AddNewTable(const sal_Int32 nTable, 
const sal_Int32 nFields)
 sal_Int32 ScRowStyles::GetStyleNameIndex(const sal_Int32 nTable, const 
sal_Int32 nField)
 {
 OSL_ENSURE(static_castsize_t(nTable)  aTables.size(), wrong table);
+if (!(static_castsize_t(nTable)  aTables.size()))
+return -1;
+
 if (maCache.hasCache(nTable, nField))
 // Cache hit !
 return maCache.mnStyle;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-25 Thread Markus Mohrhard
 sc/source/ui/docshell/dbdocfun.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit b138edfab8908cf70c5a90aa9fa2b5dc5675dda7
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 25 16:13:05 2012 +0200

WaE: one more newly unused variable

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index bb635bb..13b484a 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1461,7 +1461,6 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* 
pDPObj, bool bApi)
 if (!pDPs)
 return 0;
 
-ScDPSaveData* pSaveData = pDPObj-GetSaveData();
 std::setScDPObject* aRefs;
 sal_uLong nErrId = pDPs-ReloadCache(pDPObj, aRefs);
 if (nErrId)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-22 Thread Stephan Bergmann
 sc/source/ui/unoobj/chart2uno.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit e1b4216816ba927f171030101f272f7ec0eb8314
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Mar 22 10:06:16 2012 +0100

ChartTokenMap can contain null pointers

db3786ee3aa0d8911042c9bbcea02cf36d96dfa1 caused chart2_unoapi test to crash

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 469eb1d..9f5e3cd 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -309,9 +309,10 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount,  
SCROW nAllRowCount,
 ScTokenPtrMap::iterator tokenIter = pCol-begin();
 for (SCROW nRow = 0; !bFoundValues  nRow  
nSmallestValueRowIndex; ++nRow)
 {
-if (tokenIter != pCol-end()  nRow=nHeaderRowCount)
+ScToken* pToken =
+tokenIter == pCol-end() ? 0 : tokenIter-second;
+if (pToken  nRow=nHeaderRowCount)
 {
-ScToken* pToken = tokenIter-second;
 ScRange aRange;
 bool bExternal = false;
 StackVar eType = pToken-GetType();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-22 Thread Takeshi Abe
 sc/source/core/data/dptabsrc.cxx  |1 -
 sc/source/core/data/pivot2.cxx|1 -
 sc/source/core/data/table5.cxx|1 -
 sc/source/core/tool/interpr4.cxx  |1 -
 sc/source/core/tool/interpr5.cxx  |5 -
 sc/source/filter/excel/excimp8.cxx|1 -
 sc/source/filter/excel/excrecds.cxx   |1 -
 sc/source/filter/excel/impop.cxx  |1 -
 sc/source/filter/excel/xechart.cxx|1 -
 sc/source/filter/excel/xestring.cxx   |2 --
 sc/source/filter/excel/xltoolbar.cxx  |1 -
 sc/source/filter/html/htmlexp.cxx |1 -
 sc/source/filter/lotus/op.cxx |8 
 sc/source/filter/xml/xmlexprt.cxx |3 ---
 sc/source/filter/xml/xmlfonte.cxx |1 -
 sc/source/filter/xml/xmlimprt.cxx |1 -
 sc/source/ui/cctrl/tbinsert.cxx   |1 -
 sc/source/ui/docshell/docsh.cxx   |1 -
 sc/source/ui/drawfunc/drawsh.cxx  |3 ---
 sc/source/ui/drawfunc/fuins2.cxx  |1 -
 sc/source/ui/miscdlgs/autofmt.cxx |1 -
 sc/source/ui/miscdlgs/scuiautofmt.cxx |1 -
 sc/source/ui/miscdlgs/textdlgs.cxx|1 -
 sc/source/ui/unoobj/chartuno.cxx  |1 -
 sc/source/ui/unoobj/docuno.cxx|1 -
 sc/source/ui/unoobj/scdetect.cxx  |4 
 sc/source/ui/unoobj/servuno.cxx   |6 --
 sc/source/ui/vba/vbaapplication.cxx   |4 
 sc/source/ui/vba/vbarange.cxx |1 -
 sc/source/ui/vba/vbaworksheet.cxx |1 -
 sc/source/ui/view/cellsh1.cxx |2 --
 sc/source/ui/view/gridwin.cxx |2 --
 sc/source/ui/view/preview.cxx |1 -
 sc/source/ui/view/prevwsh.cxx |2 --
 sc/source/ui/view/tabvwsh4.cxx|2 --
 sc/source/ui/view/viewfun2.cxx|4 
 sc/source/ui/view/viewfun3.cxx|2 --
 sc/source/ui/view/viewfun4.cxx|1 -
 sc/source/ui/view/viewfun5.cxx|1 -
 39 files changed, 74 deletions(-)

New commits:
commit eedbe7163bf3979ae392b3b88227ee68e1df12fe
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Thu Mar 22 20:52:52 2012 +0900

removed duplicate includes in sc

diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index b69b102..4d680ae 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -63,7 +63,6 @@
 #include com/sun/star/beans/PropertyAttribute.hpp
 #include com/sun/star/sheet/DataPilotFieldFilter.hpp
 #include com/sun/star/sheet/DataPilotFieldOrientation.hpp
-#include com/sun/star/sheet/DataPilotFieldFilter.hpp
 #include com/sun/star/sheet/DataPilotFieldReferenceType.hpp
 #include com/sun/star/sheet/DataPilotFieldSortMode.hpp
 #include com/sun/star/sheet/DataPilotFieldGroupBy.hpp
diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx
index a4c823a..2992023 100644
--- a/sc/source/core/data/pivot2.cxx
+++ b/sc/source/core/data/pivot2.cxx
@@ -53,7 +53,6 @@
 #include refupdat.hxx
 #include stlpool.hxx
 #include stlsheet.hxx
-#include pivot.hxx
 
 using ::com::sun::star::sheet::DataPilotFieldReference;
 using ::rtl::OUString;
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index 020c721..0a7de50 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -44,7 +44,6 @@
 #include global.hxx
 #include rechead.hxx
 #include stlpool.hxx
-#include stlsheet.hxx
 #include brdcst.hxx
 #include tabprotection.hxx
 #include globstr.hrc
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 9c6794b..8764b45 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -40,7 +40,6 @@
 #include basic/sbxobj.hxx
 #include basic/sbuno.hxx
 #include svl/zforlist.hxx
-#include svl/zforlist.hxx
 #include rtl/logfile.hxx
 #include stdlib.h
 #include string.h
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 07dcaf5..6fd612a 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -35,9 +35,6 @@
 #include math.h
 #include stdio.h
 
-#if OSL_DEBUG_LEVEL  1
-#include stdio.h
-#endif
 #include unotools/bootstrap.hxx
 #include svl/zforlist.hxx
 
@@ -51,8 +48,6 @@
 #include globstr.hrc
 #include cellkeytranslator.hxx
 
-#include string.h
-#include math.h
 #include vector
 
 using ::std::vector;
diff --git a/sc/source/filter/excel/excimp8.cxx 
b/sc/source/filter/excel/excimp8.cxx
index 41d8c38..91d5a01 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -109,7 +109,6 @@
 #include com/sun/star/script/ModuleInfo.hpp
 #include com/sun/star/container/XIndexContainer.hpp
 #include cppuhelper/component_context.hxx
-#include sfx2/app.hxx
 #include xltoolbar.hxx
 #include oox/ole/vbaproject.hxx
 #include oox/ole/olestorage.hxx
diff --git a/sc/source/filter/excel/excrecds.cxx 
b/sc/source/filter/excel/excrecds.cxx
index 828b2d6..c8e0856 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ 

[Libreoffice-commits] .: sc/source

2012-03-22 Thread Markus Mohrhard
 sc/source/core/tool/scmatrix.cxx |   33 -
 1 file changed, 16 insertions(+), 17 deletions(-)

New commits:
commit bbe088bc757fa120f50e4e104bdcd46c90f1feb1
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 23 02:05:36 2012 +0100

cache calls to mdds:mixed_type_matrix::size, related fdo#47299

diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 5256e9a..47ed6e9 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -170,6 +170,7 @@ class ScMatrixImpl
 ScMatrix::DensityType meType;
 ScInterpreter* pErrorInterpreter;
 boolmbCloneIfConst; // Whether the matrix is cloned with a 
CloneIfConst() call.
+MatrixImplType::size_pair_type  maCachedSize;
 
 ScMatrixImpl();
 ScMatrixImpl(const ScMatrixImpl);
@@ -243,6 +244,7 @@ ScMatrixImpl::ScMatrixImpl(SCSIZE nC, SCSIZE nR, 
ScMatrix::DensityType eType) :
 pErrorInterpreter(NULL),
 mbCloneIfConst(true)
 {
+maCachedSize = maMat.size();
 }
 
 ScMatrixImpl::~ScMatrixImpl()
@@ -253,6 +255,7 @@ ScMatrixImpl::~ScMatrixImpl()
 void ScMatrixImpl::Clear()
 {
 maMat.clear();
+maCachedSize = maMat.size();
 }
 
 void ScMatrixImpl::SetImmutable(bool bVal)
@@ -268,6 +271,7 @@ bool ScMatrixImpl::IsImmutable() const
 void ScMatrixImpl::Resize(SCSIZE nC, SCSIZE nR)
 {
 maMat.resize(nR, nC);
+maCachedSize = maMat.size();
 }
 
 ScMatrix::DensityType ScMatrixImpl::GetDensityType() const
@@ -282,40 +286,35 @@ void ScMatrixImpl::SetErrorInterpreter( ScInterpreter* p)
 
 void ScMatrixImpl::GetDimensions( SCSIZE rC, SCSIZE rR) const
 {
-MatrixImplType::size_pair_type aDims = maMat.size();
-rR = aDims.first;
-rC = aDims.second;
+rR = maCachedSize.first;
+rC = maCachedSize.second;
 }
 
 SCSIZE ScMatrixImpl::GetElementCount() const
 {
-MatrixImplType::size_pair_type aDims = maMat.size();
-return aDims.first * aDims.second;
+return maCachedSize.first * maCachedSize.second;
 }
 
 bool ScMatrixImpl::ValidColRow( SCSIZE nC, SCSIZE nR) const
 {
-MatrixImplType::size_pair_type aDims = maMat.size();
-return nR  aDims.first  nC  aDims.second;
+return nR  maCachedSize.first  nC  maCachedSize.second;
 }
 
 bool ScMatrixImpl::ValidColRowReplicated( SCSIZE  rC, SCSIZE  rR ) const
 {
-pairsize_t, size_t aDims = maMat.size();
-
-if (aDims.second == 1  aDims.first == 1)
+if (maCachedSize.second == 1  maCachedSize.first == 1)
 {
 rC = 0;
 rR = 0;
 return true;
 }
-else if (aDims.second == 1  rR  aDims.first)
+else if (maCachedSize.second == 1  rR  maCachedSize.first)
 {
 // single column matrix.
 rC = 0;
 return true;
 }
-else if (aDims.first == 1  rC  aDims.second)
+else if (maCachedSize.first == 1  rC  maCachedSize.second)
 {
 // single row matrix.
 rR = 0;
@@ -639,8 +638,7 @@ bool ScMatrixImpl::IsNumeric() const
 
 void ScMatrixImpl::MatCopy(ScMatrixImpl mRes) const
 {
-MatrixImplType::size_pair_type s1 = maMat.size(), s2 = mRes.maMat.size();
-if (s1.first  s2.first || s1.second  s2.second)
+if (maCachedSize.first  mRes.maCachedSize.first || maCachedSize.second  
mRes.maCachedSize.second)
 {
 // destination matrix is not large enough.
 OSL_FAIL(ScMatrixImpl::MatCopy: dimension error);
@@ -648,12 +646,14 @@ void ScMatrixImpl::MatCopy(ScMatrixImpl mRes) const
 }
 
 mRes.maMat.assign(maMat);
+mRes.maCachedSize = mRes.maMat.size();
 }
 
 void ScMatrixImpl::MatTrans(ScMatrixImpl mRes) const
 {
 mRes.maMat = maMat;
 mRes.maMat.transpose();
+mRes.maCachedSize = mRes.maMat.size();
 }
 
 void ScMatrixImpl::FillDouble( double fVal, SCSIZE nC1, SCSIZE nR1, SCSIZE 
nC2, SCSIZE nR2 )
@@ -720,8 +720,7 @@ template typename _Evaluator
 bool EvalMatrix(const MatrixImplType rMat)
 {
 _Evaluator aEval;
-pairsize_t,size_t aDim = rMat.size();
-size_t nRows = aDim.first, nCols = aDim.second;
+size_t nRows = rMat.size().first, nCols = rMat.size().second;
 for (size_t i = 0; i  nRows; ++i)
 {
 for (size_t j = 0; j  nCols; ++j)
@@ -911,7 +910,7 @@ size_t ScMatrixImpl::Count(bool bCountStrings) const
 
 void ScMatrixImpl::CalcPosition(SCSIZE nIndex, SCSIZE rC, SCSIZE rR) const
 {
-SCSIZE nRowSize = maMat.size().first;
+SCSIZE nRowSize = maCachedSize.first;
 rC = nIndex / nRowSize;
 rR = nIndex - rC*nRowSize;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-22 Thread Markus Mohrhard
 sc/source/filter/html/htmlexp.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit c4744121f12fde51de2d92d2442d590d93725ffc
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 23 04:27:45 2012 +0100

increase nCol before next iteratation to prevent loop, fdo#46220

diff --git a/sc/source/filter/html/htmlexp.cxx 
b/sc/source/filter/html/htmlexp.cxx
index 538eb09..af0689a 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -769,7 +769,11 @@ void ScHTMLExport::WriteTables()
 while( nCol = nEndCol )
 {
 if( pDoc-ColHidden(nCol, nTab) )
+{
+++nCol;
 continue;
+}
+
 if( nWidth != ToPixel( pDoc-GetColWidth( nCol, nTab ) ) )
 {
 if( nSpan != 0 )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-21 Thread Stephan Bergmann
 sc/source/ui/inc/formula.hxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 706ac4779de1870cf0d922f1cc3f6d4470392403
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Mar 21 16:14:45 2012 +0100

Make sure one base class does not use another one after destruction

The original code lead to invoking a pure virtual function in Calc when
doing Ctrl-F2, ESC.

diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx
index 07b86ff..f8969c5 100644
--- a/sc/source/ui/inc/formula.hxx
+++ b/sc/source/ui/inc/formula.hxx
@@ -56,9 +56,12 @@ class SvLBoxEntry;
 typedef ScTabViewShell* PtrTabViewShell;
 //
 
-class ScFormulaDlg : public formula::FormulaDlg,
- public IAnyRefDialog,
- public formula::IFormulaEditorHelper
+// Order of base classes is important, as pointer to IFormulaEditorHelper base
+// is passed into constructor of FormulaDlg base, which expects the former to
+// outlive itself:
+class ScFormulaDlg : public formula::IFormulaEditorHelper,
+ public formula::FormulaDlg,
+ public IAnyRefDialog
 {
 ScFormulaReferenceHelper m_aHelper;
 ScFormulaCell*  pCell;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-20 Thread Kohei Yoshida
 sc/source/filter/excel/xepivot.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit aeed13079e9cfd95a25b9b4faac6c95b0b4c8f23
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 21 00:42:15 2012 -0400

Export to xls correct item values for grouped fields.

diff --git a/sc/source/filter/excel/xepivot.cxx 
b/sc/source/filter/excel/xepivot.cxx
index 324f802..df41e8c 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -548,18 +548,22 @@ void XclExpPCField::InsertNumDateGroupItems( const 
ScDPObject rDPObj, const ScD
 return;
 
 ScSheetDPData aDPData(GetDocPtr(), *pSrcDesc, pCache);
-const std::vector SCROW  aOrignial = aDPData.GetColumnEntries( 
static_cast long ( GetBaseFieldIndex() ) );
+long nDim = GetFieldIndex();
+const std::vector SCROW  aOrignial = aDPData.GetColumnEntries(nDim);
 // get the string collection with generated grouping elements
 ScDPNumGroupDimension aTmpDim( rNumInfo );
 if( nDatePart != 0 )
 aTmpDim.MakeDateHelper( rNumInfo, mnFieldIdx, nDatePart );
 const std::vectorSCROW aMemberIds = aTmpDim.GetNumEntries(
-static_castSCCOL(GetBaseFieldIndex()), 
aDPData.GetCacheTable().getCache());
+static_castSCCOL(nDim), pCache);
 for ( size_t  nIdx = 0 ; nIdx  aMemberIds.size(); nIdx++ )
 {
-const ScDPItemData* pData = aDPData.GetMemberById(  static_cast 
long ( GetBaseFieldIndex() ) , aMemberIds[ nIdx] );
+const ScDPItemData* pData = aDPData.GetMemberById(nDim , 
aMemberIds[nIdx]);
 if ( pData )
-InsertGroupItem( new XclExpPCItem( pData-GetString() ) );
+{
+rtl::OUString aStr = pCache-GetFormattedString(nDim, *pData);
+InsertGroupItem(new XclExpPCItem(aStr));
+}
 }
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-19 Thread Kohei Yoshida
 sc/source/core/data/dpobject.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit f1a2c10b72a87a3826861562430fc80e3ffd6048
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Mon Mar 19 19:12:57 2012 -0400

Fix a crash on launching the pivot layout dialog with duplicated data 
fields.

diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 6348b7f..9da61d1 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2058,6 +2058,9 @@ bool ScDPObject::FillLabelDataForDimension(
 rLabelData.mnOriginalDim = static_castlong(nOrigPos);
 rLabelData.maLayoutName = aLayoutName;
 rLabelData.maSubtotalName = aSubtotalName;
+if (nOrigPos = 0)
+// This is a duplicated dimension. Use the original dimension 
index.
+nDim = nOrigPos;
 GetHierarchies(nDim, rLabelData.maHiers);
 GetMembers(nDim, GetUsedHierarchy(nDim), rLabelData.maMembers);
 lcl_FillLabelData(rLabelData, xDimProp);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-18 Thread Lubos Lunak
 sc/source/filter/excel/xiescher.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 89d3de59abdd218750d78bbf80a6f07f7a13f31c
Author: Luboš Luňák l.lu...@suse.cz
Date:   Sun Mar 18 08:02:08 2012 +0100

match if-else properly (warnings are actually sometimes useful, huh)

diff --git a/sc/source/filter/excel/xiescher.cxx 
b/sc/source/filter/excel/xiescher.cxx
index f049f25..6c8eb50 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -2634,9 +2634,11 @@ void XclImpListBoxObj::DoProcessControl( ScfPropertySet 
rPropSet ) const
 
 // multi selection: API expects sequence of list entry indexes
 if( bMultiSel )
+{
 for( ScfUInt8Vec::const_iterator aBeg = maSelection.begin(), aIt = 
aBeg, aEnd = maSelection.end(); aIt != aEnd; ++aIt )
 if( *aIt != 0 )
 aSelVec.push_back( static_cast sal_Int16 ( aIt - aBeg ) 
);
+}
 // single selection: mnSelEntry is one-based, API expects zero-based
 else if( mnSelEntry  0 )
 aSelVec.push_back( static_cast sal_Int16 ( mnSelEntry - 1 ) );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-18 Thread Julien Nabet
 sc/source/ui/unoobj/filtuno.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fa2cccb7cb334bb78bab6fd02b08021a2a94f201
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Mar 18 10:47:43 2012 +0100

Reduce scope of nChar

diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index 4fe9f0f..16fb7ed 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -82,7 +82,6 @@ SC_SIMPLE_SERVICE_INFO( ScFilterOptionsObj, 
SCFILTEROPTIONSOBJ_IMPLNAME, SCFILTE
 
 static void load_CharSet( rtl_TextEncoding nCharSet, bool bExport )
 {
-sal_Int32 nChar = 0;
 SequenceAny aValues;
 const Any *pProperties;
 SequenceOUString aNames(1);
@@ -99,6 +98,7 @@ static void load_CharSet( rtl_TextEncoding nCharSet, bool 
bExport )
 
 if( pProperties[0].hasValue() )
 {
+sal_Int32 nChar = 0;
 pProperties[0] = nChar;
 if( nChar = 0)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-18 Thread Julien Nabet
 sc/source/core/data/dpitemdata.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2b24cfe22d5d29645d2d926251c29514887fe3a9
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Mar 18 15:38:33 2012 +0100

Fix Same expression on both sides of '=='

diff --git a/sc/source/core/data/dpitemdata.cxx 
b/sc/source/core/data/dpitemdata.cxx
index fe2c540..be4ef7e 100644
--- a/sc/source/core/data/dpitemdata.cxx
+++ b/sc/source/core/data/dpitemdata.cxx
@@ -214,7 +214,7 @@ bool ScDPItemData::IsCaseInsEqual(const ScDPItemData r) 
const
 }
 
 if (mbStringInterned  r.mbStringInterned)
-return mpString == mpString;
+return mpString == r.mpString;
 
 return ScGlobal::GetpTransliteration()-isEqual(GetString(), 
r.GetString());
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-18 Thread Rafael Dominguez
 sc/source/ui/inc/ScDevChart.hxx |   87 
 1 file changed, 87 deletions(-)

New commits:
commit 4e43ad788b308a6ce8369b8e061cda6d5f7523de
Author: Rafael Dominguez venccsra...@gmail.com
Date:   Sun Mar 18 16:34:23 2012 +

Remove deprecated class DevChartConfigItem.

diff --git a/sc/source/ui/inc/ScDevChart.hxx b/sc/source/ui/inc/ScDevChart.hxx
deleted file mode 100644
index 5f60bce..000
--- a/sc/source/ui/inc/ScDevChart.hxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- *
- * 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
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * http://www.openoffice.org/license.html
- * for a copy of the LGPLv3 License.
- *
- /
-#ifndef INCLUDED_DEVCHARTCONFIG_HXX
-#define INCLUDED_DEVCHARTCONFIG_HXX
-
-#include unotools/configitem.hxx
-
-namespace ScDevChart
-{
-
-class DevChartConfigItem : public ::utl::ConfigItem
-{
-public:
-DevChartConfigItem() :
-ConfigItem( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
Office.Common/Internal )),
-CONFIG_MODE_IMMEDIATE_UPDATE )
-{}
-
-bool UseDevelopmentChart();
-};
-
-bool DevChartConfigItem::UseDevelopmentChart()
-{
-bool bResult = false;
-
-::com::sun::star::uno::Sequence ::rtl::OUString  aNames( 1 );
-aNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
DevelopmentChart ));
-
-::com::sun::star::uno::Sequence ::com::sun::star::uno::Any  aResult( 
GetProperties( aNames ));
-
-OSL_ASSERT( aResult.getLength());
-aResult[0] = bResult;
-
-return bResult;
-}
-
-/** States whether the new chart implementation or the old one should be used.
-If TRUE/ is returned the newly developed chart (chart2) should be used.
-If FALSE/ is returned, the old chart (sch) should be used.
-
-Config-Item: Office.Common/Internal:DevelopmentChart
-
-This function (the complete header) is only for a transitional period.  It
-will be deprecated after the new chart is definitely integrated into the
-product.
- */
-bool UseDevChart()
-{
-// static DevChartConfigItem aCfgItem;
-// return aCfgItem.UseDevelopmentChart();
-
-// ignore configuration
-//@todo: get rid of this class
-return true;
-}
-
-} // namespace ScDevChart
-
-// INCLUDED_DEVCHARTCONFIG_HXX
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-16 Thread Markus Mohrhard
 sc/source/ui/view/viewfun5.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit bd8be4eae82525434454cc3c7274f7a7a44158c0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 16 10:45:01 2012 +0100

don't paste content if user cancels html import, fdo#47393

diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index fa305a5..2456402 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -323,9 +323,15 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
 
aOptions.SetDetectSpecialNumber(pDlg-IsDateConversionSet());
 aObj.SetExtOptions(aOptions);
 }
+else
+{
+// prevent error dialog for user cancel action
+bRet = true;
+}
 }
+if(!bRet)
+bRet = aObj.ImportStream( *xStream, String(), nFormatId );
 // mba: clipboard always must contain absolute URLs (could be 
from alien source)
-bRet = aObj.ImportStream( *xStream, String(), nFormatId );
 }
 else if (nFormatId == FORMAT_STRING  aDataHelper.GetString( 
nFormatId, aStr ))
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-16 Thread Kohei Yoshida
 sc/source/filter/xml/xmldpimp.cxx |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 3ae3f098ed4e6495c0be0748dacf03dd8e0fe091
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Sat Mar 17 00:07:33 2012 -0400

Fixed potential memory leak  UniString removal.

diff --git a/sc/source/filter/xml/xmldpimp.cxx 
b/sc/source/filter/xml/xmldpimp.cxx
index ee8e3aa..8fa7312 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -1037,11 +1037,14 @@ SvXMLImportContext 
*ScXMLDataPilotFieldContext::CreateChildContext( sal_uInt16 n
 void ScXMLDataPilotFieldContext::AddMember(ScDPSaveMember* pMember)
 {
 if (pDim)
+{
 pDim-AddMember(pMember);
-
-if (!pMember-GetIsVisible())
-// This member is hidden.
-mbHasHiddenMember = true;
+if (!pMember-GetIsVisible())
+// This member is hidden.
+mbHasHiddenMember = true;
+}
+else
+delete pMember;
 }
 
 void ScXMLDataPilotFieldContext::SetSubTotalName(const OUString rName)
@@ -1636,7 +1639,7 @@ void ScXMLDataPilotMemberContext::EndElement()
 {
 if (bHasName)   // #i53407# don't check sName, empty name is allowed
 {
-ScDPSaveMember* pMember = new ScDPSaveMember(String(sName));
+ScDPSaveMember* pMember = new ScDPSaveMember(sName);
 if (!maDisplayName.isEmpty())
 pMember-SetLayoutName(maDisplayName);
 pMember-SetIsVisible(bDisplay);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-15 Thread David Tardon
 sc/source/core/data/document.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 32dc82b9d456ed92ba946611239349ab0e424e2a
Author: David Tardon dtar...@redhat.com
Date:   Thu Mar 15 09:43:26 2012 +0100

fdo#47311 don't crash when pasting into more than 1 sheet

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 2a5c751..60ba818 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2277,7 +2277,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW 
nRow1,
 while ( i + nFollow  nTabEnd
  rMark.GetTableSelect( i + nFollow + 1 )
  nClipTab + nFollow  MAXTAB
- rClipTabs[nClipTab + nFollow + 1] )
+ rClipTabs[(nClipTab + nFollow + 1) % 
static_castSCTAB(rClipTabs.size())] )
 ++nFollow;
 
 if ( pCBFCP-pClipDoc-GetClipParam().mbCutMode )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-15 Thread Ivan Timofeev
 sc/source/filter/html/htmlpars.cxx |3 ++-
 sc/source/filter/inc/eeparser.hxx  |8 +---
 sc/source/filter/rtf/eeimpars.cxx  |   28 
 3 files changed, 23 insertions(+), 16 deletions(-)

New commits:
commit 96328945afe8f920df41741931163ba56b7b2820
Author: Noel Grandin n...@peralex.com
Date:   Wed Mar 14 14:00:35 2012 +0200

Convert tools/table.hxx to std::map in ScEEParser class in SC module

diff --git a/sc/source/filter/html/htmlpars.cxx 
b/sc/source/filter/html/htmlpars.cxx
index 323e1a2..b9f9fb8 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -58,6 +58,7 @@
 #include vcl/svapp.hxx
 #include tools/urlobj.hxx
 #include tools/tenccvt.hxx
+#include tools/table.hxx
 
 #include htmlpars.hxx
 #include global.hxx
@@ -331,7 +332,7 @@ sal_uLong ScHTMLLayoutParser::Read( SvStream rStream, 
const String rBaseURL )
 {
 aSize.Width() = *pOff - nOff;
 aSize = pDefaultDev-PixelToLogic( aSize, MapMode( MAP_TWIP ) );
-pColWidths-Insert( j-1, (void*)aSize.Width() );
+maColWidths[ j-1 ] = aSize.Width();
 nOff = *pOff;
 }
 return nErr;
diff --git a/sc/source/filter/inc/eeparser.hxx 
b/sc/source/filter/inc/eeparser.hxx
index dc1daf1..9c272d0 100644
--- a/sc/source/filter/inc/eeparser.hxx
+++ b/sc/source/filter/inc/eeparser.hxx
@@ -32,7 +32,6 @@
 #include tools/string.hxx
 #include tools/gen.hxx
 #include vcl/graph.hxx
-#include tools/table.hxx
 #include svl/itemset.hxx
 #include editeng/editdata.hxx
 #include address.hxx
@@ -108,6 +107,8 @@ struct ScEEParseEntry
 
 class EditEngine;
 
+typedef std::mapSCCOL, sal_uInt16 ColWidthsMap;
+
 class ScEEParser
 {
 protected:
@@ -116,7 +117,7 @@ protected:
 SfxItemPool*pDocPool;
 ::std::vector ScEEParseEntry*  maList;
 ScEEParseEntry* pActEntry;
-Table*  pColWidths;
+ColWidthsMapmaColWidths;
 int nLastToken;
 SCCOL   nColCnt;
 SCROW   nRowCnt;
@@ -131,7 +132,8 @@ public:
 
 virtual sal_uLong   Read( SvStream, const String rBaseURL ) = 0;
 
-Table*  GetColWidths() const { return pColWidths; }
+const ColWidthsMap GetColWidths() const { return maColWidths; }
+ColWidthsMap   GetColWidths() { return maColWidths; }
 voidGetDimensions( SCCOL nCols, SCROW nRows ) const
 { nCols = nColMax; nRows = nRowMax; }
 
diff --git a/sc/source/filter/rtf/eeimpars.cxx 
b/sc/source/filter/rtf/eeimpars.cxx
index 2fb0484..d34e135 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -52,6 +52,7 @@
 #include unotools/syslocale.hxx
 #include unotools/charclass.hxx
 #include comphelper/string.hxx
+#include tools/table.hxx
 
 #include eeimport.hxx
 #include global.hxx
@@ -431,14 +432,17 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, 
double nOutputFactor,
 if ( bSizeColsRows )
 {
 // Spaltenbreiten
-Table* pColWidths = mpParser-GetColWidths();
-if ( pColWidths-Count() )
+ColWidthsMap rColWidths = mpParser-GetColWidths();
+if ( !rColWidths.empty() )
 {
 nProgress = 0;
 pProgress-SetState( nProgress, nEndCol - nStartCol + 1 );
 for ( SCCOL nCol = nStartCol; nCol = nEndCol; nCol++ )
 {
-sal_uInt16 nWidth = (sal_uInt16)(sal_uLong) pColWidths-Get( 
nCol );
+sal_uInt16 nWidth = 0;
+ColWidthsMap::const_iterator it = rColWidths.find( nCol );
+if ( it != rColWidths.end() )
+nWidth = it-second;
 if ( nWidth )
 mpDoc-SetColWidth( nCol, nTab, nWidth );
 pProgress-SetState( ++nProgress );
@@ -513,20 +517,22 @@ sal_Bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, 
SCTAB /*nTab*/, ScEEPa
 nDir = pI-nDir;
 }
 // Spaltenbreiten
-Table* pColWidths = mpParser-GetColWidths();
-long nThisWidth = (long) pColWidths-Get( nCol );
+ColWidthsMap rColWidths = mpParser-GetColWidths();
+long nThisWidth = 0;
+ColWidthsMap::const_iterator it = rColWidths.find( nCol );
+if ( it != rColWidths.end() )
+nThisWidth = it-second;
 long nColWidths = nThisWidth;
 SCCOL nColSpanCol = nCol + pE-nColOverlap;
 for ( SCCOL nC = nCol + 1; nC  nColSpanCol; nC++ )
 {
-nColWidths += (long) pColWidths-Get( nC );
+ColWidthsMap::const_iterator it2 = rColWidths.find( nC   );
+if ( it2 != rColWidths.end() )
+nColWidths += it2-second;
 }
 if ( nWidth  nColWidths )
 {   // Differenz nur in der ersten Spalte eintragen
-if ( nThisWidth )
-pColWidths-Replace( nCol, (void*)(nWidth - nColWidths + 
nThisWidth) );
-else
-pColWidths-Insert( nCol, (void*)(nWidth - nColWidths) );
+

[Libreoffice-commits] .: sc/source

2012-03-15 Thread Noel Power
 sc/source/ui/app/inputhdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e3b1592165d0513e90e28dfee92bc9db032fa221
Author: Noel Power noel.po...@novell.com
Date:   Thu Mar 15 20:10:12 2012 +

fix to update inputbar when setting a range for a formula fdo#46809

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 29a40c5..7232ad3 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1811,7 +1811,7 @@ void ScInputHandler::UpdateActiveView()
 else
 pTableView = NULL;
 
-if (pInputWin  pInputWin-IsInputActive())
+if (pInputWin  eMode == SC_INPUT_TOP )
 pTopView = pInputWin-GetEditView();
 else
 pTopView = NULL;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-15 Thread Andras Timar
 sc/source/ui/view/prevwsh.cxx  |7 ++-
 sc/source/ui/view/printfun.cxx |7 ++-
 sc/source/ui/view/tabvwsh4.cxx |8 +++-
 3 files changed, 19 insertions(+), 3 deletions(-)

New commits:
commit 010560f553ee361ccda4bd14f1ee6b3f18250847
Author: Szabolcs Dezsi dezsisz...@hotmail.com
Date:   Thu Mar 15 15:23:17 2012 +0100

i#84393 Fix title field in header, footer

According to help Title should be the Title property of the document,
not the file name without extension. If that property is missing, we
fall back to file name without extension.

diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index ccb10ee..85dd306 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -77,6 +77,7 @@
 
 #include basegfx/tools/zoomtools.hxx
 #include svx/zoom_def.hxx
+#include com/sun/star/document/XDocumentProperties.hpp
 
 #include sc.hrc
 #include scabstdlg.hxx
@@ -844,7 +845,11 @@ void ScPreviewShell::FillFieldData( ScHeaderFieldData 
rData )
 pDoc-GetName(nTab, aTmp);
 rData.aTabName = aTmp;
 
-rData.aTitle= pDocShell-GetTitle();
+if( pDocShell-getDocProperties()-getTitle().getLength() != 0 )
+rData.aTitle = pDocShell-getDocProperties()-getTitle();
+else
+rData.aTitle = pDocShell-GetTitle();
+
 const INetURLObject rURLObj = pDocShell-GetMedium()-GetURLObject();
 rData.aLongDocName  = rURLObj.GetMainURL( 
INetURLObject::DECODE_UNAMBIGUOUS );
 if ( rData.aLongDocName.Len() )
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 01f1b5b..9d82ba5 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -83,6 +83,7 @@
 #include vcl/lineinfo.hxx
 
 #include boost/scoped_ptr.hpp
+#include com/sun/star/document/XDocumentProperties.hpp
 
 #define ZOOM_MIN10
 
@@ -1037,7 +1038,11 @@ void ScPrintFunc::InitParam( const ScPrintOptions* 
pOptions )
 
 SetDateTime( Date( Date::SYSTEM ), Time( Time::SYSTEM ) );
 
-aFieldData.aTitle   = pDocShell-GetTitle();
+if( pDocShell-getDocProperties()-getTitle().getLength() != 0 )
+aFieldData.aTitle = pDocShell-getDocProperties()-getTitle();
+else
+aFieldData.aTitle = pDocShell-GetTitle();
+
 const INetURLObject rURLObj = pDocShell-GetMedium()-GetURLObject();
 aFieldData.aLongDocName = rURLObj.GetMainURL( 
INetURLObject::DECODE_UNAMBIGUOUS );
 if ( aFieldData.aLongDocName.Len() )
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index cf93d15..35c2c54 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -97,6 +97,8 @@
 #include markdata.hxx
 #include preview.hxx
 
+#include com/sun/star/document/XDocumentProperties.hpp
+
 void ActivateOlk( ScViewData* pViewData );
 void DeActivateOlk( ScViewData* pViewData );
 
@@ -1824,7 +1826,11 @@ void ScTabViewShell::FillFieldData( ScHeaderFieldData 
rData )
 pDoc-GetName(nTab, aTmp);
 rData.aTabName = aTmp;
 
-rData.aTitle= pDocShell-GetTitle();
+if( pDocShell-getDocProperties()-getTitle().getLength() != 0 )
+rData.aTitle = pDocShell-getDocProperties()-getTitle();
+else
+rData.aTitle = pDocShell-GetTitle();
+
 const INetURLObject rURLObj = pDocShell-GetMedium()-GetURLObject();
 rData.aLongDocName  = rURLObj.GetMainURL( 
INetURLObject::DECODE_UNAMBIGUOUS );
 if ( rData.aLongDocName.Len() )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-14 Thread Kohei Yoshida
 sc/source/ui/docshell/dbdocfun.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit f6cba0dbb3819cf2e11f72bc0cdb10d5d90721de
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Wed Mar 14 11:27:17 2012 -0400

We need to manually clear the table data in presence of group fields.

There was a hack that did this in ScDPObject, which I removed.  But we
still need to do the same except this time it's outside of ScDPObject.

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 2881e1d..c1464b1 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1460,6 +1460,11 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* 
pDPObj, bool bApi)
 if (!pDPs)
 return 0;
 
+bool bHasGroups = false;
+ScDPSaveData* pSaveData = pDPObj-GetSaveData();
+if (pSaveData  pSaveData-GetExistingDimensionData())
+bHasGroups = true;
+
 std::setScDPObject* aRefs;
 sal_uLong nErrId = pDPs-ReloadCache(pDPObj, aRefs);
 if (nErrId)
@@ -1469,6 +1474,10 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* 
pDPObj, bool bApi)
 for (; it != itEnd; ++it)
 {
 ScDPObject* pObj = *it;
+if (bHasGroups)
+// Re-build table data for each pivot table when the original 
contains group fields.
+pObj-ClearTableData();
+
 // This action is intentionally not undoable since it modifies cache.
 DataPilotUpdate(pObj, pObj, false, bApi);
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-12 Thread Markus Mohrhard
 sc/source/ui/app/transobj.cxx   |3 ---
 sc/source/ui/docshell/impex.cxx |   20 ++--
 2 files changed, 14 insertions(+), 9 deletions(-)

New commits:
commit 2a26fe4a39b6f3b2af269b801340c32c28806250
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 13 01:19:48 2012 +0100

only shrink to used area in text export, fdo#46230, related n#677811

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 38afe52..b52ca6f 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -172,9 +172,6 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const 
TransferableObjectDesc
 }
 OSL_ENSURE(!bFirst, no sheet selected);
 
-if (!pDoc-GetClipParam().isMultiRange()  nTab1 == nTab2)
-pDoc-ShrinkToDataArea( nTab1, nCol1, nRow1, nCol2, nRow2 );
-
 //  only limit to used cells if whole sheet was marked
 //  (so empty cell areas can be copied)
 if ( nCol2=MAXCOL  nRow2=MAXROW )
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 7bb959e..d4a8f80 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -70,6 +70,7 @@ class StarBASIC;
 #include editable.hxx
 #include compiler.hxx
 #include warnbox.hxx
+#include clipparam.hxx
 
 #include impex.hxx
 
@@ -1437,26 +1438,33 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 SCROW nRow;
 SCCOL nStartCol = aRange.aStart.Col();
 SCROW nStartRow = aRange.aStart.Row();
+SCTAB nStartTab = aRange.aStart.Tab();
 SCCOL nEndCol = aRange.aEnd.Col();
 SCROW nEndRow = aRange.aEnd.Row();
+SCTAB nEndTab = aRange.aEnd.Tab();
+
+if (!pDoc-GetClipParam().isMultiRange()  nStartTab == nEndTab)
+pDoc-ShrinkToDataArea( nStartTab, nStartCol, nStartRow, nEndCol, 
nEndRow );
+
 String aCell;
+
 bool bConvertLF = (GetSystemLineEnd() != LINEEND_LF);
 
 for (nRow = nStartRow; nRow = nEndRow; nRow++)
 {
-if (bIncludeFiltered || !pDoc-RowFiltered( nRow, aRange.aStart.Tab() 
))
+if (bIncludeFiltered || !pDoc-RowFiltered( nRow, nStartTab ))
 {
 for (nCol = nStartCol; nCol = nEndCol; nCol++)
 {
 CellType eType;
-pDoc-GetCellType( nCol, nRow, aRange.aStart.Tab(), eType );
+pDoc-GetCellType( nCol, nRow, nStartTab, eType );
 switch (eType)
 {
 case CELLTYPE_FORMULA:
 {
 if (bFormulas)
 {
-pDoc-GetFormula( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetFormula( nCol, nRow, nStartTab, aCell );
 if( aCell.Search( cSep ) != STRING_NOTFOUND )
 lcl_WriteString( rStrm, aCell, cStr, cStr );
 else
@@ -1464,7 +1472,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 }
 else
 {
-pDoc-GetString( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetString( nCol, nRow, nStartTab, aCell );
 
 bool bMultiLineText = ( aCell.Search( _LF ) != 
STRING_NOTFOUND );
 if( bMultiLineText )
@@ -1487,7 +1495,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 break;
 case CELLTYPE_VALUE:
 {
-pDoc-GetString( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetString( nCol, nRow, nStartTab, aCell );
 lcl_WriteSimpleString( rStrm, aCell );
 }
 break;
@@ -1496,7 +1504,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 break;
 default:
 {
-pDoc-GetString( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetString( nCol, nRow, nStartTab, aCell );
 
 bool bMultiLineText = ( aCell.Search( _LF ) != 
STRING_NOTFOUND );
 if( bMultiLineText )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-10 Thread Julien Nabet
 sc/source/core/data/dptabsrc.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 4c5fd7a27b5337c4da4f02133c2d023d4caebe66
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Mar 10 19:03:32 2012 +0100

Fix : statement following break will never be executed

diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index 3d41f86..65d70c7 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -2527,8 +2527,6 @@ ScDPMember* ScDPMembers::getByIndex(long nIndex) const
 case SC_DAPI_LEVEL_DAY:
 nGroupBy = sheet::DataPilotFieldGroupBy::DAYS;
 break;
-nGroupBy = sheet::DataPilotFieldGroupBy::YEARS;
-break;
 default:
 ;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-10 Thread Julien Nabet
 sc/source/ui/vba/vbaapplication.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 638f68e68a1810ba3a3cd603c509745360b2ef8d
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Mar 10 19:57:24 2012 +0100

Fix Prefer prefix ++/-- operators for non-primitive types

diff --git a/sc/source/ui/vba/vbaapplication.cxx 
b/sc/source/ui/vba/vbaapplication.cxx
index b51623c..c674791 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -1667,7 +1667,7 @@ ScVbaApplication::GetSaveAsFilename( const 
::com::sun::star::uno::Any InitialFi
 {
 break;
 }
-aIt++;
+++aIt;
 }
 if ( !bValidFilter )
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-10 Thread Julien Nabet
 sc/source/ui/vba/vbarange.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c604a738f48ffa4c12f7c9801d03a146303d3123
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Mar 10 19:58:39 2012 +0100

Fix Possible null pointer dereference

diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 6ae2d08..d8c3a9f 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -4527,10 +4527,10 @@ ScVbaRange::AutoFilter( const uno::Any Field, const 
uno::Any Criteria1, const
 if ( xCurrent.is() )
 {
 ScVbaRange* pRange = getImplementation( xCurrent );
-if ( pRange-isSingleCellRange() )
-throw uno::RuntimeException( rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM(Can't create AutoFilter) ), uno::Reference 
uno::XInterface () );
 if ( pRange )
 {
+if ( pRange-isSingleCellRange() )
+   throw uno::RuntimeException( rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM(Can't create AutoFilter) ), uno::Reference 
uno::XInterface () );
 RangeHelper currentRegion( pRange-mxRange );
 autoFiltAddress = 
currentRegion.getCellRangeAddressable()-getRangeAddress();
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source svx/source

2012-03-09 Thread Cédric Bosdonnat
 sc/source/ui/view/formatsh.cxx   |9 +
 svx/source/tbxctrls/tbcontrl.cxx |4 
 2 files changed, 13 insertions(+)

New commits:
commit 0466a30ca52dc531887c75e2d42b007cc83778f3
Author: Winfried Donkers o...@dci-electronics.nl
Date:   Wed Mar 7 17:39:03 2012 +0100

fdo#45671 fix for transparent colour split button

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 61522d6..dc75138 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1435,6 +1435,15 @@ void ScFormatShell::ExecuteAttr( SfxRequest rReq )
 pTabViewShell-ExecuteCellFormatDlg( rReq, TP_FONT );   // 
wenn ToolBar vertikal
 break;
 
+case SID_BACKGROUND_COLOR:
+{
+SvxBrushItem aBrushItem( (const SvxBrushItem)
+ 
pTabViewShell-GetSelectionPattern()-GetItem( ATTR_BACKGROUND ) );
+aBrushItem.SetColor( COL_TRANSPARENT );
+pTabViewShell-ApplyAttr( aBrushItem );
+}
+break;
+
 case SID_ATTR_ALIGN_LINEBREAK:  // ohne Parameter 
als Toggle
 {
 const ScPatternAttr* pAttrs = 
pTabViewShell-GetSelectionPattern();
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index b434e00..0ecf87d 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2250,6 +2250,10 @@ SvxColorExtToolBoxControl::SvxColorExtToolBoxControl(
 switch( nSlotId )
 {
 case SID_ATTR_CHAR_COLOR:
+addStatusListener( OUString( RTL_CONSTASCII_USTRINGPARAM( 
.uno:Color )));
+nMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW;
+break;
+
 case SID_ATTR_CHAR_COLOR2:
 addStatusListener( OUString( RTL_CONSTASCII_USTRINGPARAM( 
.uno:CharColorExt )));
 nMode = TBX_UPDATER_MODE_CHAR_COLOR_NEW;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-08 Thread Markus Mohrhard
 sc/source/ui/attrdlg/condfrmt.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit f361431f944abd9e12fad80f4880fa111214ff06
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 9 01:17:13 2012 +0100

Set entries correctly visible, fdo#47102

diff --git a/sc/source/ui/attrdlg/condfrmt.cxx 
b/sc/source/ui/attrdlg/condfrmt.cxx
index 54d7a4b..ca41c8f 100644
--- a/sc/source/ui/attrdlg/condfrmt.cxx
+++ b/sc/source/ui/attrdlg/condfrmt.cxx
@@ -647,6 +647,8 @@ IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond11Hdl)
 aRbCond12.Hide();
 aRbCond11.SetPosPixel( aRBtn1Pos2 );
 aEdtCond11.SetPosSizePixel( aCond1Pos1, aCond1Size1 );
+aEdtCond11.Show();
+aRbCond11.Show();
 }
 
 ChangeCond12Hdl( NULL );
@@ -742,6 +744,8 @@ IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond21Hdl)
 aRbCond22.Hide();
 aRbCond21.SetPosPixel( aRBtn2Pos2 );
 aEdtCond21.SetPosSizePixel( aCond2Pos1, aCond2Size1 );
+aEdtCond21.Show();
+aRbCond21.Show();
 }
 
 ChangeCond22Hdl( NULL );
@@ -839,6 +843,8 @@ IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond31Hdl)
 aRbCond32.Hide();
 aRbCond31.SetPosPixel( aRBtn3Pos2 );
 aEdtCond31.SetPosSizePixel( aCond3Pos1, aCond3Size1 );
+aEdtCond31.Show();
+aRbCond31.Show();
 }
 
 ChangeCond32Hdl( NULL );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-05 Thread Markus Mohrhard
 sc/source/ui/app/inputwin.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 77a517a467b3aa944e31b170162518f70da3793d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 6 01:16:43 2012 +0100

don't crash when scrolling in input line, fdo#46975

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 3a53bb0..c60b6ff 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1613,6 +1613,10 @@ void ScTextWnd::Command( const CommandEvent rCEvt )
 rBindings.Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
 }
 }
+else if ( nCommand == COMMAND_WHEEL )
+{
+//don't call InputChanged for COMMAND_WHEEL
+}
 else
 SC_MOD()-InputChanged( pEditView );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source svx/inc svx/source

2012-03-05 Thread Tor Lillqvist
 sc/source/ui/app/scdll.cxx |2 +-
 sc/source/ui/view/formatsh.cxx |2 +-
 svx/inc/svx/tbcontrl.hxx   |3 +++
 svx/source/tbxctrls/tbcontrl.cxx   |   15 +--
 svx/source/tbxctrls/tbxcolorupdate.cxx |1 +
 5 files changed, 19 insertions(+), 4 deletions(-)

New commits:
commit 4236f5e19c5d3f3a5007c7a596868d09a7e39bee
Author: Winfried Donkers o...@dci-electronics.nl
Date:   Mon Mar 5 17:24:40 2012 +0100

fdo#45688: Split button for Calc cell font color

diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index cb98122..ece5a1f 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -203,7 +203,7 @@ void ScDLL::Init()
 SvxStyleToolBoxControl  ::RegisterControl(SID_STYLE_APPLY, 
 pMod);
 SvxFontNameToolBoxControl   ::RegisterControl(SID_ATTR_CHAR_FONT,  
 pMod);
 //  SvxFontHeightToolBoxControl 
::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT, pMod);
-SvxFontColorToolBoxControl  ::RegisterControl(SID_ATTR_CHAR_COLOR, 
 pMod);
+SvxColorExtToolBoxControl   ::RegisterControl(SID_ATTR_CHAR_COLOR, 
 pMod);
 SvxColorExtToolBoxControl   ::RegisterControl(SID_BACKGROUND_COLOR,
 pMod);
 SvxFrameToolBoxControl  ::RegisterControl(SID_ATTR_BORDER, 
 pMod);
 SvxFrameLineStyleToolBoxControl ::RegisterControl(SID_FRAME_LINESTYLE, 
 pMod);
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index bc72117..61522d6 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1425,11 +1425,11 @@ void ScFormatShell::ExecuteAttr( SfxRequest rReq )
 sal_uInt16 nSlot = rReq.GetSlot();
 
 pTabViewShell-HideListBox();   // 
Autofilter-DropDown-Listbox
-
 if ( !pNewAttrs )
 {
 switch ( nSlot )
 {
+case SID_ATTR_CHAR_COLOR:
 case SID_ATTR_CHAR_FONT:
 case SID_ATTR_CHAR_FONTHEIGHT:
 pTabViewShell-ExecuteCellFormatDlg( rReq, TP_FONT );   // 
wenn ToolBar vertikal
diff --git a/svx/inc/svx/tbcontrl.hxx b/svx/inc/svx/tbcontrl.hxx
index 3f2bd39..8fb558e 100644
--- a/svx/inc/svx/tbcontrl.hxx
+++ b/svx/inc/svx/tbcontrl.hxx
@@ -74,6 +74,9 @@
 Execute-Id  SID_ATTR_CHAR_COLOR2
 and SID_ATTR_CHAR_COLOR_EXT
 
+for cell color (calc)
+Execute-Id  SID_ATTR_CHAR_COLOR
+
 for character background color (writer)
 Execute-Id  SID_ATTR_CHAR_COLOR_BACKGROUND
 and SID_ATTR_CHAR_COLOR_BACKGROUND_EXT
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index e366952..2a20d4a 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2325,6 +2325,7 @@ void SvxColorExtToolBoxControl::StateChanged(
 bChoiceFromPalette = sal_False;
 switch( nSID )
 {
+case SID_ATTR_CHAR_COLOR :
 case SID_ATTR_CHAR_COLOR2 :
 case SID_ATTR_CHAR_COLOR_BACKGROUND :
 case SID_BACKGROUND_COLOR :
@@ -2347,21 +2348,28 @@ void SvxColorExtToolBoxControl::Select( sal_Bool )
 {
 OUString aCommand;
 OUString aParamName;
+sal_Bool bNoArgs = sal_False;
 
 switch( GetSlotId() )
 {
 case SID_ATTR_CHAR_COLOR2 :
-case SID_ATTR_CHAR_COLOR  :
+bNoArgs = sal_True;
 aCommand= OUString( RTL_CONSTASCII_USTRINGPARAM( 
.uno:CharColorExt ));
 aParamName  = OUString( RTL_CONSTASCII_USTRINGPARAM( 
CharColorExt ));
 break;
 
+case SID_ATTR_CHAR_COLOR  :
+aCommand= OUString( RTL_CONSTASCII_USTRINGPARAM( .uno:Color 
));
+aParamName  = OUString( RTL_CONSTASCII_USTRINGPARAM( Color ));
+break;
+
 case SID_BACKGROUND_COLOR :
 aCommand= OUString( RTL_CONSTASCII_USTRINGPARAM( 
.uno:BackgroundColor ));
 aParamName  = OUString( RTL_CONSTASCII_USTRINGPARAM( 
BackgroundColor ));
 break;
 
 case SID_ATTR_CHAR_COLOR_BACKGROUND :
+bNoArgs = sal_True;
 aCommand= OUString( RTL_CONSTASCII_USTRINGPARAM( 
.uno:CharBackgroundExt ));
 aParamName  = OUString( RTL_CONSTASCII_USTRINGPARAM( 
CharBackgroundExt ));
 break;
@@ -2369,7 +2377,10 @@ void SvxColorExtToolBoxControl::Select( sal_Bool )
 
 Sequence PropertyValue  aArgs( 1 );
 aArgs[0].Name  = aParamName;
-aArgs[0].Value = makeAny( (sal_uInt32)( mLastColor.GetColor() ));
+if ( bNoArgs )
+aArgs[0].Value = makeAny( GetToolBox().IsItemChecked( GetId() ));
+else
+aArgs[0].Value = makeAny( (sal_uInt32)( mLastColor.GetColor() ));
 Dispatch( aCommand, aArgs );
 }
 
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx 
b/svx/source/tbxctrls/tbxcolorupdate.cxx
index 5c3453a..1b567d4 100644
--- a/svx/source/tbxctrls/tbxcolorupdate.cxx
+++ 

[Libreoffice-commits] .: sc/source

2012-03-04 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 569e8b8a9ea68588d1ae2b32596f3ce57f36ccf8
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 5 01:53:43 2012 +0100

fix copy/paste error

I can't express how dumb I feel after searching for hours for a bug in
the note handling and then it is just such a small copy/paste error

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 69021ce..4aa6dbe 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -374,7 +374,7 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, 
SCROW nEndRow, SCSIZE
 ScPostIt* pPostIt = itr-second;
 ++itr;
 
-if (nCol = nStartRow)
+if (nCol = nStartCol)
 {
 aNotes.insert(nCol + nSize, nRow, pPostIt);
 maNotes.ReleaseNote(nCol, nRow);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-04 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d3ebd8340f781b3e51bce6b8eeb2123ac026bedf
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 5 02:12:58 2012 +0100

well one copy/paste error is not enough

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 4aa6dbe..42f1b6e 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -184,7 +184,7 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, 
SCROW nStartRow, SCSIZE
 ScPostIt* pPostIt = itr-second;
 ++itr;
 
-if (nCol = nStartRow)
+if (nRow = nStartRow)
 {
 aNotes.insert(nCol, nRow + nSize, pPostIt);
 maNotes.ReleaseNote(nCol, nRow);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-04 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c0e58cdcac9c5138d2d6f84e4da97110eb397621
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 5 02:26:12 2012 +0100

and two more errors of the same kind

It is alarming that the Notes unit test did not fail for any of these
errors

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 42f1b6e..2b9d141 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -264,7 +264,7 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, 
SCROW nStartRow, SCSIZE
 ScPostIt* pPostIt = itr-second;
 ++itr;
 
-if (nCol = nStartRow)
+if (nRow = nStartRow)
 {
 aNotes.insert(nCol, nRow - nSize, pPostIt);
 maNotes.ReleaseNote(nCol, nRow);
@@ -483,7 +483,7 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, 
SCROW nEndRow, SCSIZE
 ScPostIt* pPostIt = itr-second;
 ++itr;
 
-if (nCol = nStartRow)
+if (nCol = nStartCol)
 {
 aNotes.insert(nCol - nSize, nRow, pPostIt);
 maNotes.ReleaseNote(nCol, nRow);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-02 Thread Markus Mohrhard
 sc/source/core/data/table3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 73e9eac0e86e4ab5dec09dfde890eca8760d298a
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 10:20:27 2012 +0100

add missing loop conditions

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index da43fbc..613bd6d 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -604,6 +604,7 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2)
 }
 
 itr = aNoteMap.begin();
+while(itr != aNoteMap.end())
 {
 //we can here assume that there is no note in the target location
 SCCOL nCol = itr-first.first;
@@ -667,6 +668,7 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
 }
 
 itr = aNoteMap.begin();
+while(itr != aNoteMap.end())
 {
 //we can here assume that there is no note in the target location
 SCCOL nCol = itr-first.first;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-01 Thread Markus Mohrhard
 sc/source/core/data/cell.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f7fbeac4cbb764ccd153f9aea37a07e66e96b809
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 1 12:59:14 2012 +0100

use the correct db range for the copy, fdo#46712

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 37285e7..bd616b1 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -218,7 +218,7 @@ void adjustDBRange(ScToken* pToken, ScDocument rNewDoc, 
const ScDocument* pOldD
 ScDBData* pNewDBData = aNewNamedDBs.findByName(aDBName);
 if (!pNewDBData)
 {
-pNewDBData = new ScDBData(*pNewDBData);
+pNewDBData = new ScDBData(*pDBData);
 aNewNamedDBs.insert(pNewDBData);
 }
 pToken-SetIndex(pNewDBData-GetIndex());
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source svx/source sw/source

2012-03-01 Thread Tor Lillqvist
 sc/source/ui/inc/tabvwsh.hxx   |4 
 sc/source/ui/view/formatsh.cxx |   22 ++
 sc/source/ui/view/tabvwsh4.cxx |1 -
 svx/source/tbxctrls/tbcontrl.cxx   |   12 +---
 svx/source/tbxctrls/tbxcolorupdate.cxx |   12 +++-
 sw/source/ui/docvw/edtwin.cxx  |6 --
 6 files changed, 18 insertions(+), 39 deletions(-)

New commits:
commit 085e8a07e61ef2d3a82e11094d8773ab17cfdb3c
Author: Winfried Donkers o...@dci-electronics.nl
Date:   Thu Mar 1 13:41:14 2012 +0100

fdo#45671 calc cell background color simplified code for split button

diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 1bd0fb1..05e6838 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -108,7 +108,6 @@ private:
 static sal_uInt16   nInsertCtrlState;
 static sal_uInt16   nInsCellsCtrlState;
 static sal_uInt16   nInsObjCtrlState;
-static ColoraBackgroundColor;
 
 SvxHtmlOptions  aHTMLOpt;
 ObjectSelectionType eCurOST;
@@ -424,9 +423,6 @@ public:
 
 boolExecuteRetypePassDlg(ScPasswordHash eDesiredHash);
 
-voidSetBackgroundColor( const Color aCol ) { aBackgroundColor = aCol; 
}
-Color   GetBackgroundColor(){ return aBackgroundColor; 
}
-
 using ScTabView::ShowCursor;
 
 // ugly hack to call Define Names from Manage Names
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 8a91f36..5ef7d4f 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1421,13 +1421,12 @@ void ScFormatShell::ExecuteAttr( SfxRequest rReq )
 ScTabViewShell* pTabViewShell   = GetViewData()-GetViewShell();
 SfxBindingsrBindings = pViewData-GetBindings();
 const SfxItemSet*   pNewAttrs = rReq.GetArgs();
+sal_uInt16 nSlot = rReq.GetSlot();
 
 pTabViewShell-HideListBox();   // 
Autofilter-DropDown-Listbox
 
 if ( !pNewAttrs )
 {
-sal_uInt16 nSlot = rReq.GetSlot();
-
 switch ( nSlot )
 {
 case SID_ATTR_CHAR_FONT:
@@ -1449,25 +1448,10 @@ void ScFormatShell::ExecuteAttr( SfxRequest rReq )
 rBindings.Invalidate( nSlot );
 }
 break;
-
-case SID_BACKGROUND_COLOR:
-{
-//  SID_BACKGROUND_COLOR without arguments - set 
background to last used color
-
-SvxBrushItemaBrushItem( (const SvxBrushItem)
-
pTabViewShell-GetSelectionPattern()-
-GetItem( ATTR_BACKGROUND ) );
-aBrushItem.SetColor( pTabViewShell-GetBackgroundColor()  
);
-
-pTabViewShell-ApplyAttr( aBrushItem );
-}
-break;
 }
 }
 else
 {
-sal_uInt16 nSlot = rReq.GetSlot();
-
 switch ( nSlot )
 {
 case SID_ATTR_CHAR_OVERLINE:
@@ -1642,9 +1626,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest rReq )
 
pTabViewShell-GetSelectionPattern()-
 GetItem( ATTR_BACKGROUND ) );
 
-Color aSet = rNewColorItem.GetValue();
-pTabViewShell-SetBackgroundColor( aSet );
-aBrushItem.SetColor( aSet );
+aBrushItem.SetColor( rNewColorItem.GetValue() );
 
 pTabViewShell-ApplyAttr( aBrushItem );
 }
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 5ad0d03..f8e2ab8 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -109,7 +109,6 @@ using namespace com::sun::star;
 sal_uInt16 ScTabViewShell::nInsertCtrlState = SID_INSERT_GRAPHIC;
 sal_uInt16 ScTabViewShell::nInsCellsCtrlState = 0;
 sal_uInt16 ScTabViewShell::nInsObjCtrlState = SID_INSERT_DIAGRAM;
-Color  ScTabViewShell::aBackgroundColor = COL_TRANSPARENT;
 
 // ---
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index d6a3244..b750152 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2327,16 +2327,6 @@ void SvxColorExtToolBoxControl::StateChanged(
 bChoiceFromPalette = sal_False;
 switch( nSID )
 {
-case SID_ATTR_CHAR_COLOR_EXT :
-case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT :
-if ( SFX_ITEM_DONTCARE != eState )
-{
-const SfxBoolItem* pBool = PTR_CAST( SfxBoolItem, pState );
-rTbx.CheckItem( nId, pBool  pBool-GetValue());
-}
-rTbx.EnableItem( nId, SFX_ITEM_DISABLED != eState );
-break;
-
   

[Libreoffice-commits] .: sc/source

2012-03-01 Thread Markus Mohrhard
 sc/source/core/data/table3.cxx |   65 +++--
 1 file changed, 57 insertions(+), 8 deletions(-)

New commits:
commit d7db93f5f4972a94ab3157578e9c8795dc089caa
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 04:49:27 2012 +0100

implement SwapCol and SwapRow for note handling again

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index db0c249..da43fbc 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -580,14 +580,39 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2)
 }
 }
 }
-for (ScNotes::iterator itr = maNotes.begin(); itr != maNotes.end(); ++itr)
+
+ScNotes aNoteMap(pDocument);
+ScNotes::iterator itr = maNotes.begin();
+while(itr != maNotes.end())
 {
-if (itr-first.first == nCol1 || itr-first.first == nCol2)
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+++itr;
+
+if (nCol == nCol1)
 {
-//only then we need to swap
-//TODO: implement it
+aNoteMap.insert(nCol, nRow, pPostIt);
+maNotes.ReleaseNote(nCol2, nRow);
+}
+else if (nCol == nCol2)
+{
+aNoteMap.insert(nCol, nRow, pPostIt);
+maNotes.ReleaseNote(nCol1, nRow);
+
 }
 }
+
+itr = aNoteMap.begin();
+{
+//we can here assume that there is no note in the target location
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+
+maNotes.insert(nCol, nRow, pPostIt);
+aNoteMap.ReleaseNote(nCol, nRow);
+}
 }
 
 void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
@@ -619,14 +644,38 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
 SetRowFiltered(nRow2, nRow2, bRow1Filtered);
 }
 
-for (ScNotes::iterator itr = maNotes.begin(); itr != maNotes.end(); ++itr)
+ScNotes aNoteMap(pDocument);
+ScNotes::iterator itr = maNotes.begin();
+while(itr != maNotes.end())
 {
-if (itr-first.second == nRow1 || itr-first.second == nRow2)
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+++itr;
+
+if (nRow == nRow1)
+{
+aNoteMap.insert(nCol, nRow, pPostIt);
+maNotes.ReleaseNote(nCol, nRow2);
+}
+else if (nRow == nRow2)
 {
-//only then we need to swap
-//TODO:implement it
+aNoteMap.insert(nCol, nRow, pPostIt);
+maNotes.ReleaseNote(nCol, nRow1);
+
 }
 }
+
+itr = aNoteMap.begin();
+{
+//we can here assume that there is no note in the target location
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+
+maNotes.insert(nCol, nRow, pPostIt);
+aNoteMap.ReleaseNote(nCol, nRow);
+}
 }
 
 short ScTable::Compare(SCCOLROW nIndex1, SCCOLROW nIndex2)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-29 Thread Caolán McNamara
 sc/source/ui/view/gridwin4.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2f1ee06df6117d94738df87f9f3cdb159c9389fe
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Feb 29 13:11:11 2012 +

WaE: C4805: '!=' : unsafe mix of type 'bool' and type 'const sal_Bool'

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index c7b258f..ff3e67b 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1382,7 +1382,7 @@ void ScGridWindow::GetSelectionRects( ::std::vector 
Rectangle  rPixelRects )
 PutInOrder( nY1, nY2 );
 
 sal_Bool bTestMerge = sal_True;
-sal_Bool bRepeat = sal_True;
+bool bRepeat = true;
 
 SCCOL nTestX2 = nX2;
 SCROW nTestY2 = nY2;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-28 Thread Muthu Subramanian
 sc/source/ui/dbgui/tpsort.cxx |   45 ++
 sc/source/ui/inc/tpsort.hxx   |   30 +---
 2 files changed, 34 insertions(+), 41 deletions(-)

New commits:
commit 2bb8328d0a3b2d4a076c1896f0c45cff1cc4677b
Author: Albert Thuswaldner albert.thuswald...@gmail.com
Date:   Tue Feb 28 19:14:26 2012 +0530

German Comments translations.

diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 6609563..aecb208 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -61,26 +61,26 @@ using namespace com::sun::star;
 // ---
 
 /*
- * Da sich Einstellungen auf der zweiten TabPage (Optionen) auf
- * die erste TabPage auswirken, muss es die Moeglichkeit geben,
- * dies der jeweils anderen Seite mitzuteilen.
+ * Since the settings on the second Tab Page (Options) effects
+ * the first Tab Page, there must be a way for it to communicate with the
+ * other Page.
  *
- * Im Moment wird dieses Problem ueber zwei Datenmember des TabDialoges
- * geloest. Wird eine Seite Aktiviert/Deaktiviert, so gleicht sie diese
- * Datenmember mit dem eigenen Zustand ab (-Activate()/Deactivate()).
+ * At the moment this problem is solved through using two data members of the
+ * Tab Pages. If a page is enabled / disabled, it compares this data member
+ * with its own state (- Activate() / Deactivate()).
  *
- * Die Klasse SfxTabPage bietet mittlerweile ein Verfahren an:
+ * In the meantime the class SfxTabPage offers the following method:
  *
  * virtual sal_Bool HasExchangeSupport() const; - return sal_True;
  * virtual void ActivatePage(const SfxItemSet );
  * virtual int  DeactivatePage(SfxItemSet * = 0);
  *
- * muss noch geaendert werden!
+ * This still needs to be changed!
  */
 
 //
 //
-// Sortierkriterien-Tabpage:
+// Sort Criteria Tab page
 
 ScTabPageSortFields::ScTabPageSortFields( Window*   pParent,
   const SfxItemSet rArgSet )
@@ -183,7 +183,7 @@ void ScTabPageSortFields::Reset( const SfxItemSet /* 
rArgSet */ )
 if ( aLbSort1.GetEntryCount() == 0 )
 FillFieldLists();
 
-// Selektieren der ListBoxen:
+// ListBox selection:
 
 if ( rSortData.bDoSort[0] )
 {
@@ -200,7 +200,7 @@ void ScTabPageSortFields::Reset( const SfxItemSet /* 
rArgSet */ )
 }
 else
 {
-aSortLbArr[i]-SelectEntryPos( 0 ); // keiner selektieren
+aSortLbArr[i]-SelectEntryPos( 0 ); // Select none
 aDirBtnArr[i][0]-Check();  // Up
 }
 }
@@ -261,7 +261,7 @@ sal_Bool ScTabPageSortFields::FillItemSet( SfxItemSet 
rArgSet )
 OSL_ENSURE((nSort1Pos = SC_MAXFIELDS)
  (nSort2Pos = SC_MAXFIELDS)
  (nSort3Pos = SC_MAXFIELDS),
-Array-Range Fehler! );
+Array range error! );
 
 if ( nSort1Pos == LISTBOX_ENTRY_NOTFOUND ) nSort1Pos = 0;
 if ( nSort2Pos == LISTBOX_ENTRY_NOTFOUND ) nSort2Pos = 0;
@@ -273,10 +273,9 @@ sal_Bool ScTabPageSortFields::FillItemSet( SfxItemSet 
rArgSet )
 theSortData.bDoSort[1] = (nSort2Pos  0);
 theSortData.bDoSort[2] = (nSort3Pos  0);
 
-// wenn auf Optionen-Seite OK gewaehlt wurde und
-// dabei die Sortierrichtung umgestellt wurde, so
-// wird das erste Feld der jeweiligen Richtung als
-// Sortierkriterium gewaehlt (steht in nFieldArr[0]):
+// If the OK was selected on the Options page while the sort
+// direction was changed, then the first field (i.e. nFieldArr[0])
+// of the respective direction is chosen as the sorting criterion:
 if ( bSortByRows != pDlg-GetByRows() )
 {
 theSortData.nField[0] =
@@ -295,7 +294,7 @@ sal_Bool ScTabPageSortFields::FillItemSet( SfxItemSet 
rArgSet )
 theSortData.bAscending[0] = aBtnUp1.IsChecked();
 theSortData.bAscending[1] = aBtnUp2.IsChecked();
 theSortData.bAscending[2] = aBtnUp3.IsChecked();
-//  bHasHeader ist in ScTabPageSortOptions::FillItemSet, wo es 
hingehoert
+// bHasHeader is in ScTabPageSortOptions::FillItemSet, where it belongs
 }
 else
 {
@@ -311,8 +310,7 @@ sal_Bool ScTabPageSortFields::FillItemSet( SfxItemSet 
rArgSet )
 
 // ---
 
-// fuer Datenaustausch ohne Dialog-Umweg: (! noch zu tun !)
-
+// for data exchange without dialogue detour: (still TODO!)
 void ScTabPageSortFields::ActivatePage()
 {
 if ( pDlg )
@@ -518,7 +516,7 @@ IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb )
 }
 
 //
-// Sortieroptionen-Tabpage:

[Libreoffice-commits] .: sc/source

2012-02-27 Thread Muthu Subramanian
 sc/source/filter/excel/xestring.cxx  |   17 -
 sc/source/filter/excel/xestyle.cxx   |6 --
 sc/source/filter/excel/xlformula.cxx |   11 ---
 sc/source/filter/excel/xlstyle.cxx   |5 -
 sc/source/filter/inc/xestring.hxx|2 --
 sc/source/filter/inc/xestyle.hxx |6 --
 sc/source/filter/inc/xlformula.hxx   |3 ---
 sc/source/filter/inc/xlstyle.hxx |2 --
 8 files changed, 52 deletions(-)

New commits:
commit 361b7fc217c69e7a5b457f86f721ad00f2c8c7d0
Author: Petr Vorel petr.vo...@gmail.com
Date:   Mon Feb 27 18:56:04 2012 +0530

Removed unused code.

diff --git a/sc/source/filter/excel/xestring.cxx 
b/sc/source/filter/excel/xestring.cxx
index d12ebe8..2053a68 100644
--- a/sc/source/filter/excel/xestring.cxx
+++ b/sc/source/filter/excel/xestring.cxx
@@ -184,23 +184,6 @@ void XclExpString::AppendByte( sal_Unicode cChar, 
rtl_TextEncoding eTextEnc )
 
 // formatting runs 
 
-void XclExpString::SetFormats( const XclFormatRunVec rFormats )
-{
-maFormats = rFormats;
-#if OSL_DEBUG_LEVEL  0
-if( IsRich() )
-{
-XclFormatRunVec::const_iterator aCurr = maFormats.begin();
-XclFormatRunVec::const_iterator aPrev = aCurr;
-XclFormatRunVec::const_iterator aEnd = maFormats.end();
-for( ++aCurr; aCurr != aEnd; ++aCurr, ++aPrev )
-OSL_ENSURE( aPrev-mnChar  aCurr-mnChar, 
XclExpString::SetFormats - invalid char order );
-OSL_ENSURE( aPrev-mnChar = mnLen, XclExpString::SetFormats - 
invalid char index );
-}
-#endif
-LimitFormatCount( mbIsBiff8 ? EXC_STR_MAXLEN : EXC_STR_MAXLEN_8BIT );
-}
-
 void XclExpString::AppendFormat( sal_uInt16 nChar, sal_uInt16 nFontIdx, bool 
bDropDuplicate )
 {
 OSL_ENSURE( maFormats.empty() || (maFormats.back().mnChar  nChar), 
XclExpString::AppendFormat - invalid char index );
diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index 1d7f190..ae51486 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1124,12 +1124,6 @@ sal_uInt16 XclExpFontBuffer::Insert( const SfxItemSet 
rItemSet,
 return Insert( aFont, eColorType, bAppFont );
 }
 
-sal_uInt16 XclExpFontBuffer::Insert( const ScPatternAttr rPattern,
-sal_Int16 nScript, XclExpColorType eColorType, bool bAppFont )
-{
-return Insert( rPattern.GetItemSet(), nScript, eColorType, bAppFont );
-}
-
 void XclExpFontBuffer::Save( XclExpStream rStrm )
 {
 maFontList.Save( rStrm );
diff --git a/sc/source/filter/excel/xlformula.cxx 
b/sc/source/filter/excel/xlformula.cxx
index 02154ba..8685041 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -483,12 +483,6 @@ XclTokenArray::XclTokenArray( bool bVolatile ) :
 {
 }
 
-XclTokenArray::XclTokenArray( ScfUInt8Vec rTokVec, bool bVolatile ) :
-mbVolatile( bVolatile )
-{
-maTokVec.swap( rTokVec );
-}
-
 XclTokenArray::XclTokenArray( ScfUInt8Vec rTokVec, ScfUInt8Vec rExtDataVec, 
bool bVolatile ) :
 mbVolatile( bVolatile )
 {
@@ -598,11 +592,6 @@ XclTokenArrayIterator::XclTokenArrayIterator( const 
XclTokenArrayIterator rTokA
 SkipSpaces();
 }
 
-void XclTokenArrayIterator::Init()
-{
-mppScTokenBeg = mppScTokenEnd = mppScToken = 0;
-}
-
 void XclTokenArrayIterator::Init( const ScTokenArray rScTokArr, bool 
bSkipSpaces )
 {
 sal_uInt16 nTokArrLen = rScTokArr.GetLen();
diff --git a/sc/source/filter/excel/xlstyle.cxx 
b/sc/source/filter/excel/xlstyle.cxx
index db0603d..e8ef58e 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -1751,11 +1751,6 @@ void XclXFBase::SetAllUsedFlags( bool bUsed )
 mbProtUsed = mbFontUsed = mbFmtUsed = mbAlignUsed = mbBorderUsed = 
mbAreaUsed = bUsed;
 }
 
-bool XclXFBase::HasUsedFlags() const
-{
-return mbProtUsed || mbFontUsed || mbFmtUsed || mbAlignUsed || 
mbBorderUsed || mbAreaUsed;
-}
-
 bool XclXFBase::Equals( const XclXFBase rCmp ) const
 {
 return
diff --git a/sc/source/filter/inc/xestring.hxx 
b/sc/source/filter/inc/xestring.hxx
index abc6f33..42ab5db 100644
--- a/sc/source/filter/inc/xestring.hxx
+++ b/sc/source/filter/inc/xestring.hxx
@@ -131,8 +131,6 @@ public:
 
 // formatting runs 
 
-/** Sets new formatting runs for the current text. */
-voidSetFormats( const XclFormatRunVec rFormats );
 /** Appends a formatting run. nChar must be greater than last contained 
character index. */
 voidAppendFormat( sal_uInt16 nChar, sal_uInt16 nFontIdx, 
bool bDropDuplicate = true );
 /** Appends a trailing formatting run with the passed font index. */
diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx
index 8f38b6f..c1263b3 100644
--- a/sc/source/filter/inc/xestyle.hxx
+++ b/sc/source/filter/inc/xestyle.hxx
@@ -247,12 +247,6 @@ public:

[Libreoffice-commits] .: sc/source

2012-02-25 Thread Takeshi Abe
 sc/source/ui/unoobj/scdetect.cxx   |   22 +++---
 sc/source/ui/vba/vbafilesearch.cxx |2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 552a9862f8a11d8e3b86eef710d91a322a3a2946
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Sat Feb 25 23:15:00 2012 +0900

Avoid temporary rtl::OUString

diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index d9b644f..c1f2795 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -273,22 +273,22 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 for( sal_Int32 nProperty=0; nPropertynPropertyCount; ++nProperty )
 {
 // extract properties
-if( lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(URL)) )
+if( 
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(URL)) )
 {
 lDescriptor[nProperty].Value = sTemp;
 aURL = sTemp;
 }
-else if( !aURL.Len()  lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(FileName)) )
+else if( !aURL.Len()  
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(FileName))
 )
 {
 lDescriptor[nProperty].Value = sTemp;
 aURL = sTemp;
 }
-else if( lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(TypeName)) )
+else if( 
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(TypeName))
 )
 {
 lDescriptor[nProperty].Value = sTemp;
 aTypeName = sTemp;
 }
-else if( lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(FilterName)) )
+else if( 
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(FilterName))
 )
 {
 lDescriptor[nProperty].Value = sTemp;
 aPreselectedFilterName = sTemp;
@@ -297,22 +297,22 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 // remember index of property to get access to it later
 nIndexOfFilterName = nProperty;
 }
-else if( lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(InputStream)) )
+else if( 
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(InputStream))
 )
 nIndexOfInputStream = nProperty;
-else if( lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(ReadOnly)) )
+else if( 
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(ReadOnly))
 )
 nIndexOfReadOnlyFlag = nProperty;
-else if( lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(UCBContent)) )
+else if( 
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(UCBContent))
 )
 nIndexOfContent = nProperty;
-else if( lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(AsTemplate)) )
+else if( 
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(AsTemplate))
 )
 {
 lDescriptor[nProperty].Value = bOpenAsTemplate;
 nIndexOfTemplateFlag = nProperty;
 }
-else if( lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(InteractionHandler)) )
+else if( 
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(InteractionHandler))
 )
 lDescriptor[nProperty].Value = xInteraction;
-else if( lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(RepairPackage)) )
+else if( 
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(RepairPackage))
 )
 lDescriptor[nProperty].Value = bRepairPackage;
-else if( lDescriptor[nProperty].Name == 
OUString(RTL_CONSTASCII_USTRINGPARAM(DocumentTitle)) )
+else if( 
lDescriptor[nProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(DocumentTitle))
 )
 nIndexOfDocumentTitle = nProperty;
 }
 
diff --git a/sc/source/ui/vba/vbafilesearch.cxx 
b/sc/source/ui/vba/vbafilesearch.cxx
index 91e8c7a..928ed9a 100644
--- a/sc/source/ui/vba/vbafilesearch.cxx
+++ b/sc/source/ui/vba/vbafilesearch.cxx
@@ -171,7 +171,7 @@ sal_Int32 SAL_CALL ScVbaFileSearch::Execute( )  throw 
(css::uno::RuntimeExceptio
 return 0;
 }
 
-if ( m_sFileName == ::rtl::OUString() )
+if ( m_sFileName.isEmpty() )
 {
 return 1;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-24 Thread Stephan Bergmann
 sc/source/filter/excel/impop.cxx|2 
 sc/source/filter/excel/xlroot.cxx   |4 -
 sc/source/filter/excel/xltracer.cxx |  103 ++--
 sc/source/filter/inc/xltracer.hxx   |   19 +-
 4 files changed, 11 insertions(+), 117 deletions(-)

New commits:
commit 4c5f388aa40036afea2a51156a41f4eea7ef1d7a
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Feb 24 14:04:20 2012 +0100

-Werror=unused-parameter

Not sure if this rather radical shrinking of XclTracer is good, though (or
if the class already has become obsolete anyway)?

diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 533bbb9..c7504ce 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -1088,7 +1088,7 @@ void ImportExcel::TableOp( void )
 else
 {
 bTabTruncated = sal_True;
-GetTracer().TraceInvalidRow(GetCurrScTab(), nLastRow, MAXROW);
+GetTracer().TraceInvalidRow(nLastRow, MAXROW);
 }
 }
 
diff --git a/sc/source/filter/excel/xlroot.cxx 
b/sc/source/filter/excel/xlroot.cxx
index 0177ce4..cfd8805 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -183,9 +183,7 @@ XclRoot::XclRoot( XclRootData rRootData ) :
 
 // filter tracer
 // do not use CREATE_OUSTRING for conditional expression
-mrData.mxTracer.reset( new XclTracer( GetDocUrl(), IsExport() ?
-
OUString(RTL_CONSTASCII_USTRINGPARAM(Office.Tracing/Export/Excel))
-  : 
OUString(RTL_CONSTASCII_USTRINGPARAM(Office.Tracing/Import/Excel )) ) );
+mrData.mxTracer.reset( new XclTracer( GetDocUrl() ) );
 }
 
 XclRoot::XclRoot( const XclRoot rRoot ) :
diff --git a/sc/source/filter/excel/xltracer.cxx 
b/sc/source/filter/excel/xltracer.cxx
index 586d47f..8600d80 100644
--- a/sc/source/filter/excel/xltracer.cxx
+++ b/sc/source/filter/excel/xltracer.cxx
@@ -36,48 +36,7 @@ using ::rtl::OUString;
 using ::com::sun::star::uno::Sequence;
 using ::com::sun::star::beans::PropertyValue;
 
-// 
-
-// Trace Table details are grouped by functionality using the context entry.
-// Each separate context starts at the next 1000 interval. New entries should
-// be added to their appropriate context. New contexts should be added onto
-// the end. Any gaps in the 1000 sequence or within the 1000 are the result
-// of trace events no longer present.
-static const XclTracerDetails pTracerDetails[] =
-{
-{ eUnKnown, 0, UNKNOWN,UNKNOWN, 
Unknown trace property.},
-{ eRowLimitExceeded,1000,  Limits, Sheet,   Row 
limit exceeded.},
-{ eTabLimitExceeded,1001,  Limits, Sheet,   Sheet 
limit exceeded.  },
-{ ePassword,2000,  Protection, Password,
Document is password protected.},
-{ ePrintRange,  3000,  Print,  Print Range, Print 
Range present.   },
-{ eShortDate,   4000,  CellFormatting, Short Dates, 
Possible Date format issue.},
-{ eBorderLineStyle, 4004,  CellFormatting, Border,  Line 
style not supported., },
-{ eFillPattern, 4005,  CellFormatting, Pattern, Fill 
Pattern not supported.,   },
-{ eInvisibleGrid,   5000,  Properties, Grid Invisible,  Grid 
invisible on first sheet.  },
-{ eFormattedNote,   6000,  Notes,  Formatting,  Text 
may be formatted. },
-{ eFormulaExtName,  7000,  Formula,External Name,   
External names not supported.  },
-{ eFormulaMissingArg,   7001,  Formula,Missing 
Argument,Parameter missing.  },
-{ ePivotDataSource, 8000,  Chart,  Pivot,   
External data source not supported.},
-{ ePivotChartExists,8001,  Chart,  Pivot,   Pivot 
Chart not supported.},
-{ eChartUnKnownType,8002,  Chart,  Type,Chart 
Type not supported.},
-{ eChartTrendLines, 8003,  Chart,  Type,Chart 
trendlines not supported.},
-{ eChartOnlySheet,  8004,  Chart,  Type,Chart 
only sheet not supported.},
-{ eChartRange,  8005,  Chart,  Source Data, Chart 
source ranges too complex.},
-{ eChartDSName, 8006,  Chart,  Source Data, 
Series titles not linked to cells.},
-{ eChartDataTable,  8007,  Chart,  Legend,  Data 
table not supported.},
-{ eChartLegendPosition, 8008,  Chart,  Legend,  
Position not guaranteed.},
-{ eChartTextFormatting, 8009,  Chart,  Formatting,  Text 
formatting present.},
-{ eChartEmbeddedObj,8010,  Chart,  Area,
Object inside 

[Libreoffice-commits] .: sc/source

2012-02-24 Thread Kohei Yoshida
 sc/source/filter/excel/xichart.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 89e836c64a885b676673af33bf98e5ef97869daf
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Fri Feb 24 15:42:09 2012 -0500

fdo#40320: Insert only a placeholder since the caller relies on this 
behavior.

diff --git a/sc/source/filter/excel/xichart.cxx 
b/sc/source/filter/excel/xichart.cxx
index df6a14d..a483064 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -2135,8 +2135,9 @@ XclImpChTextRef* XclImpChSeries::GetDataLabelRef( 
sal_uInt16 nPointIdx )
 XclImpChTextMap::iterator itr = maLabels.lower_bound(nPointIdx);
 if (itr == maLabels.end() || maLabels.key_comp()(nPointIdx, 
itr-first))
 {
-// No object exists at this point index position.  Insert a new 
one.
-XclImpChTextRef p(new XclImpChText(GetChRoot()));
+// No object exists at this point index position.  Insert a new
+// placeholder.
+XclImpChTextRef p;
 itr = maLabels.insert(itr, XclImpChTextMap::value_type(nPointIdx, 
p));
 }
 return itr-second;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-24 Thread Kohei Yoshida
 sc/source/filter/excel/xichart.cxx |  122 +++--
 sc/source/filter/inc/xichart.hxx   |8 --
 2 files changed, 66 insertions(+), 64 deletions(-)

New commits:
commit ba8918aebd2b9f030e0fd684accc9bf21bd1eac3
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Fri Feb 24 15:55:55 2012 -0500

Untangled the code a bit.

diff --git a/sc/source/filter/excel/xichart.cxx 
b/sc/source/filter/excel/xichart.cxx
index a483064..5503c21 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -1830,30 +1830,56 @@ void XclImpChSeries::ReadSubRecord( XclImpStream rStrm 
)
 }
 }
 
-void XclImpChSeries::SetDataFormat( XclImpChDataFormatRef xDataFmt )
+void XclImpChSeries::SetDataFormat( const XclImpChDataFormatRef xDataFmt )
 {
-if( xDataFmt )
+if (!xDataFmt)
+return;
+
+sal_uInt16 nPointIdx = xDataFmt-GetPointPos().mnPointIdx;
+if (nPointIdx == EXC_CHDATAFORMAT_ALLPOINTS)
 {
-XclImpChDataFormatRef* pxDataFmt = GetDataFormatRef( 
xDataFmt-GetPointPos().mnPointIdx );
-// do not overwrite existing data format
-if( pxDataFmt  !*pxDataFmt )
-{
-*pxDataFmt = xDataFmt;
-// #i51639# register series format index at chart type group
-if( (pxDataFmt == mxSeriesFmt)  !HasParentSeries() )
-if( XclImpChTypeGroup* pTypeGroup = 
GetChartData().GetTypeGroup( mnGroupIdx ).get() )
-pTypeGroup-SetUsedFormatIndex( xDataFmt-GetFormatIdx() );
-}
+if (mxSeriesFmt)
+// Don't overwrite the existing format.
+return;
+
+mxSeriesFmt = xDataFmt;
+if (HasParentSeries())
+return;
+
+XclImpChTypeGroupRef pTypeGroup = 
GetChartData().GetTypeGroup(mnGroupIdx);
+if (pTypeGroup)
+pTypeGroup-SetUsedFormatIndex(xDataFmt-GetFormatIdx());
+
+return;
+}
+
+if (nPointIdx = EXC_CHDATAFORMAT_MAXPOINTCOUNT)
+// Above the max point count.  Bail out.
+return;
+
+XclImpChDataFormatMap::iterator itr = maPointFmts.lower_bound(nPointIdx);
+if (itr == maPointFmts.end() || maPointFmts.key_comp()(nPointIdx, 
itr-first))
+{
+// No object exists at this point index position.  Insert it.
+itr = maPointFmts.insert(itr, 
XclImpChDataFormatMap::value_type(nPointIdx, xDataFmt));
 }
 }
 
-void XclImpChSeries::SetDataLabel( XclImpChTextRef xLabel )
+void XclImpChSeries::SetDataLabel( const XclImpChTextRef xLabel )
 {
-if( xLabel )
+if (!xLabel)
+return;
+
+sal_uInt16 nPointIdx = xLabel-GetPointPos().mnPointIdx;
+if ((nPointIdx != EXC_CHDATAFORMAT_ALLPOINTS)  (nPointIdx = 
EXC_CHDATAFORMAT_MAXPOINTCOUNT))
+// Above the maximum allowed data points. Bail out.
+return;
+
+XclImpChTextMap::iterator itr = maLabels.lower_bound(nPointIdx);
+if (itr == maLabels.end() || maLabels.key_comp()(nPointIdx, itr-first))
 {
-XclImpChTextRef* pxLabel = GetDataLabelRef( 
xLabel-GetPointPos().mnPointIdx );
-if( pxLabel  !*pxLabel )
-*pxLabel = xLabel;
+// No object exists at this point index position.  Insert it.
+itr = maLabels.insert(itr, XclImpChTextMap::value_type(nPointIdx, 
xLabel));
 }
 }
 
@@ -1911,11 +1937,28 @@ void XclImpChSeries::FinalizeDataFormats()
 // set text labels to data formats
 for( XclImpChTextMap::iterator aTIt = maLabels.begin(), aTEnd = 
maLabels.end(); aTIt != aTEnd; ++aTIt )
 {
-if( XclImpChDataFormatRef* pxDataFmt = GetDataFormatRef( 
aTIt-first ) )
+sal_uInt16 nPointIdx = aTIt-first;
+if (nPointIdx == EXC_CHDATAFORMAT_ALLPOINTS)
 {
-if( !*pxDataFmt )
-*pxDataFmt = CreateDataFormat( aTIt-first, 
EXC_CHDATAFORMAT_DEFAULT );
-(*pxDataFmt)-SetDataLabel( aTIt-second );
+if (!mxSeriesFmt)
+mxSeriesFmt = CreateDataFormat(nPointIdx, 
EXC_CHDATAFORMAT_DEFAULT);
+mxSeriesFmt-SetDataLabel(aTIt-second);
+}
+else if (nPointIdx  EXC_CHDATAFORMAT_MAXPOINTCOUNT)
+{
+XclImpChDataFormatRef p;
+XclImpChDataFormatMap::iterator itr = 
maPointFmts.lower_bound(nPointIdx);
+if (itr == maPointFmts.end() || 
maPointFmts.key_comp()(nPointIdx, itr-first))
+{
+// No object exists at this point index position.  Insert
+// a new one.
+p = CreateDataFormat(nPointIdx, EXC_CHDATAFORMAT_DEFAULT);
+itr = maPointFmts.insert(
+itr, XclImpChDataFormatMap::value_type(nPointIdx, p));
+}
+else
+p = itr-second;
+p-SetDataLabel(aTIt-second);
 }
 }
 
@@ -2108,43 +2151,6 @@ XclImpChDataFormatRef 

[Libreoffice-commits] .: sc/source

2012-02-23 Thread Michael Meeks
 sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx |   33 +++--
 1 file changed, 15 insertions(+), 18 deletions(-)

New commits:
commit f881540b3295c17286f8003c7b897907bf9f57cb
Author: Catalin Iacob iacobcata...@gmail.com
Date:   Thu Feb 23 12:57:22 2012 +

cppcheck: fix possible null dereference in ScMyCellInfo::CreateCell.

diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx 
b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index 55140b1..4359929 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -63,26 +63,23 @@ ScMyCellInfo::~ScMyCellInfo()
 
 ScBaseCell* ScMyCellInfo::CreateCell(ScDocument* pDoc)
 {
-if (pDoc)
+if (!pCell  !sFormula.isEmpty()  !sFormulaAddress.isEmpty())
 {
-if (!pCell  !sFormula.isEmpty()  !sFormulaAddress.isEmpty())
-{
-ScAddress aPos;
-sal_Int32 nOffset(0);
-ScRangeStringConverter::GetAddressFromString(aPos, 
sFormulaAddress, pDoc, ::formula::FormulaGrammar::CONV_OOO, nOffset);
-pCell = new ScFormulaCell(pDoc, aPos, sFormula, eGrammar, 
nMatrixFlag);
-
static_castScFormulaCell*(pCell)-SetMatColsRows(static_castSCCOL(nMatrixCols),
 static_castSCROW(nMatrixRows));
-}
+ScAddress aPos;
+sal_Int32 nOffset(0);
+ScRangeStringConverter::GetAddressFromString(aPos, sFormulaAddress, 
pDoc, ::formula::FormulaGrammar::CONV_OOO, nOffset);
+pCell = new ScFormulaCell(pDoc, aPos, sFormula, eGrammar, nMatrixFlag);
+
static_castScFormulaCell*(pCell)-SetMatColsRows(static_castSCCOL(nMatrixCols),
 static_castSCROW(nMatrixRows));
+}
 
-if ((nType == NUMBERFORMAT_DATE || nType == NUMBERFORMAT_TIME)  
sInputString.Len() == 0)
-{
-sal_uInt32 nFormat(0);
-if (nType == NUMBERFORMAT_DATE)
-nFormat = pDoc-GetFormatTable()-GetStandardFormat( 
NUMBERFORMAT_DATE, ScGlobal::eLnge );
-else if (nType == NUMBERFORMAT_TIME)
-nFormat = pDoc-GetFormatTable()-GetStandardFormat( 
NUMBERFORMAT_TIME, ScGlobal::eLnge );
-pDoc-GetFormatTable()-GetInputLineString(fValue, nFormat, 
sInputString);
-}
+if ((nType == NUMBERFORMAT_DATE || nType == NUMBERFORMAT_TIME)  
sInputString.Len() == 0)
+{
+sal_uInt32 nFormat(0);
+if (nType == NUMBERFORMAT_DATE)
+nFormat = pDoc-GetFormatTable()-GetStandardFormat( 
NUMBERFORMAT_DATE, ScGlobal::eLnge );
+else if (nType == NUMBERFORMAT_TIME)
+nFormat = pDoc-GetFormatTable()-GetStandardFormat( 
NUMBERFORMAT_TIME, ScGlobal::eLnge );
+pDoc-GetFormatTable()-GetInputLineString(fValue, nFormat, 
sInputString);
 }
 
 return pCell ? pCell-CloneWithoutNote( *pDoc ) : 0;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-22 Thread Lubos Lunak
 sc/source/core/data/dptabres.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 00f022bac10629d35eb6f073c3dfe90e120202b5
Author: Luboš Luňák l.lu...@suse.cz
Date:   Wed Feb 22 14:42:54 2012 +0100

fix misleading comment caused by previous commit

diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 7d98440..421c17d 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -174,7 +174,7 @@ static sal_Bool lcl_IsLess( const ScDPDataMember* 
pDataMember1, const ScDPDataMe
 sal_Bool bError1 = pAgg1  pAgg1-HasError();
 sal_Bool bError2 = pAgg2  pAgg2-HasError();
 if ( bError1 )
-return sal_False;   // equal
+return sal_False;   // errors are always sorted at the end
 else if ( bError2 )
 return sal_True;// errors are always sorted at the end
 else
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source svtools/source svx/source sw/source

2012-02-22 Thread Michael Meeks
 sc/source/ui/src/popup.src  |6 ++
 svtools/source/graphic/grfmgr.cxx   |5 +
 svtools/source/graphic/provider.cxx |3 +++
 svx/source/xml/xmlgrhlp.cxx |5 +
 sw/source/core/graphic/ndgrf.cxx|   33 +
 5 files changed, 52 insertions(+)

New commits:
commit aff6db70245a74039b5331810d3ff654b1f6af63
Author: Greggory Hernandez greggory...@gmail.com
Date:   Wed Feb 22 14:08:57 2012 +

fdo#37210 - UI: Calc usability improvement: Merge cells on right mouse click

diff --git a/sc/source/ui/src/popup.src b/sc/source/ui/src/popup.src
index 24e9c58..441c336 100644
--- a/sc/source/ui/src/popup.src
+++ b/sc/source/ui/src/popup.src
@@ -76,6 +76,12 @@ Menu RID_POPUP_CELLS
 HelpId = CMD_SID_DELETE ;
 Text [ en-US ] = Delete C~ontents... ;
 };
+MenuItem
+{
+Identifier = FID_MERGE_ON ;
+HelpId = CMD_FID_MERGE_ON ;
+Text [ en-US ] = ~Merge Cells... ;
+};
  //--
 MenuItem { Separator = TRUE ; };
  //--
diff --git a/svtools/source/graphic/grfmgr.cxx 
b/svtools/source/graphic/grfmgr.cxx
index 7c2de86..2124d62 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -422,12 +422,17 @@ String GraphicObject::GetLink() const
 
 void GraphicObject::SetUserData()
 {
+fprintf (stderr, SetUserData to null from '%s'\n,
+ mpUserData ? rtl::OUStringToOString(*mpUserData, 
RTL_TEXTENCODING_UTF8).getStr() : null);
 if( mpUserData )
 delete mpUserData, mpUserData = NULL;
 }
 
 void GraphicObject::SetUserData( const String rUserData )
 {
+fprintf (stderr, SetUserData to '%s' from '%s'\n,
+ rtl::OUStringToOString(rUserData, RTL_TEXTENCODING_UTF8).getStr(),
+ mpUserData ? rtl::OUStringToOString(*mpUserData, 
RTL_TEXTENCODING_UTF8).getStr() : null);
 delete mpUserData, mpUserData = new String( rUserData );
 }
 
diff --git a/svtools/source/graphic/provider.cxx 
b/svtools/source/graphic/provider.cxx
index d5bcf46..185e9dc 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -867,6 +867,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const 
uno::Reference ::graphic::XG
 
 if( pGraphic  ( pGraphic-GetType() != GRAPHIC_NONE ) )
 {
+fprintf (stderr, provider.cxx - write graphic: ! 
0x%lx\n, (long)pGraphic-GetChecksum() );
 ::Graphic aGraphic( *pGraphic );
 ImplApplyFilterData( aGraphic, aFilterDataSeq );
 
@@ -884,6 +885,8 @@ void SAL_CALL GraphicProvider::storeGraphic( const 
uno::Reference ::graphic::XG
 }
 aMemStrm.Seek( STREAM_SEEK_TO_END );
 pOStm-Write( aMemStrm.GetData(), aMemStrm.Tell() );
+
+fprintf (stderr, provider.cxx - after write graphic: ! 
0x%lx\n, (long)pGraphic-GetChecksum() );
 }
 }
 }
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index d73c19e..9f2c6c8 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -621,6 +621,8 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const 
::rtl::OUString rPictureSt
 }
 else if( aGraphic.GetType() == GRAPHIC_GDIMETAFILE )
 {
+fprintf (stderr, xmlgrhlp.cxx - write meta-file ! 
0x%lx\n,
+ (long)aGraphic.GetChecksum() );
 pStream-SetVersion( SOFFICE_FILEFORMAT_8 );
 pStream-SetCompressMode( COMPRESSMODE_ZBITMAP );
 
@@ -643,6 +645,9 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const 
::rtl::OUString rPictureSt
 rMtf.Write( *pStream, 
GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC );
 
 bRet = ( pStream-GetError() == 0 );
+
+fprintf (stderr, xmlgrhlp.cxx - done write meta-file ! 
0x%lx\n,
+ (long)aGraphic.GetChecksum() );
 }
 }
 uno::Reference  embed::XTransactedObject  xStorage(
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 151d795..907e1f0 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -63,6 +63,14 @@
 
 using namespace com::sun::star;
 
+static void dbg (SwGrfNode *pNode)
+{
+fprintf (stderr, SwGrfNode created: '%s' 0x%lx\n,
+ rtl::OUStringToOString(pNode-GetGrfObj().GetUserData(),
+RTL_TEXTENCODING_UTF8).getStr(),
+ (long)pNode-GetGrf().GetChecksum());
+}
+
 // 
 // SwGrfNode
 // 
@@ -83,6 +91,7 @@ SwGrfNode::SwGrfNode(
 
 bGrafikArrived = sal_True;
 ReRead(rGrfName,rFltName, pGraphic, 0, sal_False);
+   

[Libreoffice-commits] .: sc/source

2012-02-22 Thread Takeshi Abe
 sc/source/filter/xml/XMLExportDatabaseRanges.cxx |2 
 sc/source/ui/docshell/dbdocfun.cxx   |4 -
 sc/source/ui/docshell/docsh5.cxx |2 
 sc/source/ui/namedlg/namemgrtable.cxx|2 
 sc/source/ui/undo/undoutil.cxx   |2 
 sc/source/ui/unoobj/chart2uno.cxx|6 +-
 sc/source/ui/vba/vbaapplication.cxx  |   54 +++
 7 files changed, 36 insertions(+), 36 deletions(-)

New commits:
commit dcd7dc43376c914027b76525959a9cea71d9279e
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Thu Feb 23 03:20:53 2012 +0900

avoid temporary rtl::OUString

diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx 
b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
index a552ee9..8aab8b5 100644
--- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
+++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
@@ -111,7 +111,7 @@ ScMyEmptyDatabaseRangesContainer 
ScXMLExportDatabaseRanges::GetEmptyDatabaseRang
 sal_Int32 nLength = aImportProperties.getLength();
 sheet::DataImportMode nSourceType = 
sheet::DataImportMode_NONE;
 for (sal_Int32 j = 0; j  nLength; ++j)
-if (aImportProperties[j].Name == 
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_SRCTYPE)))
+if 
(aImportProperties[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SC_UNONAME_SRCTYPE)))
 aImportProperties[j].Value = nSourceType;
 if (nSourceType != sheet::DataImportMode_NONE)
 {
diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 0461d2b..3266abe 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -89,7 +89,7 @@ bool ScDBDocFunc::AddDBRange( const ::rtl::OUString rName, 
const ScRange rRang
 bool bOk;
 if ( bCompile )
 pDoc-CompileDBFormula( sal_True ); // CreateFormulaString
-if 
(rtl::OUString(rName)==rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)))
+if (rName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STR_DB_LOCAL_NONAME)))
 {
 pDoc-SetAnonymousDBData(rRange.aStart.Tab() , pNew);
 bOk = true;
@@ -209,7 +209,7 @@ bool ScDBDocFunc::ModifyDBData( const ScDBData rNewData )
 bool bUndo = pDoc-IsUndoEnabled();
 
 ScDBData* pData = NULL;
-if 
(rtl::OUString(rNewData.GetName())==rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)))
+if 
(rNewData.GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STR_DB_LOCAL_NONAME)))
 {
 ScRange aRange;
 rNewData.GetArea(aRange);
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index b965d50..bbb1e7e 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -165,7 +165,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange rMarked, 
ScGetDBMode eMode, ScGe
 SCCOL nOldCol2;
 SCROW nOldRow2;
 pData-GetArea( nDummy, nOldCol1,nOldRow1, nOldCol2,nOldRow2 );
-sal_Bool bIsNoName = ( rtl::OUString(pData-GetName()) == 
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)) );
+sal_Bool bIsNoName = ( 
pData-GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STR_DB_LOCAL_NONAME)) 
);
 
 if (!bSelected)
 {
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx 
b/sc/source/ui/namedlg/namemgrtable.cxx
index 2bc5189..b94d8ae 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -133,7 +133,7 @@ void ScRangeManagerTable::Init()
 {
 const ScRangeName* pLocalRangeName = itr-second;
 ScRangeNameLine aLine;
-if (itr-first == 
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_GLOBAL_RANGE_NAME)))
+if 
(itr-first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STR_GLOBAL_RANGE_NAME)))
 aLine.aScope = maGlobalString;
 else
 aLine.aScope = itr-first;
diff --git a/sc/source/ui/undo/undoutil.cxx b/sc/source/ui/undo/undoutil.cxx
index bf4ac68..91f 100644
--- a/sc/source/ui/undo/undoutil.cxx
+++ b/sc/source/ui/undo/undoutil.cxx
@@ -97,7 +97,7 @@ ScDBData* ScUndoUtil::GetOldDBData( ScDBData* pUndoData, 
ScDocument* pDoc, SCTAB
 if ( pUndoData )
 {
 const ::rtl::OUString aName = pUndoData-GetName();
-if (aName == 
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME)))
+if 
(aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STR_DB_LOCAL_NONAME)))
 bWasTemp = true;
 }
 OSL_ENSURE(bWasTemp, Undo: didn't find database range);
diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 7e42f8d..90d1b07 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ 

[Libreoffice-commits] .: sc/source

2012-02-22 Thread Josh Heidenreich
 sc/source/filter/html/htmlexp2.cxx |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit e9d045f0f476c80060a350c08d8b253eaf41c41f
Author: Josh Heidenreich josh.sickm...@gmail.com
Date:   Thu Feb 23 13:00:15 2012 +1030

Translation of German comments in sc html filter (htmlexp2.cxx)

diff --git a/sc/source/filter/html/htmlexp2.cxx 
b/sc/source/filter/html/htmlexp2.cxx
index 4834b4a..15091d1 100644
--- a/sc/source/filter/html/htmlexp2.cxx
+++ b/sc/source/filter/html/htmlexp2.cxx
@@ -71,7 +71,7 @@ void ScHTMLExport::PrepareGraphics( ScDrawLayer* pDrawLayer, 
SCTAB nTab,
 {
 ScHTMLGraphEntry* pE = aGraphList[ i ];
 if ( !pE-bInCell )
-{   // nicht alle in Zellen: einige neben Tabelle
+{   // not all cells: table next to some
 bTabAlignedLeft = sal_True;
 break;
 }
@@ -198,17 +198,19 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE )
 void ScHTMLExport::WriteImage( String rLinkName, const Graphic rGrf,
 const rtl::OString rImgOptions, sal_uLong nXOutFlags )
 {
-// embeddete Grafik - via WriteGraphic schreiben
+// Embedded graphic - create an image file
 if( !rLinkName.Len() )
 {
 if( aStreamPath.Len()  0 )
 {
-// Grafik als (JPG-)File speichern
+// Save as a PNG
 String aGrfNm( aStreamPath );
 nXOutFlags |= XOUTBMP_USE_NATIVE_IF_POSSIBLE;
 sal_uInt16 nErr = XOutBitmap::WriteGraphic( rGrf, aGrfNm,
 CREATE_STRING( PNG ), nXOutFlags );
-if( !nErr ) // sonst fehlerhaft, da ist nichts auszugeben
+
+// If it worked, create a URL for the IMG tag
+if( !nErr )
 {
 rLinkName = URIHelper::SmartRel2Abs(
 INetURLObject(aBaseURL),
@@ -221,6 +223,7 @@ void ScHTMLExport::WriteImage( String rLinkName, const 
Graphic rGrf,
 }
 else
 {
+// Linked graphic - figure out the URL for the IMG tag
 if( bCopyLocalFileToINet || HasCId() )
 {
 CopyLocalFileToINet( rLinkName, aStreamPath );
@@ -233,8 +236,11 @@ void ScHTMLExport::WriteImage( String rLinkName, const 
Graphic rGrf,
 rLinkName,
 URIHelper::GetMaybeFileHdl());
 }
+
+// If a URL was set, output the IMG tag.
+// IMG SRC=...[ rImgOptions]
 if( rLinkName.Len() )
-{   // IMG SRC=...[ rImgOptions]
+{
 rStrm  ''  OOO_STRING_SVTOOLS_HTML_image  ' '  
OOO_STRING_SVTOOLS_HTML_O_src  =\;
 HTMLOutFuncs::Out_String( rStrm, 
URIHelper::simpleNormalizedMakeRelative(
 aBaseURL,
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-16 Thread Takeshi Abe
 sc/source/filter/inc/xlpivot.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 689f2fa7aec03090ac150591d472aea74b17ca50
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Thu Feb 16 15:55:53 2012 +0900

Removed unused header include

diff --git a/sc/source/filter/inc/xlpivot.hxx b/sc/source/filter/inc/xlpivot.hxx
index 1a88868..74aef36 100644
--- a/sc/source/filter/inc/xlpivot.hxx
+++ b/sc/source/filter/inc/xlpivot.hxx
@@ -41,7 +41,6 @@
 #include xladdress.hxx
 #include dpobject.hxx
 
-#include boost/noncopyable.hpp
 #include boost/scoped_ptr.hpp
 
 class XclImpStream;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-15 Thread Kohei Yoshida
 sc/source/ui/docshell/docfunc.cxx |  100 --
 sc/source/ui/inc/docfunc.hxx  |4 -
 sc/source/ui/inc/viewfunc.hxx |2 
 sc/source/ui/view/cellsh.cxx  |   57 -
 sc/source/ui/view/viewfun2.cxx|4 -
 5 files changed, 124 insertions(+), 43 deletions(-)

New commits:
commit ab0096ed68cdc08906f518d3499a8e1afc5ba80c
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Wed Feb 15 14:06:48 2012 -0500

fdo#46070: Allow copying of adjacent cells via Fill Down/Up/Left/Right.

diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index 8b9d068..5804190 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3933,19 +3933,91 @@ inline ScDirection DirFromFillDir( FillDir eDir )
 return DIR_LEFT;
 }
 
-sal_Bool ScDocFunc::FillSimple( const ScRange rRange, const ScMarkData* 
pTabMark,
-FillDir eDir, sal_Bool bRecord, sal_Bool bApi )
+namespace {
+
+/**
+ * Expand the fill range as necessary, to allow copying of adjacent cell(s)
+ * even when those cells are not in the original range.
+ */
+void adjustFillRangeForAdjacentCopy(ScRange rRange, FillDir eDir)
 {
-ScDocShellModificator aModificator( rDocShell );
+switch (eDir)
+{
+case FILL_TO_BOTTOM:
+{
+if (rRange.aStart.Row() == 0)
+return;
 
-sal_Bool bSuccess = false;
+if (rRange.aStart.Row() != rRange.aEnd.Row())
+return;
+
+// Include the above row.
+ScAddress s = rRange.aStart;
+s.SetRow(s.Row()-1);
+}
+break;
+case FILL_TO_TOP:
+{
+if (rRange.aStart.Row() == MAXROW)
+return;
+
+if (rRange.aStart.Row() != rRange.aEnd.Row())
+return;
+
+// Include the row below.
+ScAddress e = rRange.aEnd;
+e.SetRow(e.Row()+1);
+}
+break;
+case FILL_TO_LEFT:
+{
+if (rRange.aStart.Col() == MAXCOL)
+return;
+
+if (rRange.aStart.Col() != rRange.aEnd.Col())
+return;
+
+// Include the column to the right.
+ScAddress e = rRange.aEnd;
+e.SetCol(e.Col()+1);
+}
+break;
+case FILL_TO_RIGHT:
+{
+if (rRange.aStart.Col() == 0)
+return;
+
+if (rRange.aStart.Col() != rRange.aEnd.Col())
+return;
+
+// Include the column to the left.
+ScAddress s = rRange.aStart;
+s.SetCol(s.Col()-1);
+}
+break;
+default:
+;
+}
+}
+
+}
+
+bool ScDocFunc::FillSimple( const ScRange rRange, const ScMarkData* pTabMark,
+FillDir eDir, bool bRecord, bool bApi )
+{
+ScDocShellModificator aModificator( rDocShell );
 ScDocument* pDoc = rDocShell.GetDocument();
-SCCOL nStartCol = rRange.aStart.Col();
-SCROW nStartRow = rRange.aStart.Row();
-SCTAB nStartTab = rRange.aStart.Tab();
-SCCOL nEndCol = rRange.aEnd.Col();
-SCROW nEndRow = rRange.aEnd.Row();
-SCTAB nEndTab = rRange.aEnd.Tab();
+
+bool bSuccess = false;
+ScRange aRange = rRange;
+adjustFillRangeForAdjacentCopy(aRange, eDir);
+
+SCCOL nStartCol = aRange.aStart.Col();
+SCROW nStartRow = aRange.aStart.Row();
+SCTAB nStartTab = aRange.aStart.Tab();
+SCCOL nEndCol = aRange.aEnd.Col();
+SCROW nEndRow = aRange.aEnd.Row();
+SCTAB nEndTab = aRange.aEnd.Tab();
 
 if (bRecord  !pDoc-IsUndoEnabled())
 bRecord = false;
@@ -3964,8 +4036,8 @@ sal_Bool ScDocFunc::FillSimple( const ScRange rRange, 
const ScMarkData* pTabMar
 {
 WaitObject aWait( rDocShell.GetActiveDialogParent() );
 
-ScRange aSourceArea = rRange;
-ScRange aDestArea   = rRange;
+ScRange aSourceArea = aRange;
+ScRange aDestArea   = aRange;
 
 SCCOLROW nCount = 0;
 switch (eDir)
@@ -4010,7 +4082,7 @@ sal_Bool ScDocFunc::FillSimple( const ScRange rRange, 
const ScMarkData* pTabMar
 pDoc-Fill( aSourceArea.aStart.Col(), aSourceArea.aStart.Row(),
 aSourceArea.aEnd.Col(), aSourceArea.aEnd.Row(), aMark,
 nCount, eDir, FILL_SIMPLE );
-AdjustRowHeight(rRange);
+AdjustRowHeight(aRange);
 
 if ( bRecord )  // Draw-Undo erst jetzt verfuegbar
 {
@@ -4022,7 +4094,7 @@ sal_Bool ScDocFunc::FillSimple( const ScRange rRange, 
const ScMarkData* pTabMar
 rDocShell.PostPaintGridAll();
 aModificator.SetDocumentModified();
 
-bSuccess = sal_True;
+bSuccess = true;
 }
 else if (!bApi)
 rDocShell.ErrorMessage(aTester.GetMessageId());
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 63cbc39..a2e6fd2 100644
--- 

[Libreoffice-commits] .: sc/source

2012-02-13 Thread Kohei Yoshida
 sc/source/core/tool/callform.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit acbb997eda4702ae42b0d73134252d21745a19c3
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Mon Feb 13 09:12:55 2012 -0500

Move it down a bit, to hopefully get Norbert's Mac tinderbox to build.

diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx
index 949e642..4fa3d1d 100644
--- a/sc/source/core/tool/callform.cxx
+++ b/sc/source/core/tool/callform.cxx
@@ -161,8 +161,6 @@ public:
 void clear();
 };
 
-ModuleCollection aModuleCollection;
-
 const ModuleData* ModuleCollection::findByName(const rtl::OUString rName) 
const
 {
 MapType::const_iterator it = maData.find(rName);
@@ -183,6 +181,8 @@ void ModuleCollection::clear()
 maData.clear();
 }
 
+ModuleCollection aModuleCollection;
+
 }
 
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-13 Thread Ivan Timofeev
 sc/source/core/data/cell.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit ee38b167c86c8f96aa41dca861cae327c6df5915
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Mon Feb 13 12:26:50 2012 -0500

fdo#45916: Ensure formula cell's pCode isn't NULL even when compilation 
fails.

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 2f3df26..b74f08e 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -777,6 +777,9 @@ ScFormulaCell::ScFormulaCell( ScDocument* pDoc, const 
ScAddress rPos,
 aPos( rPos )
 {
 Compile( rFormula, true, eGrammar );// bNoListening, Insert does that
+if (!pCode)
+// We need to have a non-NULL token array instance at all times.
+pCode = new ScTokenArray;
 }
 
 // Wird von den Importfiltern verwendet
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-13 Thread Ivan Timofeev
 sc/source/core/data/cell.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit bf789d4a40711b7b04b969e3330373a2f947b994
Author: Ivan Timofeev timofeev@gmail.com
Date:   Mon Feb 13 22:46:38 2012 +0400

make the return statement more visible

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index b74f08e..74e9330 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1056,7 +1056,8 @@ void ScFormulaCell::GetResultDimensions( SCSIZE rCols, 
SCSIZE rRows )
 void ScFormulaCell::Compile( const String rFormula, bool bNoListening,
 const FormulaGrammar::Grammar eGrammar )
 {
-if ( pDocument-IsClipOrUndo() ) return;
+if ( pDocument-IsClipOrUndo() )
+return;
 bool bWasInFormulaTree = pDocument-IsInFormulaTree( this );
 if ( bWasInFormulaTree )
 pDocument-RemoveFromFormulaTree( this );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-13 Thread Kohei Yoshida
 sc/source/ui/app/inputhdl.cxx |   54 +-
 sc/source/ui/inc/inputhdl.hxx |3 +-
 2 files changed, 29 insertions(+), 28 deletions(-)

New commits:
commit c1ebc27ec9e55615c51b6941ed1d6b6b6782ddb2
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Mon Feb 13 17:07:48 2012 -0500

Use separate iterators for column and formula data.

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 5169b01..baefc8a 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1077,9 +1077,9 @@ void ScInputHandler::UseFormulaData()
 if (!aText.isEmpty())
 {
 rtl::OUString aNew;
-miAutoPos = pFormulaData-end();
-miAutoPos = findText(*pFormulaData, miAutoPos, aText, aNew, 
false);
-if (miAutoPos != pFormulaData-end())
+miAutoPosFormula = pFormulaData-end();
+miAutoPosFormula = findText(*pFormulaData, miAutoPosFormula, 
aText, aNew, false);
+if (miAutoPosFormula != pFormulaData-end())
 {
 ShowTip( aNew );
 aAutoSearch = aText;
@@ -1220,8 +1220,8 @@ void ScInputHandler::NextFormulaEntry( bool bBack )
 if ( pActiveView  pFormulaData )
 {
 rtl::OUString aNew;
-miAutoPos = findText(*pFormulaData, miAutoPos, aAutoSearch, aNew, 
bBack);
-if (miAutoPos != pFormulaData-end())
+miAutoPosFormula = findText(*pFormulaData, miAutoPosFormula, 
aAutoSearch, aNew, bBack);
+if (miAutoPosFormula != pFormulaData-end())
 ShowTip( aNew );//  als QuickHelp anzeigen
 }
 
@@ -1276,9 +1276,9 @@ void lcl_CompleteFunction( EditView* pView, const String 
rInsert, bool rParIns
 
 void ScInputHandler::PasteFunctionData()
 {
-if (pFormulaData  miAutoPos != pFormulaData-end())
+if (pFormulaData  miAutoPosFormula != pFormulaData-end())
 {
-const ScTypedStrData rData = *miAutoPos;
+const ScTypedStrData rData = *miAutoPosFormula;
 const rtl::OUString aInsert = rData.GetString();
 bool bParInserted = false;
 
@@ -1393,9 +1393,9 @@ void ScInputHandler::FormulaPreview()
 ShowTip( aValue );  //  als QuickHelp anzeigen
 aManualTip = aValue;//  nach ShowTip setzen
 if (pFormulaData)
-miAutoPos = pFormulaData-end();
-else if (pColumnData)
-miAutoPos = pColumnData-end();
+miAutoPosFormula = pFormulaData-end();
+if (pColumnData)
+miAutoPosColumn = pColumnData-end();
 }
 }
 
@@ -1556,9 +1556,9 @@ void ScInputHandler::UseColData()   // beim Tippen
 if (!aText.isEmpty())
 {
 rtl::OUString aNew;
-miAutoPos = pColumnData-end();
-miAutoPos = findText(*pColumnData, miAutoPos, aText, aNew, 
false);
-if (miAutoPos != pColumnData-end())
+miAutoPosColumn = pColumnData-end();
+miAutoPosColumn = findText(*pColumnData, miAutoPosColumn, 
aText, aNew, false);
+if (miAutoPosColumn != pColumnData-end())
 {
 //  durch dBase Import etc. koennen Umbrueche im 
String sein,
 //  das wuerde hier mehrere Absaetze ergeben - nicht 
gut
@@ -1598,7 +1598,7 @@ void ScInputHandler::UseColData()   // beim Tippen
 
 rtl::OUString aDummy;
 ScTypedCaseStrSet::const_iterator itNextPos =
-findText(*pColumnData, miAutoPos, aText, 
aDummy, false);
+findText(*pColumnData, miAutoPosColumn, aText, 
aDummy, false);
 bUseTab = itNextPos != pColumnData-end();
 }
 else
@@ -1615,7 +1615,7 @@ void ScInputHandler::NextAutoEntry( bool bBack )
 EditView* pActiveView = pTopView ? pTopView : pTableView;
 if ( pActiveView  pColumnData )
 {
-if (miAutoPos != pColumnData-end()  !aAutoSearch.isEmpty())
+if (miAutoPosColumn != pColumnData-end()  !aAutoSearch.isEmpty())
 {
 //  stimmt die Selektion noch? (kann per Maus geaendert sein)
 
@@ -1630,8 +1630,8 @@ void ScInputHandler::NextAutoEntry( bool bBack )
 if ( aSel.nEndPos == nParLen  aText.getLength() == 
aAutoSearch.getLength() + nSelLen )
 {
 rtl::OUString aNew;
-miAutoPos = findText(*pColumnData, miAutoPos, aAutoSearch, 
aNew, bBack);
-if (miAutoPos != pColumnData-end())
+miAutoPosColumn = findText(*pColumnData, miAutoPosColumn, 
aAutoSearch, aNew, bBack);
+if (miAutoPosColumn != pColumnData-end())
 {
 

[Libreoffice-commits] .: sc/source

2012-02-09 Thread Kohei Yoshida
 sc/source/filter/dif/difexp.cxx |  159 
 1 file changed, 83 insertions(+), 76 deletions(-)

New commits:
commit 70afc6aac31ea619000690b5478006bbc3f04a13
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Thu Feb 9 22:23:16 2012 -0500

ByteString,UniString to rtl variants.

diff --git a/sc/source/filter/dif/difexp.cxx b/sc/source/filter/dif/difexp.cxx
index b3da5a3..c7b08b8 100644
--- a/sc/source/filter/dif/difexp.cxx
+++ b/sc/source/filter/dif/difexp.cxx
@@ -44,6 +44,7 @@
 #include progress.hxx
 #include rtl/tencinfo.h
 #include ftools.hxx
+#include rtl/strbuf.hxx
 
 FltError ScFormatFilterPluginImpl::ScExportDif( SvStream rStream, ScDocument* 
pDoc,
 const ScAddress rOutPos, const CharSet eNach, sal_uInt32 nDifOption )
@@ -72,9 +73,9 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream 
rOut, ScDocument* pDoc
 rOut.SetStreamCharSet( eCharSet );
 
 sal_Unicode cStrDelim('');
-ByteString aStrDelimEncoded;// only used if not Unicode
-UniString aStrDelimDecoded; // only used if context encoding
-sal_Bool bContextOrNotAsciiEncoding;
+rtl::OString aStrDelimEncoded;// only used if not Unicode
+rtl::OUString aStrDelimDecoded; // only used if context encoding
+bool bContextOrNotAsciiEncoding;
 if ( eCharSet == RTL_TEXTENCODING_UNICODE )
 {
 rOut.StartWritingUnicodeText();
@@ -91,7 +92,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream 
rOut, ScDocument* pDoc
 (((aInfo.Flags  RTL_TEXTENCODING_INFO_CONTEXT) != 0) ||
  ((aInfo.Flags  RTL_TEXTENCODING_INFO_ASCII) == 0));
 if ( bContextOrNotAsciiEncoding )
-aStrDelimDecoded = String( aStrDelimEncoded, eCharSet );
+aStrDelimDecoded = rtl::OStringToOUString(aStrDelimEncoded, 
eCharSet);
 }
 else
 bContextOrNotAsciiEncoding = false;
@@ -105,7 +106,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream 
rOut, ScDocument* pDoc
 const sal_Char* pNumDataERROR = 0,0\nERROR\n;
 
 FltErroreRet = eERR_OK;
-String  aOS;
+rtl::OUStringBuffer aOS;
 rtl::OUString   aString;
 SCCOL   nEndCol = rRange.aEnd.Col();
 SCROW   nEndRow = rRange.aEnd.Row();
@@ -115,7 +116,7 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream 
rOut, ScDocument* pDoc
 
 double  fVal;
 
-const sal_Bool  bPlain = ( nDifOption == SC_DIFOPT_PLAIN );
+const bool bPlain = ( nDifOption == SC_DIFOPT_PLAIN );
 
 ScProgress  aPrgrsBar( pDoc-GetDocumentShell(), 
ScGlobal::GetRscString( STR_LOAD_DOC ), nNumRows );
 
@@ -124,35 +125,35 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream 
rOut, ScDocument* pDoc
 // TABLE
 OSL_ENSURE( pDoc-HasTable( nTab ), *ScExportDif(): Tabelle nicht 
vorhanden! );
 
-aOS = pKeyTABLE;
-aOS.AppendAscii( \n0,1\n\ );
+aOS.append(pKeyTABLE);
+aOS.appendAscii(\n0,1\n\);
 
 pDoc-GetName( nTab, aString );
-aOS.Append(String(aString));
-aOS.AppendAscii( \\n );
-rOut.WriteUnicodeOrByteText( aOS );
+aOS.append(aString);
+aOS.appendAscii(\\n);
+rOut.WriteUnicodeOrByteText(aOS.makeStringAndClear());
 
 // VECTORS
-aOS = pKeyVECTORS;
-aOS.AppendAscii( \n0, );
-aOS += String::CreateFromInt32( nNumCols );
-aOS += sal_Unicode('\n');
-aOS.AppendAscii( p2DoubleQuotes_LF );
-rOut.WriteUnicodeOrByteText( aOS );
+aOS.append(pKeyVECTORS);
+aOS.appendAscii(\n0,);
+aOS.append(static_castsal_Int32(nNumCols));
+aOS.append(sal_Unicode('\n'));
+aOS.appendAscii(p2DoubleQuotes_LF);
+rOut.WriteUnicodeOrByteText(aOS.makeStringAndClear());
 
 // TUPLES
-aOS = pKeyTUPLES;
-aOS.AppendAscii( \n0, );
-aOS += String::CreateFromInt32( nNumRows );
-aOS += sal_Unicode('\n');
-aOS.AppendAscii( p2DoubleQuotes_LF );
-rOut.WriteUnicodeOrByteText( aOS );
+aOS.append(pKeyTUPLES);
+aOS.appendAscii(\n0,);
+aOS.append(static_castsal_Int32(nNumRows));
+aOS.append(sal_Unicode('\n'));
+aOS.appendAscii(p2DoubleQuotes_LF);
+rOut.WriteUnicodeOrByteText(aOS.makeStringAndClear());
 
 // DATA
-aOS = pKeyDATA;
-aOS.AppendAscii( \n0,0\n );
-aOS.AppendAscii( p2DoubleQuotes_LF );
-rOut.WriteUnicodeOrByteText( aOS );
+aOS.append(pKeyDATA);
+aOS.appendAscii(\n0,0\n);
+aOS.appendAscii(p2DoubleQuotes_LF);
+rOut.WriteUnicodeOrByteText(aOS.makeStringAndClear());
 
 SCCOL   nColCnt;
 SCROW   nRowCnt;
@@ -160,12 +161,14 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream 
rOut, ScDocument* pDoc
 
 for( nRowCnt = rRange.aStart.Row() ; nRowCnt = nEndRow ; nRowCnt++ )
 {
-aOS.AssignAscii( pSpecDataType_LF );
-aOS += pKeyBOT;
-aOS += sal_Unicode('\n');
-rOut.WriteUnicodeOrByteText( aOS );
+

[Libreoffice-commits] .: sc/source

2012-02-09 Thread Kohei Yoshida
 sc/source/ui/unoobj/scdetect.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e20365e6dd940ff5564fa106a2bcbd174bce307e
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Thu Feb 9 22:39:32 2012 -0500

ByteString to rtl::OString.

diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index a460a02..d9b644f 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -734,9 +734,9 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 // get file header
 rStr.Seek( 0 );
 const sal_Size nTrySize = 80;
-ByteString aHeader = read_uInt8s_ToOString(rStr, 
nTrySize);
+rtl::OString aHeader = read_uInt8s_ToOString(rStr, 
nTrySize);
 
-if ( HTMLParser::IsHTMLFormat( aHeader.GetBuffer() 
) )
+if ( HTMLParser::IsHTMLFormat(aHeader.getStr()) )
 {
 // test for HTML
 if ( 
pPreselectedFilter-GetName().EqualsAscii(pFilterHtml) )
@@ -750,7 +750,7 @@ static sal_Bool lcl_MayBeDBase( SvStream rStream )
 bFakeXLS = true;
 }
 }
-else if ( aHeader.CompareTo( {\\rtf, 5 ) == 
COMPARE_EQUAL )
+else if ( aHeader.copy(0, 5).equalsL({\\rtf, 5) )
 {
 // test for RTF
 pFilter = aMatcher.GetFilter4FilterName( 
String::CreateFromAscii(pFilterRtf) );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-07 Thread Stephan Bergmann
 sc/source/core/tool/callform.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit cbccd5b5050ec8a1f4ee6532e71a6a245db6da2e
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Feb 7 11:33:56 2012 +0100

Namespace scope fix

diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx
index ab0b8fc..949e642 100644
--- a/sc/source/core/tool/callform.cxx
+++ b/sc/source/core/tool/callform.cxx
@@ -163,8 +163,6 @@ public:
 
 ModuleCollection aModuleCollection;
 
-}
-
 const ModuleData* ModuleCollection::findByName(const rtl::OUString rName) 
const
 {
 MapType::const_iterator it = maData.find(rName);
@@ -185,6 +183,8 @@ void ModuleCollection::clear()
 maData.clear();
 }
 
+}
+
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
 bool InitExternalFunc(const rtl::OUString rModuleName)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-02-07 Thread Noel Power
 sc/source/ui/app/inputwin.cxx |   17 +
 sc/source/ui/inc/inputwin.hxx |4 
 2 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit 09d7b5e6039827d0f02f424370f929caff179ac9
Author: Noel Power noel.po...@novell.com
Date:   Tue Feb 7 15:36:29 2012 +

make ctrl-shift-f2 change focus to the inputline fdo#40957

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 3771d37..ebdea66 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -697,7 +697,7 @@ void ScInputWindow::StopEditEngine( sal_Bool bAll )
 
 void ScInputWindow::TextGrabFocus()
 {
-aTextWindow.GrabFocus();
+aTextWindow.TextGrabFocus();
 }
 
 void ScInputWindow::TextInvalidate()
@@ -712,12 +712,13 @@ void ScInputWindow::SwitchToTextWin()
 aTextWindow.StartEditEngine();
 if ( SC_MOD()-IsEditMode() )
 {
-aTextWindow.GrabFocus();
+aTextWindow.TextGrabFocus();
 EditView* pView = aTextWindow.GetEditView();
 if (pView)
 {
-xub_StrLen nLen = pView-GetEditEngine()-GetTextLen(0);
-ESelection aSel( 0, nLen, 0, nLen );
+sal_uInt16 nPara =  pView-GetEditEngine()-GetParagraphCount() ? 
( pView-GetEditEngine()-GetParagraphCount() - 1 ) : 0;
+xub_StrLen nLen = pView-GetEditEngine()-GetTextLen( nPara );
+ESelection aSel( nPara, nLen, nPara, nLen );
 pView-SetSelection( aSel );// set cursor to end 
of text
 }
 }
@@ -1115,6 +1116,10 @@ IMPL_LINK( ScInputBarGroup, Impl_ScrollHdl, ScrollBar*, 
EMPTYARG )
 return 0;
 }
 
+void ScInputBarGroup::TextGrabFocus()
+{
+aMultiTextWnd.TextGrabFocus();
+}
 
 //
 //  ScMultiTextWnd
@@ -2022,6 +2027,10 @@ void ScTextWnd::DataChanged( const DataChangedEvent 
rDCEvt )
 Window::DataChanged( rDCEvt );
 }
 
+void ScTextWnd::TextGrabFocus()
+{
+GrabFocus();
+}
 
 //
 //  Positionsfenster
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 185ac45..b0facf1 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -65,6 +65,7 @@ public:
 virtual voidMakeDialogEditView() = 0;
 virtual voidSetFormulaMode( sal_Bool bSet ) = 0;
 virtual sal_BoolIsInputActive() = 0;
+virtual voidTextGrabFocus() = 0;
 };
 
 class ScTextWnd : public ScTextWndBase, public DragSourceHelper // edit 
window
@@ -85,6 +86,8 @@ public:
 virtual voidStartEditEngine();
 virtual voidStopEditEngine( sal_Bool bAll );
 
+virtual voidTextGrabFocus();
+
 virtual voidDataChanged( const DataChangedEvent rDCEvt );
 
 virtual voidSetFormulaMode( sal_Bool bSet );
@@ -225,6 +228,7 @@ public:
 virtual voidResize();
 virtual const String   GetTextString() const;
 virtual voidStopEditEngine( sal_Bool bAll );
+virtual voidTextGrabFocus();
 voidInitEditEngine(SfxObjectShell* pObjSh);
 voidSetFormulaMode( sal_Bool bSet );
 boolIsFocus();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source svl/inc svl/source

2012-02-06 Thread Kohei Yoshida
 sc/source/ui/app/scmod.cxx|   42 +++---
 sc/source/ui/docshell/docsh4.cxx  |   19 ++-
 sc/source/ui/drawfunc/fuins2.cxx  |9 +--
 sc/source/ui/pagedlg/scuitphfedit.cxx |   13 ++
 sc/source/ui/view/cellsh1.cxx |   42 --
 sc/source/ui/view/cellsh2.cxx |5 
 sc/source/ui/view/cellsh4.cxx |   14 +++
 sc/source/ui/view/tabvwsh3.cxx|6 +---
 sc/source/ui/view/tabvwshd.cxx|5 
 sc/source/ui/view/tabvwshf.cxx|   29 +--
 svl/inc/svl/itemset.hxx   |2 +
 svl/source/items/itemset.cxx  |5 
 12 files changed, 77 insertions(+), 114 deletions(-)

New commits:
commit e64c291c5fd1d3ff625dc118ad7e0460df03eb78
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Mon Feb 6 14:29:55 2012 -0500

I think it's time we had a real method for this...

This helps eliminate dozens of IS_AVAILABLE macros scattered across
Calc code.  I'm sure we have other similar macros like this
elsewhere.

diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index a011370..7072387 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -958,8 +958,6 @@ sal_uInt16 ScModule::GetOptDigitLanguage()
 //  und SID_AUTOSPELL_CHECK
 //
 
-#define IS_AVAILABLE(w,item) 
(SFX_ITEM_SET==rOptSet.GetItemState((w),sal_True,item))
-
 void ScModule::ModifyOptions( const SfxItemSet rOptSet )
 {
 sal_uInt16 nOldSpellLang, nOldCjkLang, nOldCtlLang;
@@ -996,26 +994,26 @@ void ScModule::ModifyOptions( const SfxItemSet rOptSet )
 
 //  Linguistik nicht mehr
 
-if ( IS_AVAILABLE(SID_ATTR_METRIC,pItem) )
+if (rOptSet.HasItem(SID_ATTR_METRIC, pItem))
 {
 PutItem( *pItem );
 pAppCfg-SetAppMetric( (FieldUnit)((const 
SfxUInt16Item*)pItem)-GetValue() );
 bSaveAppOptions = sal_True;
 }
 
-if ( IS_AVAILABLE(SCITEM_USERLIST,pItem) )
+if (rOptSet.HasItem(SCITEM_USERLIST, pItem))
 {
 ScGlobal::SetUserList( ((const ScUserListItem*)pItem)-GetUserList() );
 bSaveAppOptions = sal_True;
 }
 
-if ( IS_AVAILABLE(SID_SC_OPT_SYNCZOOM,pItem) )
+if (rOptSet.HasItem(SID_SC_OPT_SYNCZOOM, pItem))
 {
 pAppCfg-SetSynchronizeZoom( static_castconst 
SfxBoolItem*(pItem)-GetValue() );
 bSaveAppOptions = sal_True;
 }
 
-if ( IS_AVAILABLE(SID_SC_OPT_KEY_BINDING_COMPAT,pItem) )
+if (rOptSet.HasItem(SID_SC_OPT_KEY_BINDING_COMPAT, pItem))
 {
 sal_uInt16 nVal = static_castconst SfxUInt16Item*(pItem)-GetValue();
 ScOptionsUtil::KeyBindingType eOld = pAppCfg-GetKeyBindingType();
@@ -1032,7 +1030,7 @@ void ScModule::ModifyOptions( const SfxItemSet rOptSet )
 // ViewOptions
 //
 
-if ( IS_AVAILABLE(SID_SCVIEWOPTIONS,pItem) )
+if (rOptSet.HasItem(SID_SCVIEWOPTIONS, pItem))
 {
 const ScViewOptions rNewOpt = ((const 
ScTpViewItem*)pItem)-GetViewOptions();
 
@@ -1064,7 +1062,7 @@ void ScModule::ModifyOptions( const SfxItemSet rOptSet )
 // da GridOptions Member der ViewOptions ist!
 //
 
-if ( IS_AVAILABLE(SID_ATTR_GRID_OPTIONS,pItem) )
+if ( rOptSet.HasItem(SID_ATTR_GRID_OPTIONS,pItem) )
 {
 ScGridOptions aNewGridOpt( (const SvxOptionsGrid)((const 
SvxGridItem)*pItem) );
 
@@ -1098,7 +1096,7 @@ void ScModule::ModifyOptions( const SfxItemSet rOptSet )
 // DocOptions
 //
 
-if ( IS_AVAILABLE(SID_SCDOCOPTIONS,pItem) )
+if ( rOptSet.HasItem(SID_SCDOCOPTIONS,pItem) )
 {
 const ScDocOptions rNewOpt = ((const 
ScTpCalcItem*)pItem)-GetDocOptions();
 
@@ -1126,7 +1124,7 @@ void ScModule::ModifyOptions( const SfxItemSet rOptSet )
 }
 
 // nach den eigentlichen DocOptions auch noch die TabDistance setzen
-if ( IS_AVAILABLE(SID_ATTR_DEFTABSTOP,pItem) )
+if ( rOptSet.HasItem(SID_ATTR_DEFTABSTOP,pItem) )
 {
 sal_uInt16 nTabDist = ((SfxUInt16Item*)pItem)-GetValue();
 ScDocOptions aOpt(GetDocOptions());
@@ -1146,7 +1144,7 @@ void ScModule::ModifyOptions( const SfxItemSet rOptSet )
 
 //  AutoSpell nach den Doc-Options (weil Member)
 
-if ( IS_AVAILABLE(SID_AUTOSPELL_CHECK,pItem) )  // an 
Doc-Options
+if ( rOptSet.HasItem(SID_AUTOSPELL_CHECK,pItem) )  // an 
Doc-Options
 {
 sal_Bool bDoAutoSpell = ((const SfxBoolItem*)pItem)-GetValue();
 
@@ -1192,43 +1190,43 @@ void ScModule::ModifyOptions( const SfxItemSet rOptSet 
)
 // InputOptions
 //
 
-if ( IS_AVAILABLE(SID_SC_INPUT_SELECTIONPOS,pItem) )
+if ( rOptSet.HasItem(SID_SC_INPUT_SELECTIONPOS,pItem) )
 {
 pInputCfg-SetMoveDir( ((const SfxUInt16Item*)pItem)-GetValue() );
 

  1   2   3   >