[PATCH] Sidebar conversion to .ui for sidebar_page_property

2013-06-15 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/4298

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/98/4298/1

Sidebar conversion to .ui for sidebar_page_property

Change-Id: I6ffc36fa8d3c6656392354864092f6cbc7e3c30d
---
M sw/UIConfig_swriter.mk
M sw/source/ui/sidebar/PagePropertyPanel.cxx
M sw/source/ui/sidebar/PagePropertyPanel.hrc
M sw/source/ui/sidebar/PagePropertyPanel.hxx
M sw/source/ui/sidebar/PagePropertyPanel.src
A sw/uiconfig/swriter/ui/sidebarpage.ui
6 files changed, 310 insertions(+), 231 deletions(-)



diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index daf19a7..8e336c0 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -106,6 +106,7 @@
sw/uiconfig/swriter/ui/renameautotextdialog \
sw/uiconfig/swriter/ui/renameobjectdialog \
sw/uiconfig/swriter/ui/rowheight \
+   sw/uiconfig/swriter/ui/sidebarpage \
sw/uiconfig/swriter/ui/sortdialog \
sw/uiconfig/swriter/ui/splittable \
sw/uiconfig/swriter/ui/statisticsinfopage \
diff --git a/sw/source/ui/sidebar/PagePropertyPanel.cxx 
b/sw/source/ui/sidebar/PagePropertyPanel.cxx
index 8dc4d28..7780fe5 100644
--- a/sw/source/ui/sidebar/PagePropertyPanel.cxx
+++ b/sw/source/ui/sidebar/PagePropertyPanel.cxx
@@ -49,6 +49,11 @@
 #include com/sun/star/frame/XModel.hpp
 #include com/sun/star/document/XUndoManagerSupplier.hpp
 
+const char UNO_ORIENTATION[] = .uno:Orientation;
+const char UNO_MARGIN[]  = .uno:Margin;
+const char UNO_SIZE[]= .uno:Size;
+const char UNO_COLUMN[]  = .uno:Column;
+
 #define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
 
 namespace {
@@ -98,21 +103,9 @@
 Window* pParent,
 const ::com::sun::star::uno::Reference 
::com::sun::star::frame::XFrame rxFrame,
 SfxBindings* pBindings)
-: Control(pParent, SW_RES(RID_PROPERTYPANEL_SWPAGE))
+: PanelLayout(pParent, PagePropertyPanel, 
modules/swriter/ui/sidebarpage.ui, rxFrame)
 , mpBindings(pBindings)
-// visible controls
-, maFtOrientation( this, SW_RES(FT_ORIENTATION) )
-, mpToolBoxOrientationBackground( 
::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
-, mpToolBoxOrientation( ::sfx2::sidebar::ControlFactory::CreateToolBox( 
mpToolBoxOrientationBackground.get(), SW_RES(TB_ORIENTATION)) )
-, maFtMargin( this, SW_RES(FT_MARGIN) )
-, mpToolBoxMarginBackground( 
::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
-, mpToolBoxMargin( ::sfx2::sidebar::ControlFactory::CreateToolBox( 
mpToolBoxMarginBackground.get(), SW_RES(TB_MARGIN)) )
-, maFtSize( this, SW_RES(FT_SIZE) )
-, mpToolBoxSizeBackground( 
::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
-, mpToolBoxSize( ::sfx2::sidebar::ControlFactory::CreateToolBox( 
mpToolBoxSizeBackground.get(), SW_RES(TB_SIZE)) )
-, maFtColumn( this, SW_RES(FT_COLUMN) )
-, mpToolBoxColumnBackground( 
::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
-, mpToolBoxColumn( ::sfx2::sidebar::ControlFactory::CreateToolBox( 
mpToolBoxColumnBackground.get(), SW_RES(TB_COLUMN)) )
+
 // image resources
 , maImgSize (NULL)
 , maImgSize_L   (NULL)
@@ -158,7 +151,6 @@
 , mImgLeft_L(SW_RES(IMG_PAGE_COLUMN_LEFT_L))
 , mImgRight_L   (SW_RES(IMG_PAGE_COLUMN_RIGHT_L))
 , mImgColumnNone_L  (SW_RES(IMG_PAGE_COLUMN_NONE_L))
-
 , mpPageItem( new SvxPageItem(SID_ATTR_PAGE) )
 , mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE 
) )
 , mpPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE 
) )
@@ -193,68 +185,46 @@
 
 , mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify( false )
 {
+// visible controls
+get(mpToolBoxOrientation, orientation);
+get(mpToolBoxMargin, margin);
+get(mpToolBoxSize, size);
+get(mpToolBoxColumn, column);
+
 Initialize();
 mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify = true;
-FreeResource();
 }
 
 PagePropertyPanel::~PagePropertyPanel()
 {
 delete[] maImgSize;
 delete[] maImgSize_L;
-
-// destroy the toolbox windows.
-mpToolBoxOrientation.reset();
-mpToolBoxMargin.reset();
-mpToolBoxSize.reset();
-mpToolBoxColumn.reset();
-
-// destroy the background windows of the toolboxes.
-mpToolBoxOrientationBackground.reset();
-mpToolBoxMarginBackground.reset();
-mpToolBoxSizeBackground.reset();
-mpToolBoxColumnBackground.reset();
 }
 
 void PagePropertyPanel::Initialize()
 {
-maFtOrientation.SetBackground(Wallpaper());
-maFtMargin.SetBackground(Wallpaper());
-maFtSize.SetBackground(Wallpaper());
-maFtColumn.SetBackground(Wallpaper());
-
 // popup for page orientation
+const sal_uInt16 nIdOrientation = 
mpToolBoxOrientation-GetItemId(UNO_ORIENTATION);
 Link aLink = LINK( 

[PATCH] Sidebar conversion to .ui for CellAppearancePropertyPanel

2013-06-11 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/4227

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/27/4227/1

Sidebar conversion to .ui for CellAppearancePropertyPanel

Change-Id: I90df6ebe428ec201aa204f26447c1728b2120c69
---
M sc/AllLangResTarget_sc.mk
M sc/UIConfig_scalc.mk
M sc/inc/sc.hrc
M sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
M sc/source/ui/sidebar/CellAppearancePropertyPanel.hrc
M sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
M sc/source/ui/sidebar/CellAppearancePropertyPanel.src
M sc/source/ui/src/scstring.src
A sc/uiconfig/scalc/ui/sidebarcellappearance.ui
9 files changed, 259 insertions(+), 307 deletions(-)



diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index b83e0f9..6c9cfde 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -86,7 +86,6 @@
 sc/source/ui/formdlg/formdlgs.src \
 sc/source/ui/formdlg/dwfunctr.src \
 sc/source/ui/sidebar/AlignmentPropertyPanel.src \
-sc/source/ui/sidebar/CellAppearancePropertyPanel.src \
 sc/source/ui/sidebar/NumberFormatPropertyPanel.src \
 sc/source/core/src/compiler.src \
 ))
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 94a8aea..4abee5c 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -84,6 +84,7 @@
sc/uiconfig/scalc/ui/printeroptions \
sc/uiconfig/scalc/ui/protectsheetdlg \
sc/uiconfig/scalc/ui/sheetprintpage \
+   sc/uiconfig/scalc/ui/sidebarcellappearance \
sc/uiconfig/scalc/ui/rightfooterdialog \
sc/uiconfig/scalc/ui/rightheaderdialog \
sc/uiconfig/scalc/ui/selectrange \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 6fbe3f0..5de0877 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -939,6 +939,9 @@
 
 #define SCSTR_FIELDSEP_TAB  (STR_START + 412)
 #define SCSTR_FIELDSEP_SPACE(STR_START + 413)
+#define SCSTR_FILLCOLOR (STR_START + 414)
+#define SCSTR_NOFILLCOLOR   (STR_START + 415)
+#define SCSTR_LINECOLOR (STR_START + 416)
 
 #define STR_END (SCSTR_FIELDSEP_SPACE)
 
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx 
b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index 2ee40a9..c083906 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -45,6 +45,12 @@
 using namespace css;
 using namespace cssu;
 
+const char UNO_CELLBACKGROUND[]   = .uno:CellBackground;
+const char UNO_BORDERTYPE[]   = .uno:BorderType;
+const char UNO_BORDERLINESTYLE[]  = .uno:BorderLineStyle;
+const char UNO_BORDERLINECOLOR[]  = .uno:BorderLineColor;
+const char UNO_GRIDLINESVISIBLE[] = .uno:GridLinesVisible;
+
 #define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
 
 //
@@ -67,13 +73,13 @@
 
 svx::sidebar::PopupControl* 
CellAppearancePropertyPanel::CreateFillColorPopupControl(svx::sidebar::PopupContainer*
 pParent)
 {
-const ScResId aResId(VS_NOFILLCOLOR);
+const ScResId aResId(SCSTR_NOFILLCOLOR);
 
 return new svx::sidebar::ColorControl(
 pParent,
 mpBindings,
 ScResId(RID_POPUPPANEL_CELLAPPEARANCE_FILLCOLOR),
-ScResId(VS_FILLCOLOR),
+ScResId(SCSTR_FILLCOLOR),
 ::boost::bind(GetTransparentColor),
 ::boost::bind(CellAppearancePropertyPanel::SetFillColor, this, _1, 
_2),
 pParent,
@@ -97,7 +103,7 @@
 pParent,
 mpBindings,
 ScResId(RID_POPUPPANEL_CELLAPPEARANCE_LINECOLOR),
-ScResId(VS_LINECOLOR),
+ScResId(SCSTR_LINECOLOR),
 ::boost::bind(GetTransparentColor),
 ::boost::bind(CellAppearancePropertyPanel::SetLineColor, this, _1, 
_2),
 pParent,
@@ -122,7 +128,7 @@
 
 void CellAppearancePropertyPanel::EndCellLineStylePopupMode(void)
 {
-if(mpCellLineStylePopup.get())
+if(mpCellLineStylePopup)
 {
 mpCellLineStylePopup-Hide();
 }
@@ -137,7 +143,7 @@
 
 void CellAppearancePropertyPanel::EndCellBorderStylePopupMode(void)
 {
-if(mpCellBorderStylePopup.get())
+if(mpCellBorderStylePopup)
 {
 mpCellBorderStylePopup-Hide();
 }
@@ -149,28 +155,7 @@
 Window* pParent,
 const cssu::Referencecss::frame::XFrame rxFrame,
 SfxBindings* pBindings)
-:   Control(
-pParent,
-ScResId(RID_PROPERTYPANEL_SC_APPEAR)),
-
-mpFTFillColor(new FixedText(this, ScResId(FT_BK_COLOR))),
-
mpTBFillColorBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
-
mpTBFillColor(sfx2::sidebar::ControlFactory::CreateToolBox(mpTBFillColorBackground.get(),
 ScResId(TB_BK_COLOR))),
-mpFillColorUpdater(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_BRUSH, 
TBI_BK_COLOR, mpTBFillColor.get(), TBX_UPDATER_MODE_CHAR_COLOR_NEW)),
-
-mpFTCellBorder(new FixedText(this, ScResId(FT_BORDER))),
-

[PATCH] Show only filename in Recent Files list on Start Center

2013-05-24 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/4027

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/27/4027/1

Show only filename in Recent Files list on Start Center

Change-Id: I57f7564aae035ce158b819ca1495a547754a95f8
---
M framework/source/services/backingwindow.cxx
1 file changed, 6 insertions(+), 16 deletions(-)



diff --git a/framework/source/services/backingwindow.cxx 
b/framework/source/services/backingwindow.cxx
index f18152b..2cb9f0f 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -353,25 +353,15 @@
 
 if ( aURLObj.GetProtocol() == INET_PROT_FILE )
 {
-// Do handle file URL differently = convert it to a system
-// path and abbreviate it with a special function:
-String aFileSystemPath( aURLObj.getFSysPath( 
INetURLObject::FSYS_DETECT ) );
-
-OUString   aSystemPath( aFileSystemPath );
-OUString   aCompactedSystemPath;
-
-oslFileError nError = osl_abbreviateSystemPath( 
aSystemPath.pData, aCompactedSystemPath.pData, 46, NULL );
-if ( !nError )
-aMenuTitle = String( aCompactedSystemPath );
-else
-aMenuTitle = aSystemPath;
+// Do handle file URL differently: don't show the protocol, 
just the file name
+aMenuTitle = 
aURLObj.GetLastName(INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_UTF8);
 }
 else
 {
-// Use INetURLObject to abbreviate all other URLs
-Reference util::XStringWidth  xStringLength( new 
RecentFilesStringLength() );
-aMenuTitle = aURLObj.getAbbreviated( xStringLength, 46, 
INetURLObject::DECODE_UNAMBIGUOUS );
+// In all other URLs show the protocol name before the file 
name
+aMenuTitle = aURLObj.GetSchemeName(aURLObj.GetProtocol()) + : 
 + aURLObj.getName();
 }
+
 OUStringBuffer aBuf( aMenuTitle.getLength() + 5 );
 if( i  9 )
 {
@@ -382,7 +372,7 @@
 aBuf.appendAscii( 1~0 );
 else
 aBuf.append( i+1 );
-aBuf.appendAscii( :  );
+aBuf.appendAscii( .  );
 aBuf.append( aMenuTitle );
 mpRecentMenu-InsertItem( static_castsal_uInt16(i+1), 
aBuf.makeStringAndClear() );
 }

-- 
To view, visit https://gerrit.libreoffice.org/4027
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I57f7564aae035ce158b819ca1495a547754a95f8
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Prashant Pandey prashant3.yi...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] fdo#61541 : Count Number of selected Cells in calc

2013-04-18 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3475

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/75/3475/1

fdo#61541 : Count Number of selected Cells in calc

Change-Id: If2951dad8463231b4f9c98daa3dfcb8a19ff268e
---
M sc/inc/global.hxx
M sc/inc/globstr.hrc
M sc/source/core/data/column2.cxx
M sc/source/core/data/documen4.cxx
M sc/source/filter/xml/XMLConverter.cxx
M sc/source/ui/src/globstr.src
M sc/source/ui/view/tabvwsha.cxx
M svx/inc/helpid.hrc
M svx/source/stbctrls/stbctrls.h
M svx/source/stbctrls/stbctrls.src
10 files changed, 116 insertions(+), 27 deletions(-)



diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 44bd67a..0ef1bd8 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -741,7 +741,8 @@
 SUBTOTAL_FUNC_STDP  = 8,
 SUBTOTAL_FUNC_SUM   = 9,
 SUBTOTAL_FUNC_VAR   = 10,
-SUBTOTAL_FUNC_VARP  = 11
+SUBTOTAL_FUNC_VARP  = 11,
+SUBTOTAL_FUNC_SELECTION_COUNT = 12
 };
 
 class ScArea;
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index fa41d1d..24727b7 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -679,7 +679,9 @@
 #define STR_UNDO_L2R544
 #define STR_UNDO_R2L545
 
-#define STR_COUNT   546
+#define STR_FUN_TEXT_SELECTION_COUNT546
+
+#define STR_COUNT   547
 
 #endif
 
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index c818c49..82f03cc 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1972,15 +1972,58 @@
 const ScMarkData rMark, ScFunctionData rData, ScFlatBoolRowSegments 
rHiddenRows,
 bool bDoExclude, SCROW nExStartRow, SCROW nExEndRow) const
 {
-SCSIZE nIndex;
-ScMarkedDataIter aDataIter(this, rMark, false);
-while (aDataIter.Next( nIndex ))
+if ( rData.eFunc != SUBTOTAL_FUNC_SELECTION_COUNT )
 {
-SCROW nRow = maItems[nIndex].nRow;
-bool bRowHidden = rHiddenRows.getValue(nRow);
-if ( !bRowHidden )
-if ( !bDoExclude || nRow  nExStartRow || nRow  nExEndRow )
-lcl_UpdateSubTotal( rData, maItems[nIndex].pCell );
+SCSIZE nIndex;
+ScMarkedDataIter aDataIter(this, rMark, false);
+while (aDataIter.Next( nIndex ))
+{
+SCROW nRow = maItems[nIndex].nRow;
+bool bRowHidden = rHiddenRows.getValue(nRow);
+if ( !bRowHidden )
+if ( !bDoExclude || nRow  nExStartRow || nRow  nExEndRow )
+lcl_UpdateSubTotal( rData, maItems[nIndex].pCell );
+}
+}
+else
+{
+SCROW nTop, nBottom;
+
+// ScMarkData::GetArray() returns a valid array only if
+// 'rMark.IsMultiMarked()' returns true.
+// Since ScTable::UpdateSelectionFunction() already checked that first
+// before calling this method it does not need to be repeated here.
+
+ScMarkArrayIter aIter(rMark.GetArray() + nCol);
+ScFlatBoolRowSegments::RangeData aData;
+
+while (aIter.Next( nTop, nBottom ))
+{
+sal_Int32 nCellCount = 0;// to get the count of selected 
visible cells
+SCROW nRow = nTop;
+
+while ( nRow = nBottom )
+{
+if (!rHiddenRows.getRangeData(nRow, aData)) // failed to 
get range data
+break;
+
+if (aData.mnRow2  nBottom)
+aData.mnRow2 = nBottom;
+
+if (!aData.mbValue)
+{
+nCellCount += aData.mnRow2 - nRow + 1;
+
+// Till this point, nCellCount also includes count of 
those cells which are excluded
+// So, they should be decremented now.
+
+if ( bDoExclude  nExStartRow = nRow  nExEndRow = 
aData.mnRow2 )
+nCellCount -= nExEndRow - nExStartRow + 1;
+}
+nRow = aData.mnRow2 + 1;
+}
+rData.nCount += nCellCount;
+}
 }
 }
 
@@ -1988,15 +2031,37 @@
 void ScColumn::UpdateAreaFunction(
 ScFunctionData rData, ScFlatBoolRowSegments rHiddenRows, SCROW 
nStartRow, SCROW nEndRow) const
 {
-SCSIZE nIndex;
-Search( nStartRow, nIndex );
-while ( nIndexmaItems.size()  maItems[nIndex].nRow=nEndRow )
+if ( rData.eFunc != SUBTOTAL_FUNC_SELECTION_COUNT )
 {
-SCROW nRow = maItems[nIndex].nRow;
-bool bRowHidden = rHiddenRows.getValue(nRow);
-if ( !bRowHidden )
-lcl_UpdateSubTotal( rData, maItems[nIndex].pCell );
-++nIndex;
+SCSIZE nIndex;
+Search( nStartRow, nIndex );
+while ( nIndexmaItems.size()  maItems[nIndex].nRow=nEndRow )
+{
+SCROW nRow = maItems[nIndex].nRow;
+bool bRowHidden = rHiddenRows.getValue(nRow);
+if ( !bRowHidden )
+if ( 

[ABANDONED] fdo#61541 : Count Number of selected Cells in calc

2013-04-18 Thread Prashant Pandey (via Code Review)
Prashant Pandey has abandoned this change.

Change subject: fdo#61541 : Count Number of selected Cells in calc
..


Patch Set 1: Abandoned

This patch needs to be at:
https://gerrit.libreoffice.org/#/c/3213/

So, abandoning this patch and changing change-id to move it to its correct 
location !

-- 
To view, visit https://gerrit.libreoffice.org/3475
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: If2951dad8463231b4f9c98daa3dfcb8a19ff268e
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Prashant Pandey prashant3.yi...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] fdo#62096: Replaced some OUString 'compareTo' with '=='

2013-04-06 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3218

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/18/3218/1

fdo#62096: Replaced some OUString 'compareTo' with '=='

Change-Id: I1d095cf5640595789f4ae99f1b0679be88b0baa9
---
M comphelper/inc/comphelper/property.hxx
M comphelper/source/misc/ihwrapnofilter.cxx
M comphelper/source/misc/instancelocker.cxx
M dtrans/source/cnttype/mcnttfactory.cxx
M dtrans/source/generic/clipboardmanager.cxx
M dtrans/source/generic/generic_clipboard.cxx
M dtrans/source/win32/clipb/WinClipboard.cxx
M dtrans/source/win32/ftransl/ftransl.cxx
M embeddedobj/source/commonembedding/xfactory.cxx
M embeddedobj/source/general/xcreator.cxx
M embeddedobj/source/msole/xdialogcreator.cxx
M embeddedobj/source/msole/xolefactory.cxx
M embeddedobj/test/MainThreadExecutor/xexecutor.cxx
M embeddedobj/test/mtexecutor/bitmapcreator.cxx
M embeddedobj/test/mtexecutor/mainthreadexecutor.cxx
M fpicker/source/aqua/SalAquaFilePicker.mm
M fpicker/source/aqua/SalAquaFolderPicker.mm
M fpicker/source/office/iodlg.cxx
M fpicker/source/win32/filepicker/FilePicker.cxx
M fpicker/source/win32/filepicker/VistaFilePicker.cxx
M fpicker/source/win32/folderpicker/FolderPicker.cxx
M shell/source/cmdmail/cmdmailsuppl.cxx
M shell/source/unix/exec/shellexec.cxx
M shell/source/win32/SysShExec.cxx
M shell/source/win32/simplemail/smplmailsuppl.cxx
M svl/source/fsstor/fsfactory.cxx
M svx/source/fmcomp/fmgridif.cxx
27 files changed, 57 insertions(+), 58 deletions(-)



diff --git a/comphelper/inc/comphelper/property.hxx 
b/comphelper/inc/comphelper/property.hxx
index d8e0d3b..fa51d85 100644
--- a/comphelper/inc/comphelper/property.hxx
+++ b/comphelper/inc/comphelper/property.hxx
@@ -58,14 +58,14 @@
 struct PropertyStringEqualFunctor : ::std::binary_function 
::com::sun::star::beans::Property, ::rtl::OUString, bool 
 {
 // 
-inline bool operator()( const ::com::sun::star::beans::Property lhs, 
const ::rtl::OUString rhs ) const
+inline bool operator()( const ::com::sun::star::beans::Property lhs, 
const OUString rhs ) const
 {
-return lhs.Name.compareTo(rhs) == 0;
+return lhs.Name == rhs;
 }
 // 
-inline bool operator()( const ::rtl::OUString lhs, const 
::com::sun::star::beans::Property rhs ) const
+inline bool operator()( const OUString lhs, const 
::com::sun::star::beans::Property rhs ) const
 {
-return lhs.compareTo(rhs.Name) == 0;
+return lhs == rhs.Name;
 }
 };
 
//--
@@ -74,7 +74,7 @@
 {
 bool operator() (const ::com::sun::star::beans::Property x, const 
::com::sun::star::beans::Property y) const
 {
-return x.Name.compareTo(y.Name) == 0;
+return x.Name == y.Name;
 }
 };
 
diff --git a/comphelper/source/misc/ihwrapnofilter.cxx 
b/comphelper/source/misc/ihwrapnofilter.cxx
index 150da2b..c6b6697 100644
--- a/comphelper/source/misc/ihwrapnofilter.cxx
+++ b/comphelper/source/misc/ihwrapnofilter.cxx
@@ -114,7 +114,7 @@
 uno::Sequence ::rtl::OUString  aSeq = 
impl_staticGetSupportedServiceNames();
 
 for ( sal_Int32 nInd = 0; nInd  aSeq.getLength(); nInd++ )
-if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+if ( ServiceName == aSeq[nInd] )
 return sal_True;
 
 return sal_False;
diff --git a/comphelper/source/misc/instancelocker.cxx 
b/comphelper/source/misc/instancelocker.cxx
index 50ca694..a42852f 100644
--- a/comphelper/source/misc/instancelocker.cxx
+++ b/comphelper/source/misc/instancelocker.cxx
@@ -203,7 +203,7 @@
 uno::Sequence ::rtl::OUString  aSeq = getSupportedServiceNames();
 
 for ( sal_Int32 nInd = 0; nInd  aSeq.getLength(); nInd++ )
-if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
+if ( ServiceName == aSeq[nInd] )
 return sal_True;
 
 return sal_False;
diff --git a/dtrans/source/cnttype/mcnttfactory.cxx 
b/dtrans/source/cnttype/mcnttfactory.cxx
index 86eb617..d405b0e 100644
--- a/dtrans/source/cnttype/mcnttfactory.cxx
+++ b/dtrans/source/cnttype/mcnttfactory.cxx
@@ -87,7 +87,7 @@
 Sequence  OUString  SupportedServicesNames = 
MimeContentTypeFactory_getSupportedServiceNames();
 
 for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
-if (SupportedServicesNames[n].compareTo(ServiceName) == 0)
+if (SupportedServicesNames[n] == ServiceName)
 return sal_True;
 
 return sal_False;
diff --git a/dtrans/source/generic/clipboardmanager.cxx 
b/dtrans/source/generic/clipboardmanager.cxx
index be78cdf..e9b8b8f 100644
--- a/dtrans/source/generic/clipboardmanager.cxx
+++ b/dtrans/source/generic/clipboardmanager.cxx

[PATCH] fdo#61541 : Count Number of selected Cells

2013-04-05 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3213

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/13/3213/1

fdo#61541 : Count Number of selected Cells

Change-Id: Ic9c911552f2b03bb496f47251917a3736494dce1
---
M sc/inc/global.hxx
M sc/inc/globstr.hrc
M sc/source/core/data/documen4.cxx
M sc/source/filter/xml/XMLConverter.cxx
M sc/source/ui/src/globstr.src
M sc/source/ui/view/tabvwsha.cxx
M svx/inc/helpid.hrc
M svx/source/stbctrls/stbctrls.h
M svx/source/stbctrls/stbctrls.src
M xmloff/inc/xmloff/xmltoken.hxx
M xmloff/source/core/xmltoken.cxx
11 files changed, 41 insertions(+), 13 deletions(-)



diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 5b3a5ad..00e35d2 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -741,7 +741,8 @@
 SUBTOTAL_FUNC_STDP  = 8,
 SUBTOTAL_FUNC_SUM   = 9,
 SUBTOTAL_FUNC_VAR   = 10,
-SUBTOTAL_FUNC_VARP  = 11
+SUBTOTAL_FUNC_VARP  = 11,
+SUBTOTAL_FUNC_SELECTION_COUNT = 12
 };
 
 class ScArea;
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 9eec9ce..07bb519 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -668,7 +668,9 @@
 #define STR_COND_ABOVE_EQUAL_AVERAGE 535
 #define STR_COND_BELOW_EQUAL_AVERAGE 536
 
-#define STR_COUNT   537
+#define STR_FUN_TEXT_SELECTION_COUNT537
+
+#define STR_COUNT   538
 
 #endif
 
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 3df2fbc..87bd174 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -484,10 +484,15 @@
 
 SCTAB nMax = static_castSCTAB(maTabs.size());
 ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end();
-for (; itr != itrEnd  *itr  nMax  !aData.bError; ++itr)
-if (maTabs[*itr])
+
+if ( aData.eFunc != SUBTOTAL_FUNC_SELECTION_COUNT )
+for (; itr != itrEnd  *itr  nMax  !aData.bError; ++itr)
+ if (maTabs[*itr])
 maTabs[*itr]-UpdateSelectionFunction( aData,
 nStartCol, nStartRow, nEndCol, nEndRow, rMark );
+
+double nCount;
+nCount = ( nEndRow - nStartRow + 1 )*( nEndCol - nStartCol + 1 );
 
 //! rMark an UpdateSelectionFunction uebergeben !
 
@@ -497,6 +502,9 @@
 case SUBTOTAL_FUNC_SUM:
 rResult = aData.nVal;
 break;
+case SUBTOTAL_FUNC_SELECTION_COUNT:
+rResult = nCount;
+break;
 case SUBTOTAL_FUNC_CNT:
 case SUBTOTAL_FUNC_CNT2:
 rResult = aData.nCount;
diff --git a/sc/source/filter/xml/XMLConverter.cxx 
b/sc/source/filter/xml/XMLConverter.cxx
index 751ab1b..32680a5 100644
--- a/sc/source/filter/xml/XMLConverter.cxx
+++ b/sc/source/filter/xml/XMLConverter.cxx
@@ -153,6 +153,7 @@
 case SUBTOTAL_FUNC_MIN: sFuncStr = GetXMLToken( XML_MIN ); 
 break;
 case SUBTOTAL_FUNC_NONE:sFuncStr = GetXMLToken( XML_NONE );
 break;
 case SUBTOTAL_FUNC_PROD:sFuncStr = GetXMLToken( XML_PRODUCT ); 
 break;
+case SUBTOTAL_FUNC_SELECTION_COUNT:sFuncStr = GetXMLToken( 
XML_SELECTION_COUNT );   break;
 case SUBTOTAL_FUNC_STD: sFuncStr = GetXMLToken( XML_STDEV );   
 break;
 case SUBTOTAL_FUNC_STDP:sFuncStr = GetXMLToken( XML_STDEVP );  
 break;
 case SUBTOTAL_FUNC_SUM: sFuncStr = GetXMLToken( XML_SUM ); 
 break;
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 06d1170..2c6b810 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -694,6 +694,10 @@
 {
 Text [ en-US ] = Sum ;
 };
+String STR_FUN_TEXT_SELECTION_COUNT
+{
+Text [ en-US ] = Selection Count ;
+};
 String STR_FUN_TEXT_COUNT
 {
 Text [ en-US ] = Count ;
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 5d8e622..0775485 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -79,6 +79,8 @@
 case SUBTOTAL_FUNC_MAX:  nGlobStrId = STR_FUN_TEXT_MAX; break;
 case SUBTOTAL_FUNC_MIN:  nGlobStrId = STR_FUN_TEXT_MIN; break;
 case SUBTOTAL_FUNC_SUM:  nGlobStrId = STR_FUN_TEXT_SUM; break;
+case SUBTOTAL_FUNC_SELECTION_COUNT: nGlobStrId = 
STR_FUN_TEXT_SELECTION_COUNT; break;
+
 default:
 {
 // added to avoid warnings
@@ -105,7 +107,7 @@
 // Number in the standard format, the other on the cursor 
position
 SvNumberFormatter* pFormatter = pDoc-GetFormatTable();
 sal_uInt32 nNumFmt = 0;
-if ( eFunc != SUBTOTAL_FUNC_CNT  eFunc != SUBTOTAL_FUNC_CNT2 
)
+if ( eFunc != SUBTOTAL_FUNC_CNT  eFunc != SUBTOTAL_FUNC_CNT2 
 eFunc != SUBTOTAL_FUNC_SELECTION_COUNT)
 {
  

[PATCH] fdo#38838 : Replacement of String with OUString in core/char...

2013-03-31 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3142

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/42/3142/1

fdo#38838 : Replacement of String with OUString in core/chart2

Change-Id: I7abf9649a0c5997cebfe3463ce9b633ab59bf3b0
---
M chart2/source/controller/dialogs/DataBrowser.cxx
M chart2/source/controller/dialogs/DataBrowser.hxx
M chart2/source/controller/dialogs/res_ErrorBar.cxx
M chart2/source/controller/dialogs/tp_DataSource.cxx
M chart2/source/controller/main/ChartController_Insert.cxx
M chart2/source/controller/main/ChartController_Tools.cxx
6 files changed, 89 insertions(+), 89 deletions(-)



diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx 
b/chart2/source/controller/dialogs/DataBrowser.cxx
index a291c55..ca424c8 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -160,7 +160,7 @@
 void SetWidth( sal_Int32 nWidth );
 void SetChartType( const Reference chart2::XChartType   xChartType,
bool bSwapXAndYAxis );
-void SetSeriesName( const String  rName );
+void SetSeriesName( const OUString  rName );
 void SetRange( sal_Int32 nStartCol, sal_Int32 nEndCol );
 
 void SetPixelPosX( sal_Int32 nPos );
@@ -309,7 +309,7 @@
 m_spSymbol-SetImage( GetChartTypeImage( xChartType, bSwapXAndYAxis ) );
 }
 
-void SeriesHeader::SetSeriesName( const String  rName )
+void SeriesHeader::SetSeriesName( const OUString  rName )
 {
 m_spSeriesName-SetText( rName );
 }
@@ -616,7 +616,7 @@
 spHeader-SetColor( Color( nColor ));
 spHeader-SetChartType( aIt-m_xChartType, aIt-m_bSwapXAndYAxis );
 spHeader-SetSeriesName(
-String( DataSeriesHelper::getDataSeriesLabel(
+OUString( DataSeriesHelper::getDataSeriesLabel(
 aIt-m_xDataSeries,
 (aIt-m_xChartType.is() ?
  aIt-m_xChartType-getRoleOfSequenceForSeriesLabel() :
@@ -635,22 +635,22 @@
 Invalidate();
 }
 
-String DataBrowser::GetColString( sal_Int32 nColumnId ) const
+OUString DataBrowser::GetColString( sal_Int32 nColumnId ) const
 {
 OSL_ASSERT( m_apDataBrowserModel.get());
 if( nColumnId  0 )
-return String( m_apDataBrowserModel-getRoleOfColumn( static_cast 
sal_Int32 ( nColumnId ) - 1 ));
-return String();
+return OUString( m_apDataBrowserModel-getRoleOfColumn( static_cast 
sal_Int32 ( nColumnId ) - 1 ));
+return OUString();
 }
 
-String DataBrowser::GetRowString( sal_Int32 nRow ) const
+OUString DataBrowser::GetRowString( sal_Int32 nRow ) const
 {
 return OUString::valueOf(nRow + 1);
 }
 
 String DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
 {
-String aResult;
+OUString aResult;
 
 if( nColumnId == 0 )
 {
@@ -669,7 +669,7 @@
 
 if( ! ::rtl::math::isNan( fData ) 
 m_spNumberFormatterWrapper.get() )
-aResult = String( 
m_spNumberFormatterWrapper-getFormattedString(
+aResult = OUString( 
m_spNumberFormatterWrapper-getFormattedString(
   GetNumberFormatKey( nRow, nColumnId ),
   fData, nLabelColor, bColorChanged ));
 }
@@ -686,14 +686,14 @@
 bool bColorChanged = false;
 sal_Int32 nDateNumberFormat = 
DiagramHelper::getDateNumberFormat( Reference util::XNumberFormatsSupplier ( 
m_xChartDoc, uno::UNO_QUERY) );
 if( ! ::rtl::math::isNan( fDouble )  
m_spNumberFormatterWrapper.get() )
-aResult = String( 
m_spNumberFormatterWrapper-getFormattedString(
+aResult = OUString( 
m_spNumberFormatterWrapper-getFormattedString(
 nDateNumberFormat, fDouble, nLabelColor, bColorChanged 
));
 }
 }
 else
 {
 OSL_ASSERT( m_apDataBrowserModel-getCellType( nColIndex, nRow ) 
== DataBrowserModel::TEXT );
-aResult = m_apDataBrowserModel-getCellText( nColIndex, nRow );
+aResult = (OUString)m_apDataBrowserModel-getCellText( nColIndex, 
nRow );
 }
 }
 
@@ -800,9 +800,9 @@
 {
 sal_uInt32 nDummy = 0;
 double fDummy = 0.0;
-String aText( m_aNumberEditField.GetText());
+OUString aText( m_aNumberEditField.GetText());
 
-if( aText.Len()  0 
+if( aText.getLength()  0 
 m_spNumberFormatterWrapper.get() 
 m_spNumberFormatterWrapper-getSvNumberFormatter() 
 ! 
m_spNumberFormatterWrapper-getSvNumberFormatter()-IsNumberFormat(
@@ -1082,9 +1082,9 @@
 {
 if( rController == m_rTextEditController )
 {
-String aText( GetCellText( nRow, nCol ) );
+OUString aText( GetCellText( nRow, nCol ) );
 m_aTextEditField.SetText( aText );
-m_aTextEditField.SetSelection( 

[PATCH] fdo#51656 : Mean value line starts in wrong place in column ...

2013-03-29 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3122

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/22/3122/1

fdo#51656 : Mean value line starts in wrong place in column graph

Change-Id: I2389687e54cec4c0e873bcc120cc21b3c3d11d78
---
M chart2/source/tools/ChartTypeHelper.cxx
M chart2/source/view/charttypes/VSeriesPlotter.cxx
2 files changed, 2 insertions(+), 2 deletions(-)



diff --git a/chart2/source/tools/ChartTypeHelper.cxx 
b/chart2/source/tools/ChartTypeHelper.cxx
index 51b760d..4585d79 100644
--- a/chart2/source/tools/ChartTypeHelper.cxx
+++ b/chart2/source/tools/ChartTypeHelper.cxx
@@ -433,7 +433,7 @@
 if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN)
 || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR)
 || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) 
)
-return true;
+return true;// this 'true' here causes a 'default x-axis 
shift' in the above mentioned three charttypes.
 }
 return false;
 }
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx 
b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 6e114dd..9387666 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -1017,7 +1017,7 @@
 double fLogicY = aCalculatedPoints[nP].Y;
 double fLogicZ = 0.0;//dummy
 
-m_pPosHelper-doLogicScaling( fLogicX, fLogicY, fLogicZ );
+//m_pPosHelper-doLogicScaling( fLogicX, fLogicY, fLogicZ );
 --- this creates bug#51656
 
 if(!::rtl::math::isNan(fLogicX)  !::rtl::math::isInf(fLogicX)
  !::rtl::math::isNan(fLogicY)  
!::rtl::math::isInf(fLogicY)

-- 
To view, visit https://gerrit.libreoffice.org/3122
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2389687e54cec4c0e873bcc120cc21b3c3d11d78
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Prashant Pandey prashant3.yi...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] fdo#38838: Replaced some (Uni)String to OUString in core/sc

2013-03-14 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2735

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/35/2735/1

fdo#38838: Replaced some (Uni)String to OUString in core/sc

Change-Id: I4fa27b933c5b3cf2645b139bf6349b90f613feab
---
M sc/inc/global.hxx
M sc/inc/stringutil.hxx
M sc/source/core/data/global.cxx
M sc/source/core/tool/stringutil.cxx
M sc/source/filter/excel/xecontent.cxx
M sc/source/filter/excel/xicontent.cxx
M sc/source/filter/ftools/ftools.cxx
M sc/source/filter/inc/ftools.hxx
M sc/source/ui/dbgui/validate.cxx
M sc/source/ui/inc/validate.hxx
10 files changed, 99 insertions(+), 98 deletions(-)



diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 978985a..b1dd688 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -635,14 +635,14 @@
 @param bEscapeEmbedded  If TRUE/, embedded quote characters are
 escaped by doubling them.
  */
-SC_DLLPUBLICstatic void AddQuotes( String rString, 
sal_Unicode cQuote = '\'', bool bEscapeEmbedded = true );
+SC_DLLPUBLICstatic void AddQuotes( OUString rString, 
sal_Unicode cQuote = '\'', bool bEscapeEmbedded = true );
 
 /** Erases the character cQuote from rString, if it exists at beginning 
AND end.
 @param bUnescapeEmbeddedIf TRUE/, embedded doubled quote 
characters
 are unescaped by replacing them with a
 single instance.
  */
-SC_DLLPUBLICstatic void EraseQuotes( String rString, 
sal_Unicode cQuote = '\'', bool bUnescapeEmbedded = true );
+SC_DLLPUBLICstatic void EraseQuotes( OUString rString, 
sal_Unicode cQuote = '\'', bool bUnescapeEmbedded = true );
 
 /** Finds an unquoted instance of cChar in rString, starting at
 offset nStart. Unquoted instances may occur when concatenating two
diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx
index 48c94f5..988dea2 100644
--- a/sc/inc/stringutil.hxx
+++ b/sc/inc/stringutil.hxx
@@ -106,9 +106,9 @@
 static bool parseSimpleNumber(
 const ::rtl::OUString rStr, sal_Unicode dsep, sal_Unicode gsep, 
double rVal);
 
-static xub_StrLen SC_DLLPUBLIC GetQuotedTokenCount(const UniString rIn, 
const UniString rQuotedPairs, sal_Unicode cTok = ';' );
-static UniString  SC_DLLPUBLIC GetQuotedToken(const UniString rIn, 
xub_StrLen nToken, const UniString rQuotedPairs,
-sal_Unicode cTok,  xub_StrLen rIndex 
);
+static sal_Int32 SC_DLLPUBLIC GetQuotedTokenCount(const OUString rIn, 
const OUString rQuotedPairs, sal_Unicode cTok = ';' );
+static OUString  SC_DLLPUBLIC GetQuotedToken(const OUString rIn, 
sal_Int32 nToken, const OUString rQuotedPairs,
+sal_Unicode cTok,  sal_Int32 rIndex );
 };
 
 
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 22fc87c..52aeae8 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -814,7 +814,7 @@
 return (rString.Len() = 2)  (rString.GetChar( 0 ) == cQuote)  
(rString.GetChar( rString.Len() - 1 ) == cQuote);
 }
 
-void ScGlobal::AddQuotes( String rString, sal_Unicode cQuote, bool 
bEscapeEmbedded )
+void ScGlobal::AddQuotes( OUString rString, sal_Unicode cQuote, bool 
bEscapeEmbedded )
 {
 if (bEscapeEmbedded)
 {
@@ -822,23 +822,23 @@
 pQ[0] = pQ[1] = cQuote;
 pQ[2] = 0;
 rtl::OUString aQuotes( pQ );
-rString.SearchAndReplaceAll( rtl::OUString(cQuote), aQuotes);
+rString.replaceAll( OUString(cQuote), aQuotes);
 }
-rString.Insert( cQuote, 0 ).Append( cQuote );
+rString = OUString( cQuote ) + OUString( cQuote );
 }
 
-void ScGlobal::EraseQuotes( String rString, sal_Unicode cQuote, bool 
bUnescapeEmbedded )
+void ScGlobal::EraseQuotes( OUString rString, sal_Unicode cQuote, bool 
bUnescapeEmbedded )
 {
 if ( IsQuoted( rString, cQuote ) )
 {
-rString.Erase( rString.Len() - 1 ).Erase( 0, 1 );
+rString = rString.copy( 0, rString.getLength() - 1 ).copy( 1 );
 if (bUnescapeEmbedded)
 {
 sal_Unicode pQ[3];
 pQ[0] = pQ[1] = cQuote;
 pQ[2] = 0;
 rtl::OUString aQuotes( pQ );
-rString.SearchAndReplaceAll( aQuotes, rtl::OUString(cQuote));
+rString.replaceAll( aQuotes, OUString(cQuote));
 }
 }
 }
diff --git a/sc/source/core/tool/stringutil.cxx 
b/sc/source/core/tool/stringutil.cxx
index 62e4804..e196d65 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -183,22 +183,22 @@
 return true;
 }
 
-xub_StrLen ScStringUtil::GetQuotedTokenCount(const UniString rIn, const 
UniString rQuotedPairs, sal_Unicode cTok )
+sal_Int32 ScStringUtil::GetQuotedTokenCount(const OUString rIn, const 
OUString rQuotedPairs, sal_Unicode 

[PATCH] fdo#38838: Replaced some String with OUString

2013-03-12 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2675

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/75/2675/1

fdo#38838: Replaced some String with OUString

Change-Id: I1a5f4acb22db42173f4489655f5e702c4cee7c1c
---
M padmin/source/adddlg.cxx
M padmin/source/adddlg.hxx
M padmin/source/cmddlg.cxx
M padmin/source/helper.cxx
M padmin/source/helper.hxx
M padmin/source/newppdlg.cxx
M svx/inc/svx/checklbx.hxx
M svx/source/dialog/checklbx.cxx
8 files changed, 99 insertions(+), 104 deletions(-)



diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx
index f1db9e1..d7d7427 100644
--- a/padmin/source/adddlg.cxx
+++ b/padmin/source/adddlg.cxx
@@ -36,7 +36,6 @@
 using namespace padmin;
 using namespace std;
 
-using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
 using ::rtl::OUStringHash;
 using ::rtl::OUStringToOString;
@@ -93,7 +92,7 @@
 rInfo.m_aFeatures = OUString(fax);
 }
 else
-rInfo.m_aFeatures = OUString();
+rInfo.m_aFeatures = ;
 }
 
 //
@@ -126,8 +125,8 @@
 
 void APChooseDriverPage::fill( PrinterInfo rInfo )
 {
-sal_uInt16 nPos = m_aDriverBox.GetSelectEntryPos();
-String* pDriver = (String*)m_aDriverBox.GetEntryData( nPos );
+sal_Int32 nPos = m_aDriverBox.GetSelectEntryPos();
+OUString* pDriver = (OUString*)m_aDriverBox.GetEntryData( nPos );
 rInfo.m_aDriverName = *pDriver;
 #if OSL_DEBUG_LEVEL  1
 fprintf( stderr, m_aLastPrinterName = \%s\, rInfo.m_aPrinterName = 
\%s\\n,
@@ -136,30 +135,30 @@
 #endif
 if( rInfo.m_aPrinterName.equals( m_aLastPrinterName ) )
 {
-String aPrinter( AddPrinterDialog::uniquePrinterName( 
m_aDriverBox.GetEntry( nPos ) ) );
+OUString aPrinter( AddPrinterDialog::uniquePrinterName( 
m_aDriverBox.GetEntry( nPos ) ) );
 rInfo.m_aPrinterName = m_aLastPrinterName = aPrinter;
 }
 }
 
-void APChooseDriverPage::updateDrivers( bool bRefresh, const rtl::OUString 
rSelectDriver )
+void APChooseDriverPage::updateDrivers( bool bRefresh, const OUString 
rSelectDriver )
 {
 for( int k = 0; k  m_aDriverBox.GetEntryCount(); k++ )
 delete (String*)m_aDriverBox.GetEntryData( k );
 m_aDriverBox.Clear();
 
-std::list rtl::OUString  aDrivers;
+std::list OUString  aDrivers;
 psp::PPDParser::getKnownPPDDrivers( aDrivers, bRefresh );
 
-rtl::OUString aSelectDriver( psp::PPDParser::getPPDPrinterName( 
rSelectDriver ) );
+OUString aSelectDriver( psp::PPDParser::getPPDPrinterName( rSelectDriver ) 
);
 
-rtl::OUString aSelectedEntry;
-for( std::list rtl::OUString ::const_iterator it = aDrivers.begin(); it 
!= aDrivers.end(); ++it )
+OUString aSelectedEntry;
+for( std::list OUString ::const_iterator it = aDrivers.begin(); it != 
aDrivers.end(); ++it )
 {
-rtl::OUString aDriver( psp::PPDParser::getPPDPrinterName( *it ) );
+OUString aDriver( psp::PPDParser::getPPDPrinterName( *it ) );
 if( !aDriver.isEmpty() )
 {
 int nPos = m_aDriverBox.InsertEntry( aDriver );
-m_aDriverBox.SetEntryData( nPos, new String( *it ) );
+m_aDriverBox.SetEntryData( nPos, new OUString( *it ) );
 if( aDriver == aSelectDriver )
 aSelectedEntry = aDriver;
 }
@@ -184,7 +183,7 @@
 PPDImportDialog aDlg( this );
 if( aDlg.Execute() )
 {
-const std::list rtl::OUString  rImported( 
aDlg.getImportedFiles() );
+const std::list OUString  rImported( aDlg.getImportedFiles() );
 if( rImported.empty() )
 updateDrivers( true );
 else
@@ -199,14 +198,14 @@
 for( int i = 0; i  m_aDriverBox.GetSelectEntryCount(); i++ )
 {
 int nSelect = m_aDriverBox.GetSelectEntryPos(i);
-String aDriver( *(String*)m_aDriverBox.GetEntryData( nSelect ) );
-if( aDriver.Len() )
+OUString aDriver( *(String*)m_aDriverBox.GetEntryData( nSelect ) );
+if( aDriver.getLength() )
 {
 // never delete the default driver
-if( aDriver.EqualsIgnoreCaseAscii( SGENPRT ) )
+if( aDriver.equalsIgnoreAsciiCase( SGENPRT ) )
 {
-String aText( PaResId( RID_ERR_REMOVESGENPRT ) );
-aText.SearchAndReplace( rtl::OUString( %s ), 
m_aDriverBox.GetSelectEntry( i ) );
+OUString aText( PaResId( RID_ERR_REMOVESGENPRT ) );
+aText.replaceFirst( OUString( %s ), 
m_aDriverBox.GetSelectEntry( i ) );
 ErrorBox aErrorBox( this, WB_OK | WB_DEF_OK, aText );
 aErrorBox.SetText( m_aRemStr );
 aErrorBox.Execute();
@@ -218,8 +217,8 @@
 OUString aPPD( aDriver );
 if( aDefInfo.m_aDriverName == aPPD )
 {

[PATCH] fdo#38838: Replaced some String with OUString

2013-03-11 Thread Prashant Pandey (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/2672

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/72/2672/1

fdo#38838: Replaced some String with OUString

Change-Id: If913d363229707a60aa1232a0ddaea56403510b3
---
M padmin/source/adddlg.cxx
M padmin/source/adddlg.hxx
M padmin/source/cmddlg.cxx
M padmin/source/helper.cxx
M padmin/source/helper.hxx
M padmin/source/newppdlg.cxx
M svx/source/dialog/checklbx.cxx
7 files changed, 97 insertions(+), 100 deletions(-)



diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx
index f1db9e1..48a9826 100644
--- a/padmin/source/adddlg.cxx
+++ b/padmin/source/adddlg.cxx
@@ -36,7 +36,6 @@
 using namespace padmin;
 using namespace std;
 
-using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
 using ::rtl::OUStringHash;
 using ::rtl::OUStringToOString;
@@ -93,7 +92,7 @@
 rInfo.m_aFeatures = OUString(fax);
 }
 else
-rInfo.m_aFeatures = OUString();
+rInfo.m_aFeatures = ;
 }
 
 //
@@ -126,8 +125,8 @@
 
 void APChooseDriverPage::fill( PrinterInfo rInfo )
 {
-sal_uInt16 nPos = m_aDriverBox.GetSelectEntryPos();
-String* pDriver = (String*)m_aDriverBox.GetEntryData( nPos );
+sal_uInt32 nPos = m_aDriverBox.GetSelectEntryPos();
+OUString* pDriver = (OUString*)m_aDriverBox.GetEntryData( nPos );
 rInfo.m_aDriverName = *pDriver;
 #if OSL_DEBUG_LEVEL  1
 fprintf( stderr, m_aLastPrinterName = \%s\, rInfo.m_aPrinterName = 
\%s\\n,
@@ -136,30 +135,30 @@
 #endif
 if( rInfo.m_aPrinterName.equals( m_aLastPrinterName ) )
 {
-String aPrinter( AddPrinterDialog::uniquePrinterName( 
m_aDriverBox.GetEntry( nPos ) ) );
+OUString aPrinter( AddPrinterDialog::uniquePrinterName( 
m_aDriverBox.GetEntry( nPos ) ) );
 rInfo.m_aPrinterName = m_aLastPrinterName = aPrinter;
 }
 }
 
-void APChooseDriverPage::updateDrivers( bool bRefresh, const rtl::OUString 
rSelectDriver )
+void APChooseDriverPage::updateDrivers( bool bRefresh, const OUString 
rSelectDriver )
 {
 for( int k = 0; k  m_aDriverBox.GetEntryCount(); k++ )
 delete (String*)m_aDriverBox.GetEntryData( k );
 m_aDriverBox.Clear();
 
-std::list rtl::OUString  aDrivers;
+std::list OUString  aDrivers;
 psp::PPDParser::getKnownPPDDrivers( aDrivers, bRefresh );
 
-rtl::OUString aSelectDriver( psp::PPDParser::getPPDPrinterName( 
rSelectDriver ) );
+OUString aSelectDriver( psp::PPDParser::getPPDPrinterName( rSelectDriver ) 
);
 
-rtl::OUString aSelectedEntry;
-for( std::list rtl::OUString ::const_iterator it = aDrivers.begin(); it 
!= aDrivers.end(); ++it )
+OUString aSelectedEntry;
+for( std::list OUString ::const_iterator it = aDrivers.begin(); it != 
aDrivers.end(); ++it )
 {
-rtl::OUString aDriver( psp::PPDParser::getPPDPrinterName( *it ) );
+OUString aDriver( psp::PPDParser::getPPDPrinterName( *it ) );
 if( !aDriver.isEmpty() )
 {
 int nPos = m_aDriverBox.InsertEntry( aDriver );
-m_aDriverBox.SetEntryData( nPos, new String( *it ) );
+m_aDriverBox.SetEntryData( nPos, new OUString( *it ) );
 if( aDriver == aSelectDriver )
 aSelectedEntry = aDriver;
 }
@@ -184,7 +183,7 @@
 PPDImportDialog aDlg( this );
 if( aDlg.Execute() )
 {
-const std::list rtl::OUString  rImported( 
aDlg.getImportedFiles() );
+const std::list OUString  rImported( aDlg.getImportedFiles() );
 if( rImported.empty() )
 updateDrivers( true );
 else
@@ -199,14 +198,14 @@
 for( int i = 0; i  m_aDriverBox.GetSelectEntryCount(); i++ )
 {
 int nSelect = m_aDriverBox.GetSelectEntryPos(i);
-String aDriver( *(String*)m_aDriverBox.GetEntryData( nSelect ) );
-if( aDriver.Len() )
+OUString aDriver( *(String*)m_aDriverBox.GetEntryData( nSelect ) );
+if( aDriver.getLength() )
 {
 // never delete the default driver
-if( aDriver.EqualsIgnoreCaseAscii( SGENPRT ) )
+if( aDriver.equalsIgnoreAsciiCase( SGENPRT ) )
 {
-String aText( PaResId( RID_ERR_REMOVESGENPRT ) );
-aText.SearchAndReplace( rtl::OUString( %s ), 
m_aDriverBox.GetSelectEntry( i ) );
+OUString aText( PaResId( RID_ERR_REMOVESGENPRT ) );
+aText.replaceFirst( OUString( %s ), 
m_aDriverBox.GetSelectEntry( i ) );
 ErrorBox aErrorBox( this, WB_OK | WB_DEF_OK, aText );
 aErrorBox.SetText( m_aRemStr );
 aErrorBox.Execute();
@@ -218,8 +217,8 @@
 OUString aPPD( aDriver );
 if( aDefInfo.m_aDriverName == aPPD )
 {
-

[ABANDONED] fdo#38838: Replaced some String with OUString

2013-03-11 Thread Prashant Pandey (via Code Review)
Prashant Pandey has abandoned this change.

Change subject: fdo#38838: Replaced some String with OUString
..


Patch Set 2: Abandoned

Gives some error on build

-- 
To view, visit https://gerrit.libreoffice.org/2672
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: If913d363229707a60aa1232a0ddaea56403510b3
Gerrit-PatchSet: 2
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Prashant Pandey prashant3.yi...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice