ooo-build r15497 - in trunk: . patches/dev300
- From: kyoshida svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r15497 - in trunk: . patches/dev300
- Date: Fri, 6 Mar 2009 21:27:12 +0000 (UTC)
Author: kyoshida
Date: Fri Mar 6 21:27:12 2009
New Revision: 15497
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15497&view=rev
Log:
2009-03-06 Daniel Watson <daniel watsonbros gmail com>
* patches/dev300/apply:
* patches/dev300/calc-sheet-tab-color-filter.diff:
* patches/dev300/calc-sheet-tab-color-oox.diff: new patches to support
import/export of sheet tab colors from/to Excel 2003 XML and Excel 2007
XML (import only).
* patches/dev300/calc-sheet-tab-color-sc.diff:
* patches/dev300/calc-sheet-tab-color-svtools.diff: updated, with more
polish with the dialog.
* patches/dev300/filter-xls2003-xml-export-fix.diff: removed; combined
with calc-sheet-tab-color-filter.diff.
Added:
trunk/patches/dev300/calc-sheet-tab-color-filter.diff
trunk/patches/dev300/calc-sheet-tab-color-oox.diff
Removed:
trunk/patches/dev300/filter-xls2003-xml-export-fix.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
trunk/patches/dev300/calc-sheet-tab-color-sc.diff
trunk/patches/dev300/calc-sheet-tab-color-svtools.diff
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Fri Mar 6 21:27:12 2009
@@ -2016,11 +2016,10 @@
[ CalcFixes ]
# Support custom sheet tab colors option (by Daniel Watson).
calc-sheet-tab-color-officecfg.diff, kohei/danielbw
-calc-sheet-tab-color-svtools.diff, kohei/danielbw
-calc-sheet-tab-color-sc.diff, kohei/danielbw
-
-# Fix error on xls 2003 xml export (by Daniel Watson)
-filter-xls2003-xml-export-fix.diff, i#99097, kohei/danielbw
+calc-sheet-tab-color-svtools.diff, kohei/danielbw
+calc-sheet-tab-color-sc.diff, kohei/danielbw
+calc-sheet-tab-color-oox.diff, kohei/danielbw
+calc-sheet-tab-color-filter.diff, kohei/danielbw
# Make it easier to un-select tabs when multiple tabs are selected.
calc-single-click-unselect-tabs.diff, i#70320, kohei/rail
Added: trunk/patches/dev300/calc-sheet-tab-color-filter.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/calc-sheet-tab-color-filter.diff Fri Mar 6 21:27:12 2009
@@ -0,0 +1,470 @@
+diff --git filter/source/xslt/export/spreadsheetml/formular.xsl filter/source/xslt/export/spreadsheetml/formular.xsl
+index 859ef29..a6fe96a 100644
+--- filter/source/xslt/export/spreadsheetml/formular.xsl
++++ filter/source/xslt/export/spreadsheetml/formular.xsl
+@@ -381,7 +381,7 @@
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$earlierCandidate" />
+- <xsl:variable name="parameterCandidate">
++ <xsl:variable name="parameterCandidate2">
+ <xsl:variable name="formularAfterCandidate" select="substring-after($expressionSuffix, $earlierCandidate)" />
+ <xsl:variable name="parameterTillBracket" select="concat(substring-before($formularAfterCandidate,')'),')')" />
+ <xsl:variable name="parameterTillComma" select="substring-before(substring-after($expressionSuffix, $parameterTillBracket),',')" />
+@@ -405,8 +405,8 @@
+ <xsl:call-template name="getParameter">
+ <xsl:with-param name="closingBracketCount" select="$closingBracketCount" />
+ <xsl:with-param name="openingBracketCount" select="$openingBracketCount" />
+- <xsl:with-param name="parameterCandidate" select="$parameterCandidate" />
+- <xsl:with-param name="earlierCandidate" select="$parameterCandidate" />
++ <xsl:with-param name="parameterCandidate" select="$parameterCandidate2" />
++ <xsl:with-param name="earlierCandidate" select="$parameterCandidate2" />
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix" />
+ </xsl:call-template>
+ </xsl:otherwise>
+diff --git filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl
+index e91fff2..c63600c 100644
+--- filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl
++++ filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl
+@@ -145,6 +145,17 @@
+ <RGB><xsl:value-of select="." /></RGB>
+ </Color>
+ </xsl:for-each>
++ <xsl:for-each select="key('config', 'TabColor')[not(.=preceding::config:config-item)]">
++ <xsl:sort select="." />
++ <Color>
++ <Index><xsl:value-of select="56 - position()" /></Index>
++ <RGB>
++ <xsl:call-template name="colordecimal2rgb">
++ <xsl:with-param name="colordecimal" select="."/>
++ </xsl:call-template>
++ </RGB>
++ </Color>
++ </xsl:for-each>
+ </Colors>
+ </OfficeDocumentSettings>
+ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
+@@ -175,6 +186,160 @@
+ </Workbook>
+ </xsl:template>
+
++ <xsl:template name="colordecimal2rgb">
++ <xsl:param name="colordecimal"/>
++ <xsl:choose>
++ <xsl:when test="$colordecimal <= 16777215 and $colordecimal >= 65536">
++ <xsl:variable name="redValue" select="floor(($colordecimal) div 65536)"/>
++ <xsl:variable name="greenValue" select="floor(($colordecimal - ($redValue*65536)) div 256)"/>
++ <xsl:variable name="blueValue" select="$colordecimal - ($redValue*65536) - ($greenValue*256)"/>
++ <xsl:call-template name="dec_rgb2Hex">
++ <xsl:with-param name="decRedValue" select="$redValue"/>
++ <xsl:with-param name="decGreenValue" select="$greenValue"/>
++ <xsl:with-param name="decBlueValue" select="$blueValue"/>
++ </xsl:call-template>
++ </xsl:when>
++ <xsl:when test="$colordecimal <= 65535 and $colordecimal >= 256">
++ <xsl:variable name="redValue" select="0"/>
++ <xsl:variable name="greenValue" select="$colordecimal div 256"/>
++ <xsl:variable name="blueValue" select="$colordecimal - ($greenValue*256)"/>
++ <xsl:call-template name="dec_rgb2Hex">
++ <xsl:with-param name="decRedValue" select="$redValue"/>
++ <xsl:with-param name="decGreenValue" select="$greenValue"/>
++ <xsl:with-param name="decBlueValue" select="$blueValue"/>
++ </xsl:call-template>
++ </xsl:when>
++ <xsl:when test="$colordecimal <= 255 and $colordecimal >= 0">
++ <xsl:variable name="redValue" select="0"/>
++ <xsl:variable name="greenValue" select="0"/>
++ <xsl:variable name="blueValue" select="$colordecimal"/>
++ <xsl:call-template name="dec_rgb2Hex">
++ <xsl:with-param name="decRedValue" select="$redValue"/>
++ <xsl:with-param name="decGreenValue" select="$greenValue"/>
++ <xsl:with-param name="decBlueValue" select="$blueValue"/>
++ </xsl:call-template>
++ </xsl:when>
++ <xsl:otherwise/>
++ </xsl:choose>
++ </xsl:template>
++ <xsl:template name="dec_rgb2Hex">
++ <xsl:param name="decRedValue"/>
++ <xsl:param name="decGreenValue"/>
++ <xsl:param name="decBlueValue"/>
++ <xsl:variable name="hexRedValue">
++ <xsl:variable name="tmpHexRedValue">
++ <xsl:call-template name="decimal2hex">
++ <xsl:with-param name="dec-number" select="$decRedValue"/>
++ <xsl:with-param name="last-value" select="'H'"/>
++ </xsl:call-template>
++ </xsl:variable>
++ <xsl:choose>
++ <xsl:when test="string-length($tmpHexRedValue) = 1">
++ <xsl:value-of select="concat('0',$tmpHexRedValue)"/>
++ </xsl:when>
++ <xsl:otherwise>
++ <xsl:value-of select="$tmpHexRedValue"/>
++ </xsl:otherwise>
++ </xsl:choose>
++ </xsl:variable>
++ <xsl:variable name="hexGreenValue">
++ <xsl:variable name="tmpHexGreenValue">
++ <xsl:call-template name="decimal2hex">
++ <xsl:with-param name="dec-number" select="$decGreenValue"/>
++ <xsl:with-param name="last-value" select="'H'"/>
++ </xsl:call-template>
++ </xsl:variable>
++ <xsl:choose>
++ <xsl:when test="string-length($tmpHexGreenValue) = 1">
++ <xsl:value-of select="concat('0',$tmpHexGreenValue)"/>
++ </xsl:when>
++ <xsl:otherwise>
++ <xsl:value-of select="$tmpHexGreenValue"/>
++ </xsl:otherwise>
++ </xsl:choose>
++ </xsl:variable>
++ <xsl:variable name="hexBlueValue">
++ <xsl:variable name="tmpHexBlueValue">
++ <xsl:call-template name="decimal2hex">
++ <xsl:with-param name="dec-number" select="$decBlueValue"/>
++ <xsl:with-param name="last-value" select="'H'"/>
++ </xsl:call-template>
++ </xsl:variable>
++ <xsl:choose>
++ <xsl:when test="string-length($tmpHexBlueValue) = 1">
++ <xsl:value-of select="concat('0',$tmpHexBlueValue)"/>
++ </xsl:when>
++ <xsl:otherwise>
++ <xsl:value-of select="$tmpHexBlueValue"/>
++ </xsl:otherwise>
++ </xsl:choose>
++ </xsl:variable>
++ <xsl:value-of select="concat('#',$hexRedValue,$hexGreenValue,$hexBlueValue)"/>
++ </xsl:template>
++ <xsl:template name="decimal2hex">
++ <!-- transforms a decimal number to a hex number,only for two-bit hex(less than 256 in decimal) currently -->
++ <xsl:param name="dec-number"/>
++ <xsl:param name="last-value"/>
++ <xsl:variable name="current-value">
++ <xsl:call-template name="decNumber2hex">
++ <xsl:with-param name="dec-value">
++ <xsl:if test="$dec-number > 15">
++ <xsl:value-of select="floor($dec-number div 16)"/>
++ </xsl:if>
++ <xsl:if test="$dec-number < 16">
++ <xsl:value-of select="$dec-number"/>
++ </xsl:if>
++ </xsl:with-param>
++ </xsl:call-template>
++ </xsl:variable>
++ <xsl:if test="$dec-number > 15">
++ <xsl:call-template name="decimal2hex">
++ <xsl:with-param name="dec-number" select="$dec-number mod 16"/>
++ <xsl:with-param name="last-value" select="concat($last-value,$current-value)"/>
++ </xsl:call-template>
++ </xsl:if>
++ <xsl:if test="$dec-number < 16">
++ <xsl:value-of select="substring-after(concat($last-value,$current-value),'H')"/>
++ </xsl:if>
++ </xsl:template>
++
++ <xsl:template name="decNumber2hex">
++ <!-- return a hex number for a decimal character -->
++ <xsl:param name="dec-value"/>
++ <xsl:choose>
++ <xsl:when test="$dec-value = 10">
++ <xsl:value-of select="'A'"/>
++ </xsl:when>
++ <xsl:when test="$dec-value = 11">
++ <xsl:value-of select="'B'"/>
++ </xsl:when>
++ <xsl:when test="$dec-value = 12">
++ <xsl:value-of select="'C'"/>
++ </xsl:when>
++ <xsl:when test="$dec-value = 13">
++ <xsl:value-of select="'D'"/>
++ </xsl:when>
++ <xsl:when test="$dec-value = 14">
++ <xsl:value-of select="'E'"/>
++ </xsl:when>
++ <xsl:when test="$dec-value = 15">
++ <xsl:value-of select="'F'"/>
++ </xsl:when>
++ <xsl:otherwise>
++ <xsl:value-of select="$dec-value"/>
++ </xsl:otherwise>
++ </xsl:choose>
++ </xsl:template>
++ <xsl:template name="GetTabColorIndex">
++ <xsl:param name="SheetColor"/>
++ <xsl:for-each select="key('config', 'TabColor')[not(.=preceding::config:config-item)]">
++ <xsl:sort select="." />
++ <xsl:variable name="tmpColor" select="."/>
++ <xsl:if test=". = $SheetColor" >
++ <xsl:value-of select="56 - position()"/>
++ </xsl:if>
++ </xsl:for-each>
++ </xsl:template>
+ <xsl:template match="office:body">
+ <!-- office:body table:table children are spreadsheets -->
+ <xsl:apply-templates />
+@@ -187,8 +352,11 @@
+ <!-- office:body table:table children are spreadsheets -->
+ <xsl:template match="office:spreadsheet/table:table">
+ <xsl:element name="ss:Worksheet">
+- <xsl:attribute name="ss:Name">
++ <xsl:variable name="TableName">
+ <xsl:value-of select="@table:name" />
++ </xsl:variable>
++ <xsl:attribute name="ss:Name">
++ <xsl:value-of select="$TableName" />
+ </xsl:attribute>
+ <xsl:call-template name="table:table" />
+ <xsl:element name="x:WorksheetOptions">
+@@ -204,6 +372,16 @@
+ <xsl:if test="key('config', 'ShowZeroValues') = 'false'">
+ <xsl:element name="x:DoNotDisplayZeros" />
+ </xsl:if>
++ <xsl:if test="/*/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry/config:config-item-map-named/config:config-item-map-entry[ config:name=$TableName]/config:config-item[ config:name='TabColor']">
++ <xsl:element name="x:TabColorIndex">
++ <xsl:variable name="TabColorIndex">
++ <xsl:call-template name="GetTabColorIndex">
++ <xsl:with-param name="SheetColor" select="/*/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry/config:config-item-map-named/config:config-item-map-entry[ config:name=$TableName]/config:config-item[ config:name='TabColor']"/>
++ </xsl:call-template>
++ </xsl:variable>
++ <xsl:value-of select="$TabColorIndex"/>
++ </xsl:element>
++ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+diff --git filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
+index a1576db..6fcae4a 100644
+--- filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
++++ filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
+@@ -385,6 +385,16 @@
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:copy-of select="$sharedConfiguration"/>
++ <xsl:if test="x:WorksheetOptions/x:TabColorIndex">
++ <config:config-item config:name="TabColor" config:type="int">
++ <xsl:variable name="temp-value">
++ <xsl:call-template name="colorindex2decimal">
++ <xsl:with-param name="colorindex" select="x:WorksheetOptions/x:TabColorIndex"/>
++ </xsl:call-template>
++ </xsl:variable>
++ <xsl:value-of select="$temp-value"/>
++ </config:config-item>
++ </xsl:if>
+ </config:config-item-map-entry>
+ </xsl:for-each>
+ </config:config-item-map-named>
+@@ -4641,6 +4651,211 @@
+ </xsl:variable>
+ <xsl:value-of select="concat('#',$R-value,$G-value,$B-value)"/>
+ </xsl:template>
++ <xsl:template name="colorindex2decimal">
++ <xsl:param name="colorindex"/>
++ <xsl:variable name="colorIndexLookup">
++ <xsl:value-of select="$colorindex - 8"/>
++ </xsl:variable>
++ <xsl:variable name="tempColorValue">
++ <xsl:choose>
++ <!-- Grab the color from the custom color index if it exists... -->
++ <xsl:when test="/ss:Workbook/o:OfficeDocumentSettings/o:Colors/o:Color/o:Index=$colorIndexLookup">
++ <xsl:value-of select="substring-after(normalize-space(/ss:Workbook/o:OfficeDocumentSettings/o:Colors/o:Color/o:RGB[/ss:Workbook/o:OfficeDocumentSettings/o:Colors/o:Color/o:Index=$colorIndexLookup]), '#')"/>
++ </xsl:when >
++ <xsl:otherwise>
++ <xsl:choose>
++ <xsl:when test="$colorindex=8">
++ <xsl:value-of select="'000000'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=9">
++ <xsl:value-of select="'FFFFFF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=10">
++ <xsl:value-of select="'FF0000'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=11">
++ <xsl:value-of select="'00FF00'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=12">
++ <xsl:value-of select="'0000FF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=13">
++ <xsl:value-of select="'FFFF00'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=14">
++ <xsl:value-of select="'FF00FF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=15">
++ <xsl:value-of select="'00FFFF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=16">
++ <xsl:value-of select="'800000'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=17">
++ <xsl:value-of select="'008000'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=18">
++ <xsl:value-of select="'000080'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=19">
++ <xsl:value-of select="'808000'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=20">
++ <xsl:value-of select="'800080'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=21">
++ <xsl:value-of select="'008080'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=22">
++ <xsl:value-of select="'C0C0C0'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=23">
++ <xsl:value-of select="'808080'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=24">
++ <xsl:value-of select="'9999FF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=25">
++ <xsl:value-of select="'993366'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=26">
++ <xsl:value-of select="'FFFFCC'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=27">
++ <xsl:value-of select="'CCFFFF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=28">
++ <xsl:value-of select="'660066'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=29">
++ <xsl:value-of select="'FF8080'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=30">
++ <xsl:value-of select="'0066CC'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=31">
++ <xsl:value-of select="'CCCCFF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=32">
++ <xsl:value-of select="'000080'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=33">
++ <xsl:value-of select="'FF00FF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=34">
++ <xsl:value-of select="'FFFF00'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=35">
++ <xsl:value-of select="'00FFFF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=36">
++ <xsl:value-of select="'800080'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=37">
++ <xsl:value-of select="'800000'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=38">
++ <xsl:value-of select="'008080'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=39">
++ <xsl:value-of select="'0000FF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=40">
++ <xsl:value-of select="'00CCFF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=41">
++ <xsl:value-of select="'CCFFFF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=42">
++ <xsl:value-of select="'CCFFCC'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=43">
++ <xsl:value-of select="'FFFF99'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=44">
++ <xsl:value-of select="'99CCFF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=45">
++ <xsl:value-of select="'FF99CC'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=46">
++ <xsl:value-of select="'CC99FF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=47">
++ <xsl:value-of select="'FFCC99'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=48">
++ <xsl:value-of select="'3366FF'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=49">
++ <xsl:value-of select="'33CCCC'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=50">
++ <xsl:value-of select="'99CC00'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=51">
++ <xsl:value-of select="'FFCC00'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=52">
++ <xsl:value-of select="'FF9900'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=53">
++ <xsl:value-of select="'FF6600'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=54">
++ <xsl:value-of select="'666699'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=55">
++ <xsl:value-of select="'969696'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=56">
++ <xsl:value-of select="'003366'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=57">
++ <xsl:value-of select="'339966'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=58">
++ <xsl:value-of select="'003300'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=59">
++ <xsl:value-of select="'333300'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=60">
++ <xsl:value-of select="'993300'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=61">
++ <xsl:value-of select="'993366'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=62">
++ <xsl:value-of select="'333399'"/>
++ </xsl:when>
++ <xsl:when test="$colorindex=63">
++ <xsl:value-of select="'333333'"/>
++ </xsl:when>
++ <xsl:otherwise>
++ <xsl:value-of select="'NOTFOUND'"/>
++ </xsl:otherwise>
++ </xsl:choose>
++ </xsl:otherwise>
++ </xsl:choose>
++ </xsl:variable>
++ <xsl:variable name="tempColorDecimal">
++ <xsl:choose>
++ <xsl:when test="not($tempColorValue = 'NOTFOUND')">
++ <xsl:call-template name="hex2decimal">
++ <xsl:with-param name="hex-number" select="$tempColorValue"/>
++ <xsl:with-param name="index" select="1"/>
++ <xsl:with-param name="str-length" select="6"/>
++ <xsl:with-param name="last-value" select="0"/>
++ </xsl:call-template>
++ </xsl:when>
++ <xsl:otherwise>
++ <xsl:value-of select="4294967295"/>
++ </xsl:otherwise>
++ </xsl:choose>
++ </xsl:variable>
++ <xsl:value-of select="$tempColorDecimal"/>
++ </xsl:template>
+ <xsl:template name="hex2decimal">
+ <!-- transforms a hex number to a decimal number.parses the string from left to right -->
+ <xsl:param name="hex-number"/>
Added: trunk/patches/dev300/calc-sheet-tab-color-oox.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/calc-sheet-tab-color-oox.diff Fri Mar 6 21:27:12 2009
@@ -0,0 +1,195 @@
+diff --git oox/inc/oox/xls/viewsettings.hxx oox/inc/oox/xls/viewsettings.hxx
+index 2294475..8b9c604 100644
+--- oox/inc/oox/xls/viewsettings.hxx
++++ oox/inc/oox/xls/viewsettings.hxx
+@@ -83,6 +83,7 @@ struct OoxSheetViewData
+ bool mbShowZeros; /// True = show zero value zells.
+ bool mbShowOutline; /// True = show outlines.
+ bool mbZoomToFit; /// True = zoom chart sheet to fit window.
++ Color maTabColor; /// Sheet tab color.
+
+ explicit OoxSheetViewData();
+
+@@ -112,6 +113,8 @@ public:
+
+ /** Imports the sheetView element containing sheet view settings. */
+ void importSheetView( const AttributeList& rAttribs );
++ /** Imports the tabcolor element containing tab color settings. */
++ void importTabColor( const AttributeList& rAttribs );
+ /** Imports the pane element containing sheet pane settings. */
+ void importPane( const AttributeList& rAttribs );
+ /** Imports the selection element containing selection settings for a pane. */
+@@ -121,6 +124,8 @@ public:
+
+ /** Imports the SHEETVIEW record containing sheet view settings. */
+ void importSheetView( RecordInputStream& rStrm );
++ /** Imports the tabcolor element containing tab color settings. */
++ void importTabColor( RecordInputStream& rStrm );
+ /** Imports the PANE record containing sheet pane settings. */
+ void importPane( RecordInputStream& rStrm );
+ /** Imports the SELECTION record containing selection settings for a pane. */
+diff --git oox/inc/oox/xls/worksheetsettings.hxx oox/inc/oox/xls/worksheetsettings.hxx
+index 083f2cc..0c0b91d 100644
+--- oox/inc/oox/xls/worksheetsettings.hxx
++++ oox/inc/oox/xls/worksheetsettings.hxx
+@@ -43,7 +43,6 @@ namespace xls {
+ struct OoxSheetPrData
+ {
+ ::rtl::OUString maCodeName; /// VBA module codename.
+- Color maTabColor; /// Sheet tab color.
+ bool mbFilterMode; /// True = sheet contains active filter.
+ bool mbApplyStyles; /// True = automatic styles when creating outlines.
+ bool mbSummaryBelow; /// True = row outline symbols below group.
+diff --git oox/source/xls/chartsheetfragment.cxx oox/source/xls/chartsheetfragment.cxx
+index d6fd382..b0da1c2 100644
+--- oox/source/xls/chartsheetfragment.cxx
++++ oox/source/xls/chartsheetfragment.cxx
+@@ -68,6 +68,8 @@ ContextWrapper OoxChartsheetFragment::onCreateContext( sal_Int32 nElement, const
+ (nElement == XLS_TOKEN( headerFooter )) ||
+ (nElement == XLS_TOKEN( picture )) ||
+ (nElement == XLS_TOKEN( drawing ));
++ case XLS_TOKEN( sheetPr ):
++ return (nElement == XLS_TOKEN( tabColor ));
+ case XLS_TOKEN( sheetViews ):
+ return (nElement == XLS_TOKEN( sheetView ));
+ case XLS_TOKEN( headerFooter ):
+@@ -86,6 +88,7 @@ void OoxChartsheetFragment::onStartElement( const AttributeList& rAttribs )
+ switch( getCurrentElement() )
+ {
+ case XLS_TOKEN( sheetPr ): getWorksheetSettings().importChartSheetPr( rAttribs ); break;
++ case XLS_TOKEN( tabColor ): getSheetViewSettings().importTabColor( rAttribs ); break;
+ case XLS_TOKEN( sheetProtection ): getWorksheetSettings().importChartProtection( rAttribs ); break;
+ case XLS_TOKEN( sheetView ): getSheetViewSettings().importChartSheetView( rAttribs ); break;
+ case XLS_TOKEN( pageMargins ): getPageSettings().importPageMargins( rAttribs ); break;
+diff --git oox/source/xls/viewsettings.cxx oox/source/xls/viewsettings.cxx
+index 6126086..e19fa0d 100644
+--- oox/source/xls/viewsettings.cxx
++++ oox/source/xls/viewsettings.cxx
+@@ -183,6 +183,7 @@ const sal_Char* const sppcSheetNames[] =
+ "ZoomType",
+ "ZoomValue",
+ "PageViewZoomValue",
++ "TabColor",
+ 0
+ };
+
+@@ -295,6 +296,12 @@ void SheetViewSettings::importSheetView( const AttributeList& rAttribs )
+ rData.mbShowOutline = rAttribs.getBool( XML_showOutlineSymbols, true );
+ }
+
++void SheetViewSettings::importTabColor( const AttributeList& rAttribs )
++{
++ OoxSheetViewData& rData = maSheetDatas.empty() ? *createSheetViewData() : *maSheetDatas.back();
++ rData.maTabColor.importColor( rAttribs );
++}
++
+ void SheetViewSettings::importPane( const AttributeList& rAttribs )
+ {
+ OSL_ENSURE( !maSheetDatas.empty(), "SheetViewSettings::importPane - missing view data" );
+@@ -362,6 +369,12 @@ void SheetViewSettings::importSheetView( RecordInputStream& rStrm )
+ rData.mbShowOutline = getFlag( nFlags, OOBIN_SHEETVIEW_SHOWOUTLINE );
+ }
+
++void SheetViewSettings::importTabColor( RecordInputStream& rStrm )
++{
++ OoxSheetViewData& rData = maSheetDatas.empty() ? *createSheetViewData() : *maSheetDatas.back();
++ rData.maTabColor.importColor( rStrm );
++}
++
+ void SheetViewSettings::importPane( RecordInputStream& rStrm )
+ {
+ OSL_ENSURE( !maSheetDatas.empty(), "SheetViewSettings::importPane - missing view data" );
+@@ -632,6 +645,7 @@ void SheetViewSettings::finalizeImport()
+ << API_ZOOMTYPE_PERCENT
+ << static_cast< sal_Int16 >( xData->getNormalZoom() )
+ << static_cast< sal_Int16 >( xData->getPageBreakZoom() )
++ << xData->maTabColor.getColor( *this )
+ << xData->maGridColor.getColor( *this )
+ << xData->isPageBreakPreview()
+ << xData->mbShowFormulas
+diff --git oox/source/xls/worksheetfragment.cxx oox/source/xls/worksheetfragment.cxx
+index c939804..302230f 100644
+--- oox/source/xls/worksheetfragment.cxx
++++ oox/source/xls/worksheetfragment.cxx
+@@ -122,7 +122,7 @@ ContextWrapper OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, const
+ case SHEETTYPE_WORKSHEET: return (nElement == XLS_TOKEN( worksheet ));
+ case SHEETTYPE_CHARTSHEET: return false;
+ case SHEETTYPE_MACROSHEET: return (nElement == XM_TOKEN( macrosheet ));
+- case SHEETTYPE_DIALOGSHEET: return (nElement == XM_TOKEN( dialogsheet ));
++ case SHEETTYPE_DIALOGSHEET: return (nElement == XLS_TOKEN( dialogsheet ));
+ case SHEETTYPE_MODULESHEET: return false;
+ case SHEETTYPE_EMPTYSHEET: return false;
+ }
+@@ -130,6 +130,7 @@ ContextWrapper OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, const
+
+ case XLS_TOKEN( worksheet ):
+ case XM_TOKEN( macrosheet ):
++ case XLS_TOKEN( dialogsheet ):
+ switch( nElement )
+ {
+ case XLS_TOKEN( sheetData ):
+@@ -211,7 +212,7 @@ void OoxWorksheetFragment::onStartElement( const AttributeList& rAttribs )
+ switch( getCurrentElement() )
+ {
+ case XLS_TOKEN( sheetPr ): getWorksheetSettings().importSheetPr( rAttribs ); break;
+- case XLS_TOKEN( tabColor ): getWorksheetSettings().importTabColor( rAttribs ); break;
++ case XLS_TOKEN( tabColor ): getSheetViewSettings().importTabColor( rAttribs ); break;
+ case XLS_TOKEN( outlinePr ): getWorksheetSettings().importOutlinePr( rAttribs ); break;
+ case XLS_TOKEN( pageSetUpPr ): importPageSetUpPr( rAttribs ); break;
+ case XLS_TOKEN( dimension ): importDimension( rAttribs ); break;
+diff --git oox/source/xls/worksheethelper.cxx oox/source/xls/worksheethelper.cxx
+index e5590f8..89036e3 100644
+--- oox/source/xls/worksheethelper.cxx
++++ oox/source/xls/worksheethelper.cxx
+@@ -975,6 +975,7 @@ void WorksheetData::finalizeWorksheetImport()
+ finalizeMergedRanges();
+ maCondFormats.finalizeImport();
+ maPageSett.finalizeImport();
++ maSheetSett.finalizeImport();
+ maSheetViewSett.finalizeImport();
+ convertColumns();
+ convertRows();
+diff --git oox/source/xls/worksheetsettings.cxx oox/source/xls/worksheetsettings.cxx
+index 6ab8975..d30106a 100644
+--- oox/source/xls/worksheetsettings.cxx
++++ oox/source/xls/worksheetsettings.cxx
+@@ -34,6 +34,7 @@
+ #include "oox/helper/recordinputstream.hxx"
+ #include "oox/xls/biffinputstream.hxx"
+ #include "oox/xls/pagesettings.hxx"
++#include "oox/xls/viewsettings.hxx"
+ #include "oox/xls/workbooksettings.hxx"
+
+ using ::rtl::OUString;
+@@ -138,11 +139,6 @@ void WorksheetSettings::importChartSheetPr( const AttributeList& rAttribs )
+ maOoxSheetData.maCodeName = rAttribs.getString( XML_codeName, OUString() );
+ }
+
+-void WorksheetSettings::importTabColor( const AttributeList& rAttribs )
+-{
+- maOoxSheetData.maTabColor.importColor( rAttribs );
+-}
+-
+ void WorksheetSettings::importOutlinePr( const AttributeList& rAttribs )
+ {
+ maOoxSheetData.mbApplyStyles = rAttribs.getBool( XML_applyStyles, false );
+@@ -187,7 +183,8 @@ void WorksheetSettings::importSheetPr( RecordInputStream& rStrm )
+ {
+ sal_uInt16 nFlags1;
+ sal_uInt8 nFlags2;
+- rStrm >> nFlags1 >> nFlags2 >> maOoxSheetData.maTabColor;
++ rStrm >> nFlags1 >> nFlags2;
++ getSheetViewSettings().importTabColor( rStrm );
+ rStrm.skip( 8 ); // sync anchor cell
+ rStrm >> maOoxSheetData.maCodeName;
+ // sheet settings
+@@ -204,7 +201,8 @@ void WorksheetSettings::importSheetPr( RecordInputStream& rStrm )
+ void WorksheetSettings::importChartSheetPr( RecordInputStream& rStrm )
+ {
+ rStrm.skip( 2 ); // flags, contains only the 'published' flag
+- rStrm >> maOoxSheetData.maTabColor >> maOoxSheetData.maCodeName;
++ getSheetViewSettings().importTabColor( rStrm );
++ rStrm >> maOoxSheetData.maCodeName;
+ }
+
+ void WorksheetSettings::importSheetProtection( RecordInputStream& rStrm )
Modified: trunk/patches/dev300/calc-sheet-tab-color-sc.diff
==============================================================================
--- trunk/patches/dev300/calc-sheet-tab-color-sc.diff (original)
+++ trunk/patches/dev300/calc-sheet-tab-color-sc.diff Fri Mar 6 21:27:12 2009
@@ -20,7 +20,7 @@
#define SC_CURSORPOSITIONX "CursorPositionX"
#define SC_CURSORPOSITIONY "CursorPositionY"
diff --git sc/inc/globstr.hrc sc/inc/globstr.hrc
-index fbf7540..e952afa 100644
+index 9d75340..44b843c 100644
--- sc/inc/globstr.hrc
+++ sc/inc/globstr.hrc
@@ -589,8 +589,11 @@
@@ -38,10 +38,10 @@
#endif
diff --git sc/inc/sc.hrc sc/inc/sc.hrc
-index ed37f66..3771901 100644
+index ed37f66..2822fa5 100644
--- sc/inc/sc.hrc
+++ sc/inc/sc.hrc
-@@ -1667,6 +1667,16 @@
+@@ -1667,6 +1667,15 @@
#define RID_SCPAGE_FORMULA (SC_OOO_BUILD_START + 5)
#define HID_SCPAGE_FORMULA (SC_OOO_BUILD_START + 6)
@@ -51,15 +51,14 @@
+
+#define SCSTR_SET_TAB_BG_COLOR (SC_OOO_BUILD_START + 9)
+#define SCSTR_NO_TAB_BG_COLOR (SC_OOO_BUILD_START + 10)
-+#define SCSTR_TAB_BG_COLOR_MORE (SC_OOO_BUILD_START + 11)
+
-+#define RID_SCDLG_TAB_BG_COLOR (SC_OOO_BUILD_START + 12)
++#define RID_SCDLG_TAB_BG_COLOR (SC_OOO_BUILD_START + 11)
+
#endif
diff --git sc/inc/scabstdlg.hxx sc/inc/scabstdlg.hxx
-index 46c9dc9..c03ad9c 100644
+index 46c9dc9..637682d 100644
--- sc/inc/scabstdlg.hxx
+++ sc/inc/scabstdlg.hxx
@@ -292,6 +292,12 @@ public:
@@ -75,7 +74,7 @@
class AbstractScImportOptionsDlg : public VclAbstractDialog //add for ScImportOptionsDlg
{
public:
-@@ -433,6 +439,15 @@ public:
+@@ -433,6 +439,14 @@ public:
const String& rDefault,
ULONG nHelpId ,
int nId ) = 0;
@@ -83,7 +82,6 @@
+ virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg ( Window* pParent, //add for ScTabBgColorDlg
+ const String& rTitle, //Dialog Title
+ const String& rTabBgColorNoColorText, //Label for no tab color
-+ const String& rTabBgColorMoreText, //Text for the more button
+ const Color& rDefaultColor, //Currently selected Color
+ ULONG nHelpId ,
+ int nId ) = 0;
@@ -106,7 +104,7 @@
};
diff --git sc/inc/tabbgcolor.hxx sc/inc/tabbgcolor.hxx
new file mode 100644
-index 0000000..d9f47ed
+index 0000000..83b694a
--- /dev/null
+++ sc/inc/tabbgcolor.hxx
@@ -0,0 +1,46 @@
@@ -156,16 +154,16 @@
+};
+DECLARE_LIST( ScUndoSetTabBgColorInfoList, ScUndoSetTabBgColorInfo* )
+#endif
-\ No newline at end of file
diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx
-index 253c197..a348e69 100644
+index 91aed81..6afb1a3 100644
--- sc/inc/unonames.hxx
+++ sc/inc/unonames.hxx
-@@ -529,6 +529,7 @@
+@@ -529,6 +529,8 @@
#define SC_UNO_ZOOMVALUE "ZoomValue"
#define SC_UNO_UPDTEMPL "UpdateFromTemplate"
#define SC_UNO_FILTERED_RANGE_SELECTION "FilteredRangeSelection"
+#define SC_UNO_TABCOLOR "TabColor"
++
/*Stampit enable/disable print cancel */
#define SC_UNO_ALLOWPRINTJOBCANCEL "AllowPrintJobCancel"
@@ -357,10 +355,10 @@
// ============================================================================
diff --git sc/source/filter/excel/xichart.cxx sc/source/filter/excel/xichart.cxx
-index 99613dc..530aeca 100644
+index 04a7f88..f844e6e 100644
--- sc/source/filter/excel/xichart.cxx
+++ sc/source/filter/excel/xichart.cxx
-@@ -3566,6 +3566,12 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
+@@ -3610,6 +3610,12 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm )
case EXC_ID_WINDOW2: rTabViewSett.ReadWindow2( rStrm, true );break;
case EXC_ID_SCL: rTabViewSett.ReadScl( rStrm ); break;
@@ -513,7 +511,7 @@
explicit XclTabViewData();
~XclTabViewData();
diff --git sc/source/ui/attrdlg/scdlgfact.cxx sc/source/ui/attrdlg/scdlgfact.cxx
-index ad0e25b..e631188 100644
+index ad0e25b..5455908 100644
--- sc/source/ui/attrdlg/scdlgfact.cxx
+++ sc/source/ui/attrdlg/scdlgfact.cxx
@@ -61,6 +61,7 @@
@@ -547,7 +545,7 @@
//add for AbstractScImportOptionsDlg_Impl begin
void AbstractScImportOptionsDlg_Impl::GetImportOptions( ScImportOptions& rOptions ) const //add for ScImportOptionsDlg
{
-@@ -1263,6 +1273,32 @@ AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg ( Window
+@@ -1263,6 +1273,31 @@ AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg ( Window
}
//add for ScStringInputDlg end
@@ -556,7 +554,6 @@
+ Window* pParent,
+ const String& rTitle,
+ const String& rTabBgColorNoColorText,
-+ const String& rTabBgColorMoreText,
+ const Color& rDefaultColor,
+ ULONG nHelpId ,
+ int nId )
@@ -565,7 +562,7 @@
+switch ( nId )
+{
+ case RID_SCDLG_TAB_BG_COLOR :
-+ pDlg = new ScTabBgColorDlg( pParent, rTitle, rTabBgColorNoColorText, rTabBgColorMoreText, rDefaultColor, nHelpId );
++ pDlg = new ScTabBgColorDlg( pParent, rTitle, rTabBgColorNoColorText, rDefaultColor, nHelpId );
+ break;
+ default:
+ break;
@@ -581,7 +578,7 @@
AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg ( Window* pParent,
int nId,
diff --git sc/source/ui/attrdlg/scdlgfact.hxx sc/source/ui/attrdlg/scdlgfact.hxx
-index 05864d1..dd59844 100644
+index 05864d1..3efe3f6 100644
--- sc/source/ui/attrdlg/scdlgfact.hxx
+++ sc/source/ui/attrdlg/scdlgfact.hxx
@@ -62,6 +62,7 @@ class ScDPShowDetailDlg;
@@ -605,7 +602,7 @@
class AbstractScImportOptionsDlg_Impl : public AbstractScImportOptionsDlg //add for ScImportOptionsDlg
{
DECL_ABSTDLG_BASE( AbstractScImportOptionsDlg_Impl, ScImportOptionsDlg)
-@@ -517,6 +524,15 @@ public:
+@@ -517,6 +524,14 @@ public:
const String& rDefault,
ULONG nHelpId ,
int nId );
@@ -613,7 +610,6 @@
+ virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg ( Window* pParent, //add for ScStringInputDlg
+ const String& rTitle, //Dialog Title
+ const String& rTabBgColorNoColorText, //Label for no tab color
-+ const String& rTabBgColorMoreText, //Label for more button
+ const Color& rDefaultColor, //Currently selected Color
+ ULONG nHelpId ,
+ int nId );
@@ -622,10 +618,10 @@
int nId,
BOOL bAscii = TRUE,
diff --git sc/source/ui/docshell/docfunc.cxx sc/source/ui/docshell/docfunc.cxx
-index 5da446b..4936634 100644
+index 25ecd29..fde95e5 100644
--- sc/source/ui/docshell/docfunc.cxx
+++ sc/source/ui/docshell/docfunc.cxx
-@@ -2612,6 +2612,104 @@ BOOL ScDocFunc::RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL
+@@ -2684,6 +2684,104 @@ BOOL ScDocFunc::RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL
return bSuccess;
}
@@ -731,7 +727,7 @@
//! SetWidthOrHeight - noch doppelt zu ViewFunc !!!!!!
diff --git sc/source/ui/inc/docfunc.hxx sc/source/ui/inc/docfunc.hxx
-index d2bbeaf..cf19ea2 100644
+index 6623be1..9976230 100644
--- sc/source/ui/inc/docfunc.hxx
+++ sc/source/ui/inc/docfunc.hxx
@@ -35,6 +35,7 @@
@@ -742,7 +738,7 @@
class ScEditEngineDefaulter;
class SfxUndoAction;
-@@ -116,6 +117,10 @@ public:
+@@ -121,6 +122,10 @@ public:
BOOL RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL bApi );
BOOL DeleteTable( SCTAB nTab, BOOL bRecord, BOOL bApi );
@@ -754,7 +750,7 @@
BOOL SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL bApi );
diff --git sc/source/ui/inc/miscdlgs.hrc sc/source/ui/inc/miscdlgs.hrc
-index 0c35e7e..5fae557 100644
+index 0c35e7e..ab4babe 100644
--- sc/source/ui/inc/miscdlgs.hrc
+++ sc/source/ui/inc/miscdlgs.hrc
@@ -184,3 +184,9 @@
@@ -766,13 +762,13 @@
+#define TAB_BG_COLOR_CT_BORDER 1
+#define TAB_BG_COLOR_SET_BGDCOLOR 2
+#define TAB_BG_COLOR_GB_BGDCOLOR 3
-+#define TAB_BG_COLOR_BTN_MORE 4
++
diff --git sc/source/ui/inc/tabbgcolordlg.hxx sc/source/ui/inc/tabbgcolordlg.hxx
new file mode 100644
-index 0000000..ab0b704
+index 0000000..235a06e
--- /dev/null
+++ sc/source/ui/inc/tabbgcolordlg.hxx
-@@ -0,0 +1,93 @@
+@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -812,17 +808,6 @@
+#include <svtools/valueset.hxx>
+
+//------------------------------------------------------------------------
-+/*class ScTabBgColorValueSet : public ValueSet
-+{
-+
-+public:
-+ ScTabBgColorValueSet(Control* pParent, const ResId& rResId, ScTabBgColorDlg* pTabBgColorDlg);
-+ //~ScTabBgColorValueSet();
-+
-+ virtual void KeyInput( const KeyEvent& rKEvt );
-+private:
-+ ScTabBgColorDlg* aTabBgColorDlg;
-+};*/
+
+class ScTabBgColorDlg : public ModalDialog
+{
@@ -830,7 +815,6 @@
+ ScTabBgColorDlg( Window* pParent,
+ const String& rTitle,
+ const String& rTabBgColorNoColorText,
-+ const String& rNoTabBgColorText,
+ const Color& rDefaultColor,
+ ULONG nHelpId );
+ ~ScTabBgColorDlg();
@@ -856,7 +840,6 @@
+ HelpButton aBtnHelp;
+ Color aTabBgColor;
+ const String aTabBgColorNoColorText;
-+ const String aTabBgColorMoreText;
+ ULONG aHelpId;
+
+ void FillColorValueSets_Impl();
@@ -942,7 +925,7 @@
void SetRefTabNo( SCTAB nNewTab ) { nRefTabNo = nNewTab; }
diff --git sc/source/ui/inc/viewfunc.hxx sc/source/ui/inc/viewfunc.hxx
-index 72e2d96..6b12460 100644
+index d237962..3f99bde 100644
--- sc/source/ui/inc/viewfunc.hxx
+++ sc/source/ui/inc/viewfunc.hxx
@@ -32,6 +32,8 @@
@@ -978,10 +961,10 @@
$(SLO)$/filldlg.obj \
diff --git sc/source/ui/miscdlgs/tabbgcolordlg.cxx sc/source/ui/miscdlgs/tabbgcolordlg.cxx
new file mode 100644
-index 0000000..18087cd
+index 0000000..8e9987e
--- /dev/null
+++ sc/source/ui/miscdlgs/tabbgcolordlg.cxx
-@@ -0,0 +1,205 @@
+@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1038,7 +1021,6 @@
+__EXPORT ScTabBgColorDlg::ScTabBgColorDlg( Window* pParent,
+ const String& rTitle,
+ const String& rTabBgColorNoColorText,
-+ const String& rTabBgColorMoreText,
+ const Color& rDefaultColor,
+ ULONG nHelpId ) :
+ ModalDialog ( pParent, ScResId( RID_SCDLG_TAB_BG_COLOR ) ),
@@ -1049,7 +1031,6 @@
+ aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
+ aBtnHelp ( this, ScResId( BTN_HELP ) ),
+ aTabBgColorNoColorText ( rTabBgColorNoColorText ),
-+ aTabBgColorMoreText ( rTabBgColorMoreText ),
+ aTabBgColor ( rDefaultColor ),
+ aHelpId ( nHelpId )
+
@@ -1072,12 +1053,6 @@
+ rColor = this->aTabBgColor;
+}
+
-+/*void ScTabBgColorDlg::SelectColor( const Color& rColor2 ) const
-+{
-+ this->aTabBgColor = rColor2;
-+ this->EndDialog( TRUE );
-+}*/
-+
+__EXPORT ScTabBgColorDlg::~ScTabBgColorDlg()
+{
+}
@@ -1155,9 +1130,9 @@
+
+IMPL_LINK( ScTabBgColorDlg, TabBgColorOKHdl_Impl, OKButton*, EMPTYARG )
+{
-+/*
-+ Handler, called when the more button is pushed
-+*/
++
++// Handler, called when the OK button is pushed
++
+ USHORT nItemId = aTabBgColorSet.GetSelectItemId();
+ Color aColor = nItemId ? ( aTabBgColorSet.GetItemColor( nItemId ) ) : Color( COL_AUTO );
+ aTabBgColor = aColor;
@@ -1175,20 +1150,20 @@
+{
+ switch ( rKEvt.GetKeyCode().GetCode() )
+ {
++ case KEY_SPACE:
+ case KEY_RETURN:
+ {
+ USHORT nItemId = GetSelectItemId();
+ const Color& aColor = nItemId ? ( GetItemColor( nItemId ) ) : Color( COL_AUTO );
+ aTabBgColorDlg->aTabBgColor = aColor;
+ aTabBgColorDlg->EndDialog(TRUE);
-+ //aTabBgColorDlg->SelectColor(aColor);
+ }
+ break;
+ }
+ ValueSet::KeyInput(rKEvt);
+}
diff --git sc/source/ui/src/globstr.src sc/source/ui/src/globstr.src
-index 6912e7a..647bf28 100644
+index 4373c5a..1d86b87 100644
--- sc/source/ui/src/globstr.src
+++ sc/source/ui/src/globstr.src
@@ -1134,6 +1134,14 @@ Resource RID_GLOBSTR
@@ -1207,10 +1182,10 @@
{
Text [ en-US ] = "Move Sheets" ;
diff --git sc/source/ui/src/miscdlgs.src sc/source/ui/src/miscdlgs.src
-index fce9761..0575a23 100644
+index fce9761..d0ff8a5 100644
--- sc/source/ui/src/miscdlgs.src
+++ sc/source/ui/src/miscdlgs.src
-@@ -546,6 +546,58 @@ ModalDialog RID_SCDLG_STRINPUT
+@@ -546,6 +546,96 @@ ModalDialog RID_SCDLG_STRINPUT
Size = MAP_APPFONT ( 110 , 8 ) ;
};
};
@@ -1218,7 +1193,7 @@
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
-+ Size = MAP_APPFONT ( 180 , 150 ) ;
++ Size = MAP_APPFONT ( 118 , 167 ) ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ Control TAB_BG_COLOR_CT_BORDER
@@ -1230,20 +1205,57 @@
+ };
+ Control TAB_BG_COLOR_SET_BGDCOLOR
+ {
-+ /*HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ;*/
++ // * HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ;
+ Hide = FALSE ;
+ Pos = MAP_APPFONT ( 0 , 0 ) ;
+ Size = MAP_APPFONT ( 116 , 145 ) ;
+ TabStop = TRUE ;
+ };
-+ /*PushButton TAB_BG_COLOR_BTN_MORE
++ CancelButton BTN_CANCEL
+ {
-+ Pos = MAP_APPFONT ( 34, 152 ) ;
-+ Size = MAP_APPFONT ( 50 , 15 ) ;
-+ //Text = SCSTR_TAB_BG_COLOR_MORE;
++ Pos = MAP_APPFONT ( 82 , 151 ) ;
++ Size = MAP_APPFONT ( 35 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = FALSE ;
-+ };*/
++ };
++ OKButton BTN_OK
++ {
++ Pos = MAP_APPFONT ( 45 , 151 ) ;
++ Size = MAP_APPFONT ( 35 , 14 ) ;
++ TabStop = TRUE ;
++ DefButton = TRUE ;
++ };
++ HelpButton BTN_HELP
++ {
++ Pos = MAP_APPFONT ( 2 , 151 ) ;
++ Size = MAP_APPFONT ( 35 , 14 ) ;
++ TabStop = TRUE ;
++ DefButton = FALSE ;
++ };
++};
++/*
++ModalDialog RID_SCDLG_TAB_BG_COLOR
++{
++ OutputSize = TRUE ;
++ SVLook = TRUE ;
++ Size = MAP_APPFONT ( 180 , 150 ) ;
++ Moveable = TRUE ;
++ Closeable = TRUE ;
++ Control TAB_BG_COLOR_CT_BORDER
++ {
++ Border = TRUE ;
++ Pos = MAP_APPFONT ( 1 , 1 ) ; //12, 32
++ Size = MAP_APPFONT ( 116+2 , 145+2 ) ;
++ DialogControl = TRUE;
++ };
++ Control TAB_BG_COLOR_SET_BGDCOLOR
++ {
++ // * HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ;
++ Hide = FALSE ;
++ Pos = MAP_APPFONT ( 0 , 0 ) ;
++ Size = MAP_APPFONT ( 116 , 145 ) ;
++ TabStop = TRUE ;
++ };
+ OKButton BTN_OK
+ {
+ Pos = MAP_APPFONT ( 125 , 50 ) ;
@@ -1266,6 +1278,7 @@
+ DefButton = FALSE ;
+ };
+};
++*/
/*
ModalDialog RID_SCDLG_MTRINPUT
{
@@ -1290,10 +1303,10 @@
};
diff --git sc/source/ui/src/scstring.src sc/source/ui/src/scstring.src
-index ed03d74..12ae0aa 100644
+index ed03d74..7983a42 100644
--- sc/source/ui/src/scstring.src
+++ sc/source/ui/src/scstring.src
-@@ -283,6 +283,18 @@ String SCSTR_RENAMETAB
+@@ -283,6 +283,14 @@ String SCSTR_RENAMETAB
{
Text [ en-US ] = "Rename Sheet" ;
};
@@ -1305,10 +1318,6 @@
+{
+ Text [ en-US ] = "Default" ;
+};
-+String SCSTR_TAB_BG_COLOR_MORE
-+{
-+ Text [ en-US ] = "~More" ;
-+};
String SCSTR_RENAMEOBJECT
{
Text [ en-US ] = "Name Object";
@@ -1463,7 +1472,7 @@
}
diff --git sc/source/ui/view/tabcont.cxx sc/source/ui/view/tabcont.cxx
-index 5117f2b..c601ef3 100644
+index 2bfa51f..557d1b3 100644
--- sc/source/ui/view/tabcont.cxx
+++ sc/source/ui/view/tabcont.cxx
@@ -68,6 +68,7 @@ ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) :
@@ -1532,7 +1541,7 @@
}
}
diff --git sc/source/ui/view/tabvwshf.cxx sc/source/ui/view/tabvwshf.cxx
-index 6987883..42724e6 100644
+index 6987883..323f343 100644
--- sc/source/ui/view/tabvwshf.cxx
+++ sc/source/ui/view/tabvwshf.cxx
@@ -60,6 +60,10 @@
@@ -1546,7 +1555,7 @@
#define IS_AVAILABLE(WhichId,ppItem) \
(pReqArgs->GetItemState((WhichId), TRUE, ppItem ) == SFX_ITEM_SET)
-@@ -696,17 +700,132 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
+@@ -696,17 +700,131 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
rBindings.Invalidate( FID_TAB_TOGGLE_GRID );
PaintGrid();
rReq.Done();
@@ -1621,7 +1630,6 @@
+ GetDialogParent(),
+ String(ScResId(SCSTR_SET_TAB_BG_COLOR)),
+ String(ScResId(SCSTR_NO_TAB_BG_COLOR)),
-+ String(ScResId(SCSTR_TAB_BG_COLOR_MORE)),
+ aTabBgColor,
+ nSlot,RID_SCDLG_TAB_BG_COLOR);
+ while ( !bDone && nRet == RET_OK )
@@ -1684,7 +1692,7 @@
void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
{
ScViewData* pViewData = GetViewData();
-@@ -821,6 +940,23 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
+@@ -821,6 +939,23 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet )
case FID_TAB_TOGGLE_GRID:
rSet.Put( SfxBoolItem(nWhich, pViewData->GetShowGrid()) );
break;
@@ -1807,18 +1815,18 @@
}
diff --git sc/source/ui/view/viewfun2.cxx sc/source/ui/view/viewfun2.cxx
-index 30f3976..050e3fb 100644
+index 6c5a480..d6fd25d 100644
--- sc/source/ui/view/viewfun2.cxx
+++ sc/source/ui/view/viewfun2.cxx
-@@ -93,6 +93,7 @@ using namespace com::sun::star;
- #include "inputwin.hxx"
+@@ -95,6 +95,7 @@ using namespace com::sun::star;
#include "funcdesc.hxx"
+ #include "docuno.hxx"
+#include "tabbgcolor.hxx" //DBW
// STATIC DATA ---------------------------------------------------------------
-@@ -2271,6 +2272,28 @@ BOOL ScViewFunc::RenameTable( const String& rName, SCTAB nTab )
+@@ -2388,6 +2389,28 @@ BOOL ScViewFunc::RenameTable( const String& rName, SCTAB nTab )
//----------------------------------------------------------------------------
@@ -1861,10 +1869,10 @@
</menu:menu>
<menu:menu menu:id=".uno:MergeCellsMenu">
diff --git sc/util/makefile.mk sc/util/makefile.mk
-index 982d458..564882f 100644
+index d775a20..dd6c36d 100644
--- sc/util/makefile.mk
+++ sc/util/makefile.mk
-@@ -261,6 +261,7 @@ LIB8OBJFILES = \
+@@ -262,6 +262,7 @@ LIB8OBJFILES = \
$(SLO)$/attrdlg.obj \
$(SLO)$/scuiimoptdlg.obj \
$(SLO)$/strindlg.obj \
Modified: trunk/patches/dev300/calc-sheet-tab-color-svtools.diff
==============================================================================
--- trunk/patches/dev300/calc-sheet-tab-color-svtools.diff (original)
+++ trunk/patches/dev300/calc-sheet-tab-color-svtools.diff Fri Mar 6 21:27:12 2009
@@ -1,5 +1,5 @@
diff --git svtools/inc/tabbar.hxx svtools/inc/tabbar.hxx
-index ee25537..4b80e67 100644
+index 99cb2df..07e4771 100644
--- svtools/inc/tabbar.hxx
+++ svtools/inc/tabbar.hxx
@@ -430,6 +430,11 @@ public:
@@ -15,10 +15,10 @@
void EnablePage( USHORT nPageId, BOOL bEnable = TRUE );
diff --git svtools/source/control/tabbar.cxx svtools/source/control/tabbar.cxx
-index 81795e7..ffe3fc7 100644
+index f3fb16f..9156f97 100644
--- svtools/source/control/tabbar.cxx
+++ svtools/source/control/tabbar.cxx
-@@ -75,6 +75,10 @@ struct ImplTabBarItem
+@@ -65,6 +65,10 @@ struct ImplTabBarItem
BOOL mbShort;
BOOL mbSelect;
BOOL mbEnable;
@@ -29,7 +29,7 @@
ImplTabBarItem( USHORT nItemId, const XubString& rText,
TabBarPageBits nPageBits ) :
-@@ -87,6 +91,8 @@ struct ImplTabBarItem
+@@ -77,6 +81,8 @@ struct ImplTabBarItem
mbShort = FALSE;
mbSelect = FALSE;
mbEnable = TRUE;
@@ -38,7 +38,7 @@
}
};
-@@ -1059,7 +1065,8 @@ void TabBar::Paint( const Rectangle& )
+@@ -1049,7 +1055,8 @@ void TabBar::Paint( const Rectangle& )
// Font selektieren
Font aFont = GetFont();
Font aLightFont = aFont;
@@ -48,7 +48,7 @@
// #i36013# exclude push buttons from painting area
Rectangle aClipRect( Point( mnOffX, 0 ), Point( mnLastOffX, GetOutputHeightPixel() - 1 ) );
-@@ -1133,15 +1140,22 @@ void TabBar::Paint( const Rectangle& )
+@@ -1123,15 +1130,23 @@ void TabBar::Paint( const Rectangle& )
SetFont( aLightFont );
// Je nach Status die richtige FillInBrush setzen
@@ -63,7 +63,8 @@
{
- SetFillColor( aFaceColor );
- SetTextColor( aFaceTextColor );
-+ if ( !pItem->IsDefaultTabBgColor() ) {
++ if ( !pItem->IsDefaultTabBgColor() )
++ {
+ SetFillColor( pItem->maTabBgColor );
+ SetTextColor( pItem->maTabTextColor );
+ } else {
@@ -73,7 +74,24 @@
}
// Muss Font Kursiv geschaltet werden
-@@ -1183,11 +1197,26 @@ void TabBar::Paint( const Rectangle& )
+@@ -1163,21 +1178,38 @@ void TabBar::Paint( const Rectangle& )
+ long nTextHeight = GetTextHeight();
+ Point aTxtPos( aRect.Left()+(aRectSize.Width()-nTextWidth)/2,
+ (aRectSize.Height()-nTextHeight)/2 );
+- if ( !pItem->mbEnable )
+- DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) );
+- else
+- DrawText( aTxtPos, aText );
+-
++ if ( pItem->IsDefaultTabBgColor() || (!pItem->mbSelect) )
++ {
++ if ( !pItem->mbEnable )
++ DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) );
++ else
++ DrawText( aTxtPos, aText );
++ }
+ // Jetzt im Inhalt den 3D-Effekt ausgeben
+ aPos0.X()++;
aPos1.X()++;
aPos2.X()--;
aPos3.X()--;
@@ -101,7 +119,7 @@
DrawLine( Point( aPos0.X(), aPos0.Y()+1 ),
Point( aPos3.X(), aPos3.Y()+1 ) );
}
-@@ -1197,8 +1226,22 @@ void TabBar::Paint( const Rectangle& )
+@@ -1187,8 +1219,27 @@ void TabBar::Paint( const Rectangle& )
aPos1.X()--;
aPos1.Y()--;
aPos2.Y()--;
@@ -118,13 +136,18 @@
+ {
+ if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) {
+ SetLineColor( pItem->maTabBgColor );
++ DrawLine( Point(aPos1.X()-1, aPos1.Y()-1), Point(aPos2.X(), aPos2.Y()-1) );
++ if ( !pItem->mbEnable )
++ DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) );
++ else
++ DrawText( aTxtPos, aText );
+ }
+ }
+
// Da etwas uebermalt werden konnte, muessen wir die Polygon-
// umrandung nocheinmal ausgeben
SetLineColor( rStyleSettings.GetDarkShadowColor() );
-@@ -1565,6 +1608,42 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
+@@ -1565,6 +1616,42 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
// -----------------------------------------------------------------------
@@ -167,7 +190,7 @@
void TabBar::RemovePage( USHORT nPageId )
{
USHORT nPos = GetPagePos( nPageId );
-@@ -2476,9 +2555,12 @@ USHORT TabBar::ShowDropPos( const Point& rPos )
+@@ -2486,9 +2573,12 @@ USHORT TabBar::ShowDropPos( const Point& rPos )
nX--;
else
nX++;
@@ -180,7 +203,7 @@
}
if ( (mnDropPos > 0) && (mnDropPos < nItemCount+1) )
{
-@@ -2486,6 +2568,8 @@ USHORT TabBar::ShowDropPos( const Point& rPos )
+@@ -2496,6 +2586,8 @@ USHORT TabBar::ShowDropPos( const Point& rPos )
nX = pItem->maRect.Right()-TABBAR_OFFSET_X;
if ( mnDropPos == nCurPos )
nX++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]