Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
8d26a169
Kaydet (Commit)
8d26a169
authored
Agu 12, 2016
tarafından
David Tardon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#101077 make double->str conv. locale-agnostic
Change-Id: Ibb87f4a14fda6957149ca52083387760ff6e60a3
üst
6020cded
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
+61
-0
0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1
...-101077-make-double-string-conversion-locale-agno.patch.1
+58
-0
UnpackedTarball_libodfgen.mk
external/libodfgen/UnpackedTarball_libodfgen.mk
+3
-0
No files found.
external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1
0 → 100644
Dosyayı görüntüle @
8d26a169
From 68e0c8e4c834df57bc9a0e8da72151f69ff5e7a6 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Fri, 12 Aug 2016 12:50:39 +0200
Subject: [PATCH] tdf#101077 make double->string conversion locale-agnostic
---
src/OdsGenerator.cxx | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/OdsGenerator.cxx b/src/OdsGenerator.cxx
index 52e135e..8cb7203 100644
--- a/src/OdsGenerator.cxx
+++ b/src/OdsGenerator.cxx
@@ -26,6 +26,8 @@
#include <librevenge/librevenge.h>
+#include <iomanip>
+#include <locale>
#include <map>
#include <stack>
#include <sstream>
@@ -46,6 +48,19 @@
#include "OdcGenerator.hxx"
#include "OdfGenerator.hxx"
+namespace
+{
+
+librevenge::RVNGString makePreciseStr(const double value)
+{
+ std::ostringstream os;
+ os.imbue(std::locale::classic());
+ os << std::fixed << std::setprecision(8) << value;
+ return os.str().c_str();
+}
+
+}
+
class OdsGeneratorPrivate : public OdfGenerator
{
public:
@@ -968,10 +983,10 @@ void OdsGenerator::openSheetCell(const librevenge::RVNGPropertyList &propList)
// we need the maximum precision here, so we must avoid getStr() when possible
librevenge::RVNGString value;
if (propList["librevenge:value"]->getUnit()==librevenge::RVNG_GENERIC)
- value.sprintf("%.8f", propList["librevenge:value"]->getDouble());
+ value = makePreciseStr(propList["librevenge:value"]->getDouble());
else if (propList["librevenge:value"]->getUnit()==librevenge::RVNG_PERCENT)
{
- value.sprintf("%.8f", propList["librevenge:value"]->getDouble()*100.);
+ value = makePreciseStr(propList["librevenge:value"]->getDouble()*100.);
value.append('%');
}
else
--
2.7.4
external/libodfgen/UnpackedTarball_libodfgen.mk
Dosyayı görüntüle @
8d26a169
...
...
@@ -35,5 +35,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \
endif
endif
$(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \
external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 \
))
# vim: set noet sw=4 ts=4:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment