1 --- sc/inc/dbcolect.hxx.old 2009-04-02 10:45:43.000000000 +0000
2 +++ sc/inc/dbcolect.hxx 2009-04-06 16:41:48.000000000 +0000
3 @@ -65,6 +65,7 @@ private:
7 + BOOL bSortNaturalSort;
11 --- sc/inc/global.hxx.old 2009-04-06 16:41:48.000000000 +0000
12 +++ sc/inc/global.hxx 2009-04-06 16:41:48.000000000 +0000
13 @@ -828,6 +828,7 @@ struct SC_DLLPUBLIC ScQueryParam
19 BOOL bMixedComparison; // whether numbers are smaller than strings
21 --- sc/inc/sc.hrc.old 2009-04-06 16:41:48.000000000 +0000
22 +++ sc/inc/sc.hrc 2009-04-06 16:41:48.000000000 +0000
24 #define SID_SORT_CASESENS (SC_PARAM_START+2)
25 #define SID_SORT_ATTRIBS (SC_PARAM_START+3)
26 #define SID_SORT_USERDEF (SC_PARAM_START+4)
27 +#define SID_SORT_NATURALSORT (SC_PARAM_START+5)
29 // Resourcen -------------------------------------------------------------
31 --- sc/inc/sortparam.hxx.old 2009-04-02 10:45:43.000000000 +0000
32 +++ sc/inc/sortparam.hxx 2009-04-06 16:41:48.000000000 +0000
33 @@ -52,6 +52,7 @@ struct SC_DLLPUBLIC ScSortParam
41 --- sc/sdi/scalc.sdi.old 2009-04-06 16:41:48.000000000 +0000
42 +++ sc/sdi/scalc.sdi 2009-04-06 16:41:48.000000000 +0000
43 @@ -1577,7 +1577,7 @@ SfxVoidItem DataSelect SID_DATA_SELECT
45 //--------------------------------------------------------------------------
46 SfxVoidItem DataSort SID_SORT
47 -(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6)
48 +(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem NaturalSort SID_SORT_NATURALSORT,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6)
52 --- sc/source/core/data/sortparam.cxx.old 2009-04-02 10:45:01.000000000 +0000
53 +++ sc/source/core/data/sortparam.cxx 2009-04-06 16:41:48.000000000 +0000
54 @@ -50,7 +50,7 @@ ScSortParam::ScSortParam()
56 ScSortParam::ScSortParam( const ScSortParam& r ) :
57 nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2),
58 - bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens),
59 + bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens),bNaturalSort(r.bNaturalSort),
60 bUserDef(r.bUserDef),nUserIndex(r.nUserIndex),bIncludePattern(r.bIncludePattern),
62 nDestTab(r.nDestTab),nDestCol(r.nDestCol),nDestRow(r.nDestRow),
63 @@ -73,7 +73,7 @@ void ScSortParam::Clear()
67 - bHasHeader=bCaseSens=bUserDef = FALSE;
68 + bHasHeader=bCaseSens=bUserDef=bNaturalSort = FALSE;
69 bByRow=bIncludePattern=bInplace = TRUE;
70 aCollatorLocale = ::com::sun::star::lang::Locale();
71 aCollatorAlgorithm.Erase();
72 @@ -96,6 +96,7 @@ ScSortParam& ScSortParam::operator=( con
74 bHasHeader = r.bHasHeader;
75 bCaseSens = r.bCaseSens;
76 + bNaturalSort = r.bNaturalSort;
78 bUserDef = r.bUserDef;
79 nUserIndex = r.nUserIndex;
80 @@ -137,6 +138,7 @@ BOOL ScSortParam::operator==( const ScSo
81 && (bHasHeader == rOther.bHasHeader)
82 && (bByRow == rOther.bByRow)
83 && (bCaseSens == rOther.bCaseSens)
84 + && (bNaturalSort == rOther.bNaturalSort)
85 && (bUserDef == rOther.bUserDef)
86 && (nUserIndex == rOther.nUserIndex)
87 && (bIncludePattern == rOther.bIncludePattern)
88 --- sc/source/core/data/table3.cxx.old 2009-04-06 16:41:48.000000000 +0000
89 +++ sc/source/core/data/table3.cxx 2009-04-06 16:41:48.000000000 +0000
94 +using namespace ::com::sun::star;
96 +namespace naturalsort {
98 +using namespace ::com::sun::star::i18n;
100 +/** Splits a given string into three parts: the prefix, number string, and
104 + Original string to be split into pieces
107 + Prefix string that consists of the part before the first number token
110 + String after the last number token. This may still contain number strings.
113 + Number converted from the middle number string
115 + @return Returns TRUE if a numeral element is found in a given string, or
116 + FALSE if no numeral element is found.
118 +BOOL SplitString( const rtl::OUString &sWhole,
119 + rtl::OUString &sPrefix, rtl::OUString &sSuffix, double &fNum )
121 + i18n::LocaleDataItem aLocaleItem = ScGlobal::pLocaleData->getLocaleItem();
123 + // Get prefix element
124 + rtl::OUString sEmpty, sUser = rtl::OUString::createFromAscii( "-" );
125 + ParseResult aPRPre = ScGlobal::pCharClass->parsePredefinedToken(
126 + KParseType::IDENTNAME, sWhole, 0,
127 + KParseTokens::ANY_LETTER, sUser, KParseTokens::ANY_LETTER, sUser );
128 + sPrefix = sWhole.copy( 0, aPRPre.EndPos );
130 + // Return FALSE if no numeral element is found
131 + if ( aPRPre.EndPos == sWhole.getLength() )
134 + // Get numeral element
135 + sUser = aLocaleItem.decimalSeparator;
136 + ParseResult aPRNum = ScGlobal::pCharClass->parsePredefinedToken(
137 + KParseType::ANY_NUMBER, sWhole, aPRPre.EndPos,
138 + KParseTokens::ANY_NUMBER, sEmpty, KParseTokens::ANY_NUMBER, sUser );
140 + if ( aPRNum.EndPos == aPRPre.EndPos )
143 + fNum = aPRNum.Value;
144 + sSuffix = sWhole.copy( aPRNum.EndPos );
149 +/** Naturally compares two given strings.
151 + This is the main function that should be called externally. It returns
152 + either 1, 0, or -1 depending on the comparison result of given two strings.
161 + Boolean value for case sensitivity
164 + Pointer to user defined sort list
167 + Pointer to collator wrapper for normal string comparison
169 + @return Returnes 1 if sInput1 is greater, 0 if sInput1 == sInput2, and -1 if
170 + sInput2 is greater.
172 +short Compare( const String &sInput1, const String &sInput2,
173 + const BOOL bCaseSens, const ScUserListData* pData, const CollatorWrapper *pCW )
175 + rtl::OUString sStr1( sInput1 ), sStr2( sInput2 ), sPre1, sSuf1, sPre2, sSuf2;
179 + double nNum1, nNum2;
180 + BOOL bNumFound1 = SplitString( sStr1, sPre1, sSuf1, nNum1 );
181 + BOOL bNumFound2 = SplitString( sStr2, sPre2, sSuf2, nNum2 );
183 + short nPreRes; // Prefix comparison result
188 + if ( !bNumFound1 || !bNumFound2 )
189 + return static_cast<short>(pData->Compare( sStr1, sStr2 ));
191 + nPreRes = pData->Compare( sPre1, sPre2 );
195 + if ( !bNumFound1 || !bNumFound2 )
196 + return static_cast<short>(pData->ICompare( sStr1, sStr2 ));
198 + nPreRes = pData->ICompare( sPre1, sPre2 );
203 + if ( !bNumFound1 || !bNumFound2 )
204 + return static_cast<short>(pCW->compareString( sStr1, sStr2 ));
206 + nPreRes = static_cast<short>(pCW->compareString( sPre1, sPre2 ));
209 + // Prefix strings differ. Return immediately.
210 + if ( nPreRes != 0 ) return nPreRes;
212 + if ( nNum1 != nNum2 )
214 + if ( nNum1 < nNum2 ) return -1;
215 + return static_cast<short>( nNum1 > nNum2 );
218 + // The prefix and the first numerical elements are equal, but the suffix
219 + // strings may still differ. Stay in the loop.
231 // STATIC DATA -----------------------------------------------------------
233 const USHORT nMaxSorts = 3; // maximale Anzahl Sortierkriterien in aSortParam
234 @@ -285,25 +422,40 @@ short ScTable::CompareCell( USHORT nSort
235 ((ScStringCell*)pCell2)->GetString(aStr2);
237 GetString(nCell2Col, nCell2Row, aStr2);
238 - BOOL bUserDef = aSortParam.bUserDef;
240 + BOOL bUserDef = aSortParam.bUserDef; // custom sort order
241 + BOOL bNaturalSort = aSortParam.bNaturalSort; // natural sort
242 + BOOL bCaseSens = aSortParam.bCaseSens; // case sensitivity
246 ScUserListData* pData =
247 - (ScUserListData*)(ScGlobal::GetUserList()->At(
248 - aSortParam.nUserIndex));
249 + static_cast<ScUserListData*>( (ScGlobal::GetUserList()->At(
250 + aSortParam.nUserIndex)) );
254 - if ( aSortParam.bCaseSens )
255 - nRes = sal::static_int_cast<short>( pData->Compare(aStr1, aStr2) );
256 + if ( bNaturalSort )
257 + nRes = naturalsort::Compare( aStr1, aStr2, bCaseSens, pData, pSortCollator );
259 - nRes = sal::static_int_cast<short>( pData->ICompare(aStr1, aStr2) );
262 + nRes = sal::static_int_cast<short>( pData->Compare(aStr1, aStr2) );
264 + nRes = sal::static_int_cast<short>( pData->ICompare(aStr1, aStr2) );
272 - nRes = (short) pSortCollator->compareString( aStr1, aStr2 );
274 + if ( bNaturalSort )
275 + nRes = naturalsort::Compare( aStr1, aStr2, bCaseSens, NULL, pSortCollator );
277 + nRes = static_cast<short>( pSortCollator->compareString( aStr1, aStr2 ) );
280 else if ( bStr1 ) // String <-> Zahl
281 nRes = 1; // Zahl vorne
282 --- sc/source/core/tool/dbcolect.cxx.old 2009-04-02 10:45:03.000000000 +0000
283 +++ sc/source/core/tool/dbcolect.cxx 2009-04-06 16:41:48.000000000 +0000
284 @@ -104,6 +104,7 @@ ScDBData::ScDBData( const ScDBData& rDat
285 bKeepFmt (rData.bKeepFmt),
286 bStripData (rData.bStripData),
287 bSortCaseSens (rData.bSortCaseSens),
288 + bSortNaturalSort (rData.bSortNaturalSort),
289 bIncludePattern (rData.bIncludePattern),
290 bSortInplace (rData.bSortInplace),
291 bSortUserDef (rData.bSortUserDef),
292 @@ -197,6 +198,7 @@ ScDBData& ScDBData::operator= (const ScD
293 bKeepFmt = rData.bKeepFmt;
294 bStripData = rData.bStripData;
295 bSortCaseSens = rData.bSortCaseSens;
296 + bSortNaturalSort = rData.bSortNaturalSort;
297 bIncludePattern = rData.bIncludePattern;
298 bSortInplace = rData.bSortInplace;
299 nSortDestTab = rData.nSortDestTab;
300 @@ -448,6 +450,7 @@ void ScDBData::GetSortParam( ScSortParam
301 rSortParam.bByRow = bByRow;
302 rSortParam.bHasHeader = bHasHeader;
303 rSortParam.bCaseSens = bSortCaseSens;
304 + rSortParam.bNaturalSort = bSortNaturalSort;
305 rSortParam.bInplace = bSortInplace;
306 rSortParam.nDestTab = nSortDestTab;
307 rSortParam.nDestCol = nSortDestCol;
308 @@ -468,6 +471,7 @@ void ScDBData::GetSortParam( ScSortParam
309 void ScDBData::SetSortParam( const ScSortParam& rSortParam )
311 bSortCaseSens = rSortParam.bCaseSens;
312 + bSortNaturalSort = rSortParam.bNaturalSort;
313 bIncludePattern = rSortParam.bIncludePattern;
314 bSortInplace = rSortParam.bInplace;
315 nSortDestTab = rSortParam.nDestTab;
316 --- sc/source/ui/dbgui/tpsort.cxx.old 2009-04-02 10:45:25.000000000 +0000
317 +++ sc/source/ui/dbgui/tpsort.cxx 2009-04-06 16:41:48.000000000 +0000
318 @@ -555,6 +555,7 @@ ScTabPageSortOptions::ScTabPageSortOptio
319 aBtnHeader ( this, ScResId( BTN_LABEL ) ),
320 aBtnFormats ( this, ScResId( BTN_FORMATS ) ),
321 aBtnCopyResult ( this, ScResId( BTN_COPYRESULT ) ),
322 + aBtnNaturalSort ( this, ScResId( BTN_NATURALSORT ) ),
323 aLbOutPos ( this, ScResId( LB_OUTAREA ) ),
324 aEdOutPos ( this, ScResId( ED_OUTAREA ) ),
325 aBtnSortUser ( this, ScResId( BTN_SORT_USER ) ),
326 @@ -566,7 +567,7 @@ ScTabPageSortOptions::ScTabPageSortOptio
327 aLineDirection ( this, ScResId( FL_DIRECTION ) ),
328 aBtnTopDown ( this, ScResId( BTN_TOP_DOWN ) ),
329 aBtnLeftRight ( this, ScResId( BTN_LEFT_RIGHT ) ),
330 - aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ),
331 +// aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ),
332 // aFtArea ( this, ScResId( FT_AREA ) ),
334 aStrRowLabel ( ScResId( STR_ROW_LABEL ) ),
335 @@ -605,8 +606,8 @@ __EXPORT ScTabPageSortOptions::~ScTabPag
337 void ScTabPageSortOptions::Init()
339 - aStrAreaLabel = aFtAreaLabel.GetText();
340 - aStrAreaLabel.Append( (sal_Unicode) ' ' );
341 +// aStrAreaLabel = aFtAreaLabel.GetText();
342 +// aStrAreaLabel.Append( (sal_Unicode) ' ' );
344 // CollatorRessource has user-visible names for sort algorithms
345 pColRes = new CollatorRessource();
346 @@ -685,8 +686,8 @@ void ScTabPageSortOptions::Init()
349 //aFtArea.SetText( theArea );
350 - theArea.Insert( aStrAreaLabel, 0 );
351 - aFtAreaLabel.SetText( theArea );
352 + //theArea.Insert( aStrAreaLabel, 0 );
353 + //aFtAreaLabel.SetText( theArea );
355 aBtnHeader.SetText( aStrColLabel );
357 @@ -732,9 +733,10 @@ void __EXPORT ScTabPageSortOptions::Rese
358 aLbSortUser.SelectEntryPos( 0 );
361 - aBtnCase.Check ( rSortData.bCaseSens );
362 - aBtnFormats.Check ( rSortData.bIncludePattern );
363 - aBtnHeader.Check ( rSortData.bHasHeader );
364 + aBtnCase.Check ( rSortData.bCaseSens );
365 + aBtnFormats.Check ( rSortData.bIncludePattern );
366 + aBtnHeader.Check ( rSortData.bHasHeader );
367 + aBtnNaturalSort.Check ( rSortData.bNaturalSort );
369 if ( rSortData.bByRow )
371 @@ -800,6 +802,7 @@ BOOL __EXPORT ScTabPageSortOptions::Fill
372 theSortData.bByRow = aBtnTopDown.IsChecked();
373 theSortData.bHasHeader = aBtnHeader.IsChecked();
374 theSortData.bCaseSens = aBtnCase.IsChecked();
375 + theSortData.bNaturalSort = aBtnNaturalSort.IsChecked();
376 theSortData.bIncludePattern = aBtnFormats.IsChecked();
377 theSortData.bInplace = !aBtnCopyResult.IsChecked();
378 theSortData.nDestCol = theOutPos.Col();
379 --- sc/source/ui/inc/sortdlg.hrc.old 2009-04-02 10:45:37.000000000 +0000
380 +++ sc/source/ui/inc/sortdlg.hrc 2009-04-06 16:41:48.000000000 +0000
382 #define LB_SORT_USER 2
385 -#define FT_AREA_LABEL 5
386 +//#define FT_AREA_LABEL 5
388 #define BTN_SORT_USER 7
389 #define BTN_CASESENSITIVE 8
391 #define LB_LANGUAGE 17
392 #define FT_ALGORITHM 18
393 #define LB_ALGORITHM 19
394 +#define BTN_NATURALSORT 20
398 --- sc/source/ui/inc/tpsort.hxx.old 2009-04-02 10:45:37.000000000 +0000
399 +++ sc/source/ui/inc/tpsort.hxx 2009-04-06 16:41:48.000000000 +0000
400 @@ -53,7 +53,7 @@ class ScSortDlg;
403 //========================================================================
405 +// Kriterien (Sort Criteria)
407 class ScTabPageSortFields : public SfxTabPage
409 @@ -125,7 +125,7 @@ private:
412 //========================================================================
414 +// Sortieroptionen (Sort Options)
418 @@ -158,6 +158,7 @@ private:
421 CheckBox aBtnFormats;
422 + CheckBox aBtnNaturalSort;
424 CheckBox aBtnCopyResult;
426 @@ -175,7 +176,7 @@ private:
427 RadioButton aBtnTopDown;
428 RadioButton aBtnLeftRight;
430 - FixedText aFtAreaLabel;
431 +// FixedText aFtAreaLabel;
432 // FixedInfo aFtArea;
435 --- sc/source/ui/src/sortdlg.src.old 2009-04-02 10:45:23.000000000 +0000
436 +++ sc/source/ui/src/sortdlg.src 2009-04-06 16:41:48.000000000 +0000
437 @@ -154,9 +154,20 @@ TabPage RID_SCPAGE_SORT_OPTIONS
438 Text [ en-US ] = "Include ~formats" ;
441 + CheckBox BTN_NATURALSORT
443 + Pos = MAP_APPFONT ( 12 , 48 ) ;
444 + Size = MAP_APPFONT ( 242 , 10 ) ;
445 + Text [ de ] = "Enable ~natural sort" ;
446 + Text [ en-US ] = "Enable ~natural sort" ;
447 + Text [ cs ] = "Aktivovat přirozené třídění" ;
448 + Text [ sk ] = "Aktivovať prirodzené triedenie" ;
450 + Text [ x-comment ] = " " ;
452 CheckBox BTN_COPYRESULT
454 - Pos = MAP_APPFONT ( 12 , 48 ) ;
455 + Pos = MAP_APPFONT ( 12 , 62 ) ;
456 Size = MAP_APPFONT ( 242 , 10 ) ;
457 Text [ en-US ] = "~Copy sort results to:" ;
459 @@ -164,7 +175,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS
463 - Pos = MAP_APPFONT ( 20 , 59 ) ;
464 + Pos = MAP_APPFONT ( 20 , 73 ) ;
465 Size = MAP_APPFONT ( 93 , 90 ) ;
468 @@ -173,13 +184,13 @@ TabPage RID_SCPAGE_SORT_OPTIONS
472 - Pos = MAP_APPFONT ( 119 , 59 ) ;
473 + Pos = MAP_APPFONT ( 119 , 73 ) ;
474 Size = MAP_APPFONT ( 132 , 12 ) ;
477 CheckBox BTN_SORT_USER
479 - Pos = MAP_APPFONT ( 12 , 75 ) ;
480 + Pos = MAP_APPFONT ( 12 , 89 ) ;
481 Size = MAP_APPFONT ( 242 , 10 ) ;
482 Text [ en-US ] = "Custom sort ~order" ;
484 @@ -188,21 +199,21 @@ TabPage RID_SCPAGE_SORT_OPTIONS
488 - Pos = MAP_APPFONT ( 20 , 86 ) ;
489 + Pos = MAP_APPFONT ( 20 , 100 ) ;
490 Size = MAP_APPFONT ( 231 , 90 ) ;
494 FixedText FT_LANGUAGE
496 - Pos = MAP_APPFONT ( 12 , 104 ) ;
497 + Pos = MAP_APPFONT ( 12 , 118 ) ;
498 Size = MAP_APPFONT ( 101 , 8 ) ;
499 Text [ en-US ] = "~Language";
504 - Pos = MAP_APPFONT ( 12 , 115 ) ;
505 + Pos = MAP_APPFONT ( 12 , 129 ) ;
506 Size = MAP_APPFONT ( 101 , 90 ) ;
509 @@ -210,44 +221,46 @@ TabPage RID_SCPAGE_SORT_OPTIONS
511 FixedText FT_ALGORITHM
513 - Pos = MAP_APPFONT ( 119 , 104 ) ;
514 + Pos = MAP_APPFONT ( 119 , 118 ) ;
515 Size = MAP_APPFONT ( 132 , 8 ) ;
516 Text [ en-US ] = "O~ptions";
521 - Pos = MAP_APPFONT ( 119 , 115 ) ;
522 + Pos = MAP_APPFONT ( 119 , 129 ) ;
523 Size = MAP_APPFONT ( 132 , 90 ) ;
527 FixedLine FL_DIRECTION
529 - Pos = MAP_APPFONT ( 6 , 133 ) ;
530 + Pos = MAP_APPFONT ( 6 , 147 ) ;
531 Size = MAP_APPFONT ( 248 , 8 ) ;
532 Text [ en-US ] = "Direction" ;
534 RadioButton BTN_TOP_DOWN
536 - Pos = MAP_APPFONT ( 12 , 144 ) ;
537 + Pos = MAP_APPFONT ( 12 , 158 ) ;
538 Size = MAP_APPFONT ( 242 , 10 ) ;
539 Text [ en-US ] = "~Top to bottom (sort rows)" ;
542 RadioButton BTN_LEFT_RIGHT
544 - Pos = MAP_APPFONT ( 12 , 158 ) ;
545 + Pos = MAP_APPFONT ( 12 , 172 ) ;
546 Size = MAP_APPFONT ( 242 , 10 ) ;
547 Text [ en-US ] = "L~eft to right (sort columns)" ;
551 FixedText FT_AREA_LABEL
553 Pos = MAP_APPFONT ( 6 , 171 ) ;
554 Size = MAP_APPFONT ( 248 , 8 ) ;
555 Text [ en-US ] = "Data area:" ;
559 TabDialog RID_SCDLG_SORT
561 --- sc/source/ui/view/cellsh2.cxx.old 2009-04-06 16:41:39.000000000 +0000
562 +++ sc/source/ui/view/cellsh2.cxx 2009-04-06 16:41:48.000000000 +0000
563 @@ -366,6 +366,7 @@ void ScCellShell::ExecuteDB( SfxRequest&
564 aSortParam.bHasHeader = bHasHeader;
565 aSortParam.bByRow = TRUE;
566 aSortParam.bCaseSens = FALSE;
567 + aSortParam.bNaturalSort = FALSE;
568 aSortParam.bIncludePattern = FALSE;
569 aSortParam.bInplace = TRUE;
570 aSortParam.bDoSort[0] = TRUE;
571 @@ -401,6 +402,8 @@ void ScCellShell::ExecuteDB( SfxRequest&
572 aSortParam.bHasHeader = ((const SfxBoolItem*)pItem)->GetValue();
573 if ( pArgs->GetItemState( SID_SORT_CASESENS, TRUE, &pItem ) == SFX_ITEM_SET )
574 aSortParam.bCaseSens = ((const SfxBoolItem*)pItem)->GetValue();
575 + if ( pArgs->GetItemState( SID_SORT_NATURALSORT, TRUE, &pItem ) == SFX_ITEM_SET )
576 + aSortParam.bNaturalSort = ((const SfxBoolItem*)pItem)->GetValue();
577 if ( pArgs->GetItemState( SID_SORT_ATTRIBS, TRUE, &pItem ) == SFX_ITEM_SET )
578 aSortParam.bIncludePattern = ((const SfxBoolItem*)pItem)->GetValue();
579 if ( pArgs->GetItemState( SID_SORT_USERDEF, TRUE, &pItem ) == SFX_ITEM_SET )
580 @@ -454,7 +457,7 @@ void ScCellShell::ExecuteDB( SfxRequest&
582 pDlg = pFact->CreateScSortDlg( pTabViewShell->GetDialogParent(), &aArgSet, RID_SCDLG_SORT );
583 DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
584 - pDlg->SetCurPageId(1);
585 + pDlg->SetCurPageId(1); // 1=sort field tab 2=sort options tab
587 if ( pDlg->Execute() == RET_OK )
589 @@ -473,6 +476,8 @@ void ScCellShell::ExecuteDB( SfxRequest&
590 rOutParam.bHasHeader ) );
591 rReq.AppendItem( SfxBoolItem( SID_SORT_CASESENS,
592 rOutParam.bCaseSens ) );
593 + rReq.AppendItem( SfxBoolItem( SID_SORT_NATURALSORT,
594 + rOutParam.bNaturalSort ) );
595 rReq.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS,
596 rOutParam.bIncludePattern ) );
597 USHORT nUser = rOutParam.bUserDef ? ( rOutParam.nUserIndex + 1 ) : 0;