[prev in list] [next in list] [prev in thread] [next in thread] 

List:       calligra-devel
Subject:    Re: warning C4129: '%' : unrecognized character escape sequence
From:       Andrius da Costa Ribas <andriusmao () gmail ! com>
Date:       2012-03-18 3:52:50
Message-ID: CADzOArE5O8ccoqnA5RD9GrrutcGyHwoaKSuEYZCd4bGATX-Mkw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Please find attached the patch for 2.4 branch (Either reviewboard does not
accept patches for non-master or I don't know how to).

2012/3/17 Andrius da Costa Ribas <andriusmao@gmail.com>

> Hello,
>
> As discussed on IRC, some sources contains "\%" invalid escape sequence:
>
> filters/libmso/ODrawToOdf.cpp(625):         style.addAttribute("svg:x1",
> QString("%1\%").arg(x1));
> filters/libmso/ODrawToOdf.cpp(626):         style.addAttribute("svg:y1",
> QString("%1\%").arg(y1));
> filters/libmso/ODrawToOdf.cpp(627):         style.addAttribute("svg:x2",
> QString("%1\%").arg(x2));
> filters/libmso/ODrawToOdf.cpp(628):         style.addAttribute("svg:y2",
> QString("%1\%").arg(y2));
> filters/libmso/ODrawToOdf.cpp(680):         style.addAttribute("svg:x1",
> QString("%1\%").arg(x1));
> filters/libmso/ODrawToOdf.cpp(681):         style.addAttribute("svg:y1",
> QString("%1\%").arg(y1));
> filters/libmso/ODrawToOdf.cpp(682):         style.addAttribute("svg:x2",
> QString("%1\%").arg(x2));
> filters/libmso/ODrawToOdf.cpp(683):         style.addAttribute("svg:y2",
> QString("%1\%").arg(y2));
> filters/sheets/xlsx/ChartExport.cpp(240):
> style.addProperty( "draw:opacity", QString( "%1\%" ).arg(
> chart()->m_areaFormat->m_foreground.alphaF() * 100.0 ),
> KoGenStyle::GraphicType );
> filters/sheets/xlsx/ChartExport.cpp(302):
> style.addProperty( "draw:opacity", QString( "%1\%" ).arg(
> areaFormat->m_foreground.alphaF() * 100.0 ), KoGenStyle::GraphicType );
>
> Is it okay to just replace "\%" by "%" ?
>
> Thanks,
> Andrius.
>

[Attachment #5 (text/html)]

Please find attached the patch for 2.4 branch (Either reviewboard does not accept \
patches for non-master or I don&#39;t know how to).<br><br><div \
class="gmail_quote">2012/3/17 Andrius da Costa Ribas <span dir="ltr">&lt;<a \
href="mailto:andriusmao@gmail.com">andriusmao@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Hello,<div><br></div><div>As discussed on IRC, some sources \
contains &quot;\%&quot; invalid escape sequence:</div><div>

<br></div><div><div>filters/libmso/ODrawToOdf.cpp(625):         \
style.addAttribute(&quot;svg:x1&quot;, QString(&quot;%1\%&quot;).arg(x1));</div> \
<div>filters/libmso/ODrawToOdf.cpp(626):         \
style.addAttribute(&quot;svg:y1&quot;, \
QString(&quot;%1\%&quot;).arg(y1));</div><div>filters/libmso/ODrawToOdf.cpp(627):     \
style.addAttribute(&quot;svg:x2&quot;, QString(&quot;%1\%&quot;).arg(x2));</div>


<div>filters/libmso/ODrawToOdf.cpp(628):         \
style.addAttribute(&quot;svg:y2&quot;, \
QString(&quot;%1\%&quot;).arg(y2));</div><div>filters/libmso/ODrawToOdf.cpp(680):     \
style.addAttribute(&quot;svg:x1&quot;, QString(&quot;%1\%&quot;).arg(x1));</div>


<div>filters/libmso/ODrawToOdf.cpp(681):         \
style.addAttribute(&quot;svg:y1&quot;, \
QString(&quot;%1\%&quot;).arg(y1));</div><div>filters/libmso/ODrawToOdf.cpp(682):     \
style.addAttribute(&quot;svg:x2&quot;, QString(&quot;%1\%&quot;).arg(x2));</div>


<div>filters/libmso/ODrawToOdf.cpp(683):         \
style.addAttribute(&quot;svg:y2&quot;, \
QString(&quot;%1\%&quot;).arg(y2));</div><div>filters/sheets/xlsx/ChartExport.cpp(240): \
style.addProperty( &quot;draw:opacity&quot;, QString( &quot;%1\%&quot; ).arg( \
chart()-&gt;m_areaFormat-&gt;m_foreground.alphaF() * 100.0 ), KoGenStyle::GraphicType \
);</div>


<div>filters/sheets/xlsx/ChartExport.cpp(302):                 style.addProperty( \
&quot;draw:opacity&quot;, QString( &quot;%1\%&quot; ).arg( \
areaFormat-&gt;m_foreground.alphaF() * 100.0 ), KoGenStyle::GraphicType );</div>


</div><div><br></div><div>Is it okay to just replace &quot;\%&quot; by &quot;%&quot; \
?</div><div><br></div><div>Thanks,</div><div>Andrius.</div> </blockquote></div><br>

--047d7b2edff17501f604bb7c610b--


["0001-Fix-invalid-escape-sequence.patch" (application/octet-stream)]

From 875e5c764184c8ad614b64f3a697daaebe0e7e5f Mon Sep 17 00:00:00 2001
From: Andrius da Costa Ribas <andriusmao@gmail.com>
Date: Sun, 18 Mar 2012 00:48:51 -0300
Subject: [PATCH] Fix invalid escape sequence "\%"

---
 filters/libmso/ODrawToOdf.cpp                 |   16 ++++++++--------
 filters/sheets/xlsx/ChartExport.cpp           |    4 ++--
 filters/words/wordperfect/import/PageSpan.cxx |    2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/filters/libmso/ODrawToOdf.cpp b/filters/libmso/ODrawToOdf.cpp
index b986789..ac589a9 100644
--- a/filters/libmso/ODrawToOdf.cpp
+++ b/filters/libmso/ODrawToOdf.cpp
@@ -622,10 +622,10 @@ void ODrawToOdf::defineGradientStyle(KoGenStyle& style, const \
                DrawStyle& ds)
     // if it is empty use the colors defined inside fillColor() and fillBackColor
 
     if (ds.fillShadeColors()) {
-        style.addAttribute("svg:x1", QString("%1\%").arg(x1));
-        style.addAttribute("svg:y1", QString("%1\%").arg(y1));
-        style.addAttribute("svg:x2", QString("%1\%").arg(x2));
-        style.addAttribute("svg:y2", QString("%1\%").arg(y2));
+        style.addAttribute("svg:x1", QString("%1%").arg(x1));
+        style.addAttribute("svg:y1", QString("%1%").arg(y1));
+        style.addAttribute("svg:x2", QString("%1%").arg(x2));
+        style.addAttribute("svg:y2", QString("%1%").arg(y2));
 
         IMsoArray a = ds.fillShadeColors_complex();
 
@@ -677,10 +677,10 @@ void ODrawToOdf::defineGradientStyle(KoGenStyle& style, const \
DrawStyle& ds)  }
         }
 
-        style.addAttribute("svg:x1", QString("%1\%").arg(x1));
-        style.addAttribute("svg:y1", QString("%1\%").arg(y1));
-        style.addAttribute("svg:x2", QString("%1\%").arg(x2));
-        style.addAttribute("svg:y2", QString("%1\%").arg(y2));
+        style.addAttribute("svg:x1", QString("%1%").arg(x1));
+        style.addAttribute("svg:y1", QString("%1%").arg(y1));
+        style.addAttribute("svg:x2", QString("%1%").arg(x2));
+        style.addAttribute("svg:y2", QString("%1%").arg(y2));
 
         elementWriter.startElement("svg:stop");
         elementWriter.addAttribute("svg:offset", "0");
diff --git a/filters/sheets/xlsx/ChartExport.cpp \
b/filters/sheets/xlsx/ChartExport.cpp index 6b14323..afc2b54 100644
--- a/filters/sheets/xlsx/ChartExport.cpp
+++ b/filters/sheets/xlsx/ChartExport.cpp
@@ -237,7 +237,7 @@ QString ChartExport::genChartAreaStyle(KoGenStyle& style, \
KoGenStyles& styles, K  color = QColor("#FFFFFF");
             style.addProperty( "draw:fill-color", color.name(), \
KoGenStyle::GraphicType );  if ( color.alpha() < 255 )
-                style.addProperty( "draw:opacity", QString( "%1\%" ).arg( \
chart()->m_areaFormat->m_foreground.alphaF() * 100.0 ), KoGenStyle::GraphicType ); +  \
style.addProperty( "draw:opacity", QString( "%1%" ).arg( \
chart()->m_areaFormat->m_foreground.alphaF() * 100.0 ), KoGenStyle::GraphicType );  }
     }
     return styles.insert( style, "ch" );
@@ -299,7 +299,7 @@ QString ChartExport::genPlotAreaStyle( KoGenStyle& style, \
KoGenStyles& styles, K  color = QColor(paletteSet ? "#C0C0C0" : "#FFFFFF");
             style.addProperty( "draw:fill-color", color.name(), \
KoGenStyle::GraphicType );  if ( color.alpha() < 255 )
-                style.addProperty( "draw:opacity", QString( "%1\%" ).arg( \
areaFormat->m_foreground.alphaF() * 100.0 ), KoGenStyle::GraphicType ); +             \
style.addProperty( "draw:opacity", QString( "%1%" ).arg( \
areaFormat->m_foreground.alphaF() * 100.0 ), KoGenStyle::GraphicType );  }
     }
     return styles.insert( style, "ch" );
diff --git a/filters/words/wordperfect/import/PageSpan.cxx \
b/filters/words/wordperfect/import/PageSpan.cxx index 759d43d..9f5b395 100644
--- a/filters/words/wordperfect/import/PageSpan.cxx
+++ b/filters/words/wordperfect/import/PageSpan.cxx
@@ -105,7 +105,7 @@ void PageSpan::writePageMaster(const int iNum, DocumentHandler \
&xHandler) const  footnoteSepPropList.insert("style:distance-before-sep", \
WPXString("0.0398inch"));  footnoteSepPropList.insert("style:distance-after-sep", \
WPXString("0.0398inch"));  footnoteSepPropList.insert("style:adjustment", \
                WPXString("left"));
-	footnoteSepPropList.insert("style:rel-width", WPXString("25\%"));
+	footnoteSepPropList.insert("style:rel-width", WPXString("25%"));
 	footnoteSepPropList.insert("style:color", WPXString("#000000"));
 	xHandler.startElement("style:footnote-sep", footnoteSepPropList);
 
-- 
1.7.4.msysgit.0.173.g83185.dirty



_______________________________________________
calligra-devel mailing list
calligra-devel@kde.org
https://mail.kde.org/mailman/listinfo/calligra-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic