Commit 17c7e3b0 authored by Albert Astals Cid's avatar Albert Astals Cid

utils: Move numberOfCharacters to shared file

parent 73ab9930
//========================================================================
//
// pdfsig.cc
//
// This file is licensed under the GPLv2 or later
//
// Copyright (C) 2010 Albert Astals Cid <aacid@kde.org>
//
//========================================================================
#ifndef NUMBEROFCHARACTERS_H
#define NUMBEROFCHARACTERS_H
static int numberOfCharacters(unsigned int n)
{
int charNum = 0;
while (n >= 10)
{
n = n / 10;
charNum++;
}
charNum++;
return charNum;
}
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include "PDFDocFactory.h" #include "PDFDocFactory.h"
#include "CairoOutputDev.h" #include "CairoOutputDev.h"
#include "Win32Console.h" #include "Win32Console.h"
#include "numberofcharacters.h"
#ifdef USE_CMS #ifdef USE_CMS
#include <lcms2.h> #include <lcms2.h>
#endif #endif
...@@ -804,18 +805,6 @@ static GBool setPSPaperSize(char *size, int &psPaperWidth, int &psPaperHeight) { ...@@ -804,18 +805,6 @@ static GBool setPSPaperSize(char *size, int &psPaperWidth, int &psPaperHeight) {
return gTrue; return gTrue;
} }
static int numberOfCharacters(unsigned int n)
{
int charNum = 0;
while (n >= 10)
{
n = n / 10;
charNum++;
}
charNum++;
return charNum;
}
static GooString *getImageFileName(GooString *outputFileName, int numDigits, int page) static GooString *getImageFileName(GooString *outputFileName, int numDigits, int page)
{ {
char buf[10]; char buf[10];
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include "splash/Splash.h" #include "splash/Splash.h"
#include "SplashOutputDev.h" #include "SplashOutputDev.h"
#include "Win32Console.h" #include "Win32Console.h"
#include "numberofcharacters.h"
// Uncomment to build pdftoppm with pthreads // Uncomment to build pdftoppm with pthreads
// You may also have to change the buildsystem to // You may also have to change the buildsystem to
...@@ -366,18 +367,6 @@ static void processPageJobs() { ...@@ -366,18 +367,6 @@ static void processPageJobs() {
#endif // UTILS_USE_PTHREADS #endif // UTILS_USE_PTHREADS
static int numberOfCharacters(unsigned int n)
{
int charNum = 0;
while (n >= 10)
{
n = n / 10;
charNum++;
}
charNum++;
return charNum;
}
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
PDFDoc *doc; PDFDoc *doc;
GooString *fileName = nullptr; GooString *fileName = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment