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

2012-11-15 Thread Libreoffice Gerrit user
 sc/inc/conditio.hxx|   77 +--
 sc/inc/globstr.hrc |5 
 sc/source/core/data/conditio.cxx   |  173 -
 sc/source/filter/oox/condformatbuffer.cxx  |   82 ++-
 sc/source/ui/condformat/condformatdlg.cxx  |   12 +
 sc/source/ui/condformat/condformatdlgentry.cxx |  145 +---
 sc/source/ui/condformat/condformathelper.cxx   |5 
 sc/source/ui/inc/condformatdlg.hrc |2 
 sc/source/ui/inc/condformatdlgentry.hxx|   27 +++
 sc/source/ui/inc/condformathelper.hxx  |3 
 sc/source/ui/src/condformatdlg.src |   25 +++
 sc/source/ui/src/globstr.src   |4 
 12 files changed, 451 insertions(+), 109 deletions(-)

New commits:
commit 29206b09ca6bf2dfc5596b91fc80a0c1b62dcd6b
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Nov 15 23:37:42 2012 +0100

ui part for conditional date formats

Change-Id: I96893aaa016e6947d354aac4d7bc88da693095da

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index ea2d870..4fc17bd 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -612,9 +612,10 @@
 #define STR_COND_ENDS_WITH  487
 #define STR_COND_CONTAINS   488
 #define STR_COND_NOT_CONTAINS   489
+#define STR_COND_DATE   490
 
-#define STR_ERR_CONDFORMAT_PROTECTED 490
+#define STR_ERR_CONDFORMAT_PROTECTED 491
 
-#define STR_COUNT   491
+#define STR_COUNT   492
 
 #endif
diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index 8ef887c..5212f62 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -91,6 +91,9 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const 
ResId rResId, ScDocum
 break;
 case condformat::ICONSET:
 break;
+case condformat::DATE:
+maEntries.push_back(new ScDateFrmtEntry( this, mpDoc, 
static_castconst ScCondDateFormatEntry*( pEntry ) ) );
+break;
 }
 }
 }
@@ -249,6 +252,7 @@ IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox)
 {
 case condformat::entry::FORMULA:
 case condformat::entry::CONDITION:
+case condformat::entry::DATE:
 break;
 case condformat::entry::COLORSCALE2:
 case condformat::entry::COLORSCALE3:
@@ -275,6 +279,14 @@ IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox)
 static_castScCondFormatDlg*(GetParent())-InvalidateRefData();
 itr-SetActive();
 break;
+case 3:
+if(itr-GetType() == condformat::entry::DATE)
+return 0;
+
+maEntries.replace( itr, new ScDateFrmtEntry( this, mpDoc ));
+static_castScCondFormatDlg*(GetParent())-InvalidateRefData();
+itr-SetActive();
+break;
 }
 RecalcAll();
 return 0;
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index 817da0b..05e9335 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -254,7 +254,6 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( Window* 
pParent, ScDocument* pDoc, c
 
 void ScConditionFrmtEntry::Init()
 {
-maLbStyle.SetSeparatorPos(0);
 maEdVal1.SetGetFocusHdl( LINK( GetParent()-GetParent(), ScCondFormatDlg, 
RangeGetFocusHdl ) );
 maEdVal2.SetGetFocusHdl( LINK( GetParent()-GetParent(), ScCondFormatDlg, 
RangeGetFocusHdl ) );
 maEdVal1.SetLoseFocusHdl( LINK( GetParent()-GetParent(), ScCondFormatDlg, 
RangeLoseFocusHdl ) );
@@ -266,6 +265,7 @@ void ScConditionFrmtEntry::Init()
 maEdVal1.SetModifyHdl( LINK( this, ScCondFrmtEntry, EdModifyHdl ) );
 maEdVal2.SetModifyHdl( LINK( this, ScCondFrmtEntry, EdModifyHdl ) );
 
+maLbStyle.SetSeparatorPos(0);
 SfxStyleSheetIterator aStyleIter( mpDoc-GetStyleSheetPool(), 
SFX_STYLE_FAMILY_PARA );
 for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = 
aStyleIter.Next() )
 {
@@ -402,9 +402,11 @@ void ScConditionFrmtEntry::SetInactive()
 Deselect();
 }
 
-IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl)
+namespace {
+
+void StyleSelect( ListBox rLbStyle, ScDocument* pDoc, SvxFontPrevWindow 
rWdPreview )
 {
-if(maLbStyle.GetSelectEntryPos() == 0)
+if(rLbStyle.GetSelectEntryPos() == 0)
 {
 // call new style dialog
 SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA );
@@ -430,26 +432,32 @@ IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl)
 
 // Find the new style and add it into the style list boxes
 rtl::OUString aNewStyle;
-SfxStyleSheetIterator aStyleIter( 

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

2012-05-25 Thread Noel Power
 sc/inc/global.hxx|   18 ---
 sc/source/core/data/global.cxx   |  147 ---
 sc/source/filter/excel/read.cxx  |9 -
 sc/source/filter/excel/xiescher.cxx  |   22 
 sc/source/filter/oox/drawingbase.cxx |5 -
 sc/source/filter/oox/drawingfragment.cxx |7 -
 sc/source/ui/unoobj/docuno.cxx   |   65 +++--
 sc/source/ui/view/drawutil.cxx   |   12 --
 sc/source/ui/view/drawvie4.cxx   |2 
 sc/source/ui/view/drawview.cxx   |2 
 sc/source/ui/view/gridwin3.cxx   |2 
 sc/source/ui/view/viewdata.cxx   |7 -
 12 files changed, 64 insertions(+), 234 deletions(-)

New commits:
commit 56f450187343688f20f88e68a849c8dcd660b629
Author: Noel Power noel.po...@novell.com
Date:   Thu May 24 17:11:21 2012 +0100

Revert tweak imported shape position for xls( binary ) format fdo#49430

This reverts commit 5813422d3eb9657c5a818057be0ebf831ca6a794.

diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 0b45e5f..08b56bc 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -52,7 +52,6 @@
 #include root.hxx
 #include imp_op.hxx
 #include excimp8.hxx
-#include sfx2/objsh.hxx
 
 FltError ImportExcel::Read( void )
 {
@@ -1310,14 +1309,6 @@ FltError ImportExcel8::Read( void )
 PostDocLoad();
 
 pD-CalcAfterLoad();
-SfxObjectShell* pDocShell = GetDocShell();
-
-if ( pDocShell )
-{
-std::vector OrientationInfo  savedOrientations;
-ScGlobal::CaptureShapeOrientationInfo( savedOrientations, 
pDocShell-GetModel() );
-ScGlobal::ApplyShapeOrientationInfo( savedOrientations, 
pDocShell-GetModel(), *pD );
-}
 
 // import change tracking data
 XclImpChangeTrack aImpChTr( GetRoot(), maStrm );
diff --git a/sc/source/filter/excel/xiescher.cxx 
b/sc/source/filter/excel/xiescher.cxx
index 932f956..74ed03b 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -497,28 +497,6 @@ void XclImpDrawObjBase::PreProcessSdrObject( 
XclImpDffConverter rDffConv, SdrOb
 }
 }
 
-if ( GetAnchor() )
-{
-ScDrawObjData* pAnchor = ScDrawLayer::GetObjData( rSdrObj, sal_True);
-if ( pAnchor )
-{
-// Temporarily get start position of shape.
-// At the end of the import we do some post processing
-// to adjust the shape position to take into account
-// errors between the drawing layer and the view/grid
-pAnchor-maStart.SetRow( GetAnchor()-maFirst.mnRow );
-pAnchor-maStart.SetCol( GetAnchor()-maFirst.mnCol );
-pAnchor-maStart.SetTab( GetTab() );
-XclObjAnchor tmpAnchor( *GetAnchor() );
-
-// Calculate the start offset ( from the cell postion )
-Rectangle withOffset = tmpAnchor.GetRect( GetRoot(), GetTab(), 
MAP_100TH_MM );
-tmpAnchor.mnLX = tmpAnchor.mnTY = tmpAnchor.mnRX = tmpAnchor.mnBY 
= 0;
-Rectangle noOffset =  tmpAnchor.GetRect( GetRoot(), GetTab(), 
MAP_100TH_MM );
-pAnchor-maStartOffset.X() = withOffset.Left() - noOffset.Left();
-pAnchor-maStartOffset.Y() = withOffset.Top() - noOffset.Top();
-}
-}
 // call virtual function for object type specific processing
 DoPreProcessSdrObj( rDffConv, rSdrObj );
 }
commit 3ed479a1d83916cb5dc3be0eee0aa6fbe65a844a
Author: Noel Power noel.po...@novell.com
Date:   Thu May 24 16:49:55 2012 +0100

Revert fix bad import positions of shapes  controls fdo#49430

This reverts commit 9dc4fa1b22a533ba0a6ce0353112c55eef8a14ef.

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index c431598..c4c2e87 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -34,7 +34,6 @@
 #include tools/stream.hxx
 #include osl/endian.h
 #include com/sun/star/uno/Reference.hxx
-#include com/sun/star/table/CellAddress.hpp
 #include scdllapi.h
 
 #include boost/unordered_map.hpp
@@ -499,27 +498,12 @@ namespace com { namespace sun { namespace star {
 namespace i18n {
 class XOrdinalSuffix;
 }
-namespace frame {
-class XModel;
-}
-namespace drawing {
-class XShape;
-}
 }}}
 namespace utl {
 class TransliterationWrapper;
 }
 
 #ifndef _SCALC_EXE
-struct SC_DLLPUBLIC OrientationInfo
-{
-OrientationInfo() : mnVert( 0 ), mnHori( 0 ) {}
-::com::sun::star::uno::Reference ::com::sun::star::drawing::XShape  
mxShape;
-::com::sun::star::table::CellAddress maAddress;
-sal_Int32 mnVert;
-sal_Int32 mnHori;
-};
-
 class ScGlobal
 {
 static SvxSearchItem*   pSearchItem;
@@ -712,8 +696,6 @@ SC_DLLPUBLICstatic const sal_Unicode* FindUnquoted( 
const sal_Unicode* pStri
 
 /** Obtain the ordinal suffix for a number according to the system locale 
*/
 static String   GetOrdinalSuffix( 

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

2012-03-15 Thread Kohei Yoshida
 sc/inc/dpcache.hxx |9 
 sc/inc/dpitemdata.hxx  |2 
 sc/source/core/data/dpcache.cxx|  401 +
 sc/source/core/data/dpdimsave.cxx  |   12 -
 sc/source/core/data/dpitemdata.cxx |   11 +
 5 files changed, 254 insertions(+), 181 deletions(-)

New commits:
commit 20d55ad66f0f94c9f6a583b5406a39717c1c6d46
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Mar 15 15:39:51 2012 -0400

Consolidated file-local functions.

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 140885e..08b0d25 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -62,89 +62,6 @@ using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::UNO_QUERY;
 using ::com::sun::star::uno::UNO_QUERY_THROW;
 
-namespace {
-
-void getItemValue(
-ScDPItemData rData, const Referencesdbc::XRow xRow, sal_Int32 nType,
-long nCol, const Date rNullDate, short rNumType)
-{
-rNumType = NUMBERFORMAT_NUMBER;
-try
-{
-double fValue = 0.0;
-switch (nType)
-{
-case sdbc::DataType::BIT:
-case sdbc::DataType::BOOLEAN:
-{
-rNumType = NUMBERFORMAT_LOGICAL;
-fValue  = xRow-getBoolean(nCol) ? 1 : 0;
-rData.SetValue(fValue);
-break;
-}
-case sdbc::DataType::TINYINT:
-case sdbc::DataType::SMALLINT:
-case sdbc::DataType::INTEGER:
-case sdbc::DataType::BIGINT:
-case sdbc::DataType::FLOAT:
-case sdbc::DataType::REAL:
-case sdbc::DataType::DOUBLE:
-case sdbc::DataType::NUMERIC:
-case sdbc::DataType::DECIMAL:
-{
-//! do the conversion here?
-fValue = xRow-getDouble(nCol);
-rData.SetValue(fValue);
-break;
-}
-case sdbc::DataType::DATE:
-{
-rNumType = NUMBERFORMAT_DATE;
-
-util::Date aDate = xRow-getDate(nCol);
-fValue = Date(aDate.Day, aDate.Month, aDate.Year) - rNullDate;
-rData.SetValue(fValue);
-break;
-}
-case sdbc::DataType::TIME:
-{
-rNumType = NUMBERFORMAT_TIME;
-
-util::Time aTime = xRow-getTime(nCol);
-fValue = ( aTime.Hours * 3600 + aTime.Minutes * 60 +
-   aTime.Seconds + aTime.HundredthSeconds / 100.0 ) / 
D_TIMEFACTOR;
-rData.SetValue(fValue);
-break;
-}
-case sdbc::DataType::TIMESTAMP:
-{
-rNumType = NUMBERFORMAT_DATETIME;
-
-util::DateTime aStamp = xRow-getTimestamp(nCol);
-fValue = ( Date( aStamp.Day, aStamp.Month, aStamp.Year ) - 
rNullDate ) +
- ( aStamp.Hours * 3600 + aStamp.Minutes * 60 +
-   aStamp.Seconds + aStamp.HundredthSeconds / 100.0 ) 
/ D_TIMEFACTOR;
-rData.SetValue(fValue);
-break;
-}
-case sdbc::DataType::CHAR:
-case sdbc::DataType::VARCHAR:
-case sdbc::DataType::LONGVARCHAR:
-case sdbc::DataType::SQLNULL:
-case sdbc::DataType::BINARY:
-case sdbc::DataType::VARBINARY:
-case sdbc::DataType::LONGVARBINARY:
-default:
-rData.SetString(xRow-getString(nCol));
-}
-}
-catch (uno::Exception)
-{
-}
-}
-
-}
-
 ScDPCache::GroupItems::GroupItems() {}
 
 ScDPCache::GroupItems::GroupItems(const ScDPNumGroupInfo rInfo) :
@@ -282,6 +199,85 @@ void initFromCell(ScDocument* pDoc, SCCOL nCol, SCROW 
nRow, SCTAB nTab, ScDPItem
 }
 }
 
+void getItemValue(
+ScDPItemData rData, const Referencesdbc::XRow xRow, sal_Int32 nType,
+long nCol, const Date rNullDate, short rNumType)
+{
+rNumType = NUMBERFORMAT_NUMBER;
+try
+{
+double fValue = 0.0;
+switch (nType)
+{
+case sdbc::DataType::BIT:
+case sdbc::DataType::BOOLEAN:
+{
+rNumType = NUMBERFORMAT_LOGICAL;
+fValue  = xRow-getBoolean(nCol) ? 1 : 0;
+rData.SetValue(fValue);
+break;
+}
+case sdbc::DataType::TINYINT:
+case sdbc::DataType::SMALLINT:
+case sdbc::DataType::INTEGER:
+case sdbc::DataType::BIGINT:
+case sdbc::DataType::FLOAT:
+case sdbc::DataType::REAL:
+case sdbc::DataType::DOUBLE:
+case sdbc::DataType::NUMERIC:
+case sdbc::DataType::DECIMAL:
+{
+//! do the conversion here?
+fValue = xRow-getDouble(nCol);
+rData.SetValue(fValue);
+