diff --git a/src/customWidgets/UBActionableWidget.cpp b/src/customWidgets/UBActionableWidget.cpp index 47af2621..20ddaf69 100644 --- a/src/customWidgets/UBActionableWidget.cpp +++ b/src/customWidgets/UBActionableWidget.cpp @@ -57,6 +57,7 @@ bool UBActionableWidget::shouldClose(QPoint p) void UBActionableWidget::paintEvent(QPaintEvent* ev) { + Q_UNUSED(ev); if(mShowActions){ QPainter p(this); if(mActions.contains(eAction_Close)){ diff --git a/src/customWidgets/UBDraggableMedia.cpp b/src/customWidgets/UBDraggableMedia.cpp index 6d2551f2..7b976707 100644 --- a/src/customWidgets/UBDraggableMedia.cpp +++ b/src/customWidgets/UBDraggableMedia.cpp @@ -38,5 +38,5 @@ void UBDraggableMedia::mouseMoveEvent(QMouseEvent* ev) drag->setMimeData(mimeData); - Qt::DropAction dropAction = drag->exec(Qt::CopyAction | Qt::MoveAction); + drag->exec(Qt::CopyAction | Qt::MoveAction); } diff --git a/src/gui/UBTBPageEditWidget.cpp b/src/gui/UBTBPageEditWidget.cpp index 68928bce..7957d6ab 100644 --- a/src/gui/UBTBPageEditWidget.cpp +++ b/src/gui/UBTBPageEditWidget.cpp @@ -578,5 +578,6 @@ UBPictureWidget::~UBPictureWidget() void UBPictureWidget::resizeEvent(QResizeEvent *ev) { + Q_UNUSED(ev); mpLabel->setGeometry( 10, 10, width()-2*10, height()); } diff --git a/src/pdf-merger/ASCII85Decode.cpp b/src/pdf-merger/ASCII85Decode.cpp index 1a3d3ac9..640bf5fa 100644 --- a/src/pdf-merger/ASCII85Decode.cpp +++ b/src/pdf-merger/ASCII85Decode.cpp @@ -13,7 +13,7 @@ * along with this program. If not, see . */ #include - +#include #include "ASCII85Decode.h" #include "core/memcheck.h" @@ -51,6 +51,12 @@ void ASCII85Decode::_wput(std::string &cur,unsigned long tuple, int len) } } +bool ASCII85Decode::encode(std::string & decoded) +{ + Q_UNUSED(decoded); + return false; +} + bool ASCII85Decode::decode(std::string &encoded) { unsigned long tuple = 0; @@ -58,7 +64,6 @@ bool ASCII85Decode::decode(std::string &encoded) int count = 0; int size = encoded.size(); int i = 0; - bool found = false; for(;size;) { char ch = encoded[i++]; @@ -121,3 +126,7 @@ bool ASCII85Decode::decode(std::string &encoded) } return true; } +void ASCII85Decode::initialize(Object * objectWithStram) +{ + Q_UNUSED(objectWithStram); +}; diff --git a/src/pdf-merger/ASCII85Decode.h b/src/pdf-merger/ASCII85Decode.h index fb1094f0..a6d7ae3e 100644 --- a/src/pdf-merger/ASCII85Decode.h +++ b/src/pdf-merger/ASCII85Decode.h @@ -26,9 +26,9 @@ namespace merge_lib public: ASCII85Decode(){}; virtual ~ASCII85Decode(){}; - bool encode(std::string & decoded) {return false;} + bool encode(std::string & decoded); bool decode(std::string & encoded); - void initialize(Object * objectWithStram){}; + void initialize(Object * objectWithStram); private: void _wput(std::string &cur,unsigned long tuple, int len); diff --git a/src/pdf-merger/ASCIIHexDecode.cpp b/src/pdf-merger/ASCIIHexDecode.cpp index 17e184ac..93aa990e 100644 --- a/src/pdf-merger/ASCIIHexDecode.cpp +++ b/src/pdf-merger/ASCIIHexDecode.cpp @@ -13,7 +13,7 @@ * along with this program. If not, see . */ #include "ASCIIHexDecode.h" - +#include #include #include "Utils.h" @@ -42,6 +42,12 @@ static unsigned int convertHexVal(unsigned char c) return 0; } +bool ASCIIHexDecode::encode(std::string & decoded) +{ + Q_UNUSED(decoded); + return false; +} + bool ASCIIHexDecode::decode(std::string & encoded) { bool isLow = true; @@ -75,3 +81,8 @@ bool ASCIIHexDecode::decode(std::string & encoded) encoded = decoded; return true; } + +void ASCIIHexDecode::initialize(Object * objectWithStram) +{ + Q_UNUSED(objectWithStram); +} diff --git a/src/pdf-merger/ASCIIHexDecode.h b/src/pdf-merger/ASCIIHexDecode.h index 4b0e4a0b..35c80a36 100644 --- a/src/pdf-merger/ASCIIHexDecode.h +++ b/src/pdf-merger/ASCIIHexDecode.h @@ -26,9 +26,9 @@ namespace merge_lib public: ASCIIHexDecode(){}; virtual ~ASCIIHexDecode(){}; - bool encode(std::string & decoded){return false;} + bool encode(std::string & decoded); bool decode(std::string & encoded); - void initialize(Object * objectWithStram){}; + void initialize(Object * objectWithStram); }; } diff --git a/src/pdf-merger/CCITTFaxDecode.cpp b/src/pdf-merger/CCITTFaxDecode.cpp new file mode 100644 index 00000000..1b9310c9 --- /dev/null +++ b/src/pdf-merger/CCITTFaxDecode.cpp @@ -0,0 +1,36 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include "CCITTFaxDecode.h" + +using namespace merge_lib; + +bool CCITTFaxDecode::encode(std::string & decoded) +{ + Q_UNUSED(decoded); + return true; +} + +bool CCITTFaxDecode::decode(std::string & encoded) +{ + Q_UNUSED(encoded); + return true; +} + +void CCITTFaxDecode::initialize(Object * objectWithStram) +{ + Q_UNUSED(objectWithStram); +} diff --git a/src/pdf-merger/CCITTFaxDecode.h b/src/pdf-merger/CCITTFaxDecode.h index add43139..9bc65ac8 100644 --- a/src/pdf-merger/CCITTFaxDecode.h +++ b/src/pdf-merger/CCITTFaxDecode.h @@ -16,6 +16,8 @@ #define CCITTFaxDecode_H #include +#include "Decoder.h" + namespace merge_lib { // this class provides method for FlateDecode encoding and decoding @@ -24,9 +26,9 @@ namespace merge_lib public: CCITTFaxDecode(){}; virtual ~CCITTFaxDecode(){}; - bool encode(std::string & decoded) {return true;}; - bool decode(std::string & encoded) {return true;}; - void initialize(Object * objectWithStram){}; + bool encode(std::string & decoded); + bool decode(std::string & encoded); + void initialize(Object * objectWithStram); }; } diff --git a/src/pdf-merger/ContentHandler.cpp b/src/pdf-merger/ContentHandler.cpp index 0e298b39..8194524e 100644 --- a/src/pdf-merger/ContentHandler.cpp +++ b/src/pdf-merger/ContentHandler.cpp @@ -12,6 +12,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #include "ContentHandler.h" #include "Filter.h" #include "FlateDecode.h" diff --git a/src/pdf-merger/DCTDecode.cpp b/src/pdf-merger/DCTDecode.cpp new file mode 100644 index 00000000..603926c5 --- /dev/null +++ b/src/pdf-merger/DCTDecode.cpp @@ -0,0 +1,36 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include "DCTDecode.h" + +using namespace merge_lib; + +bool DCTDecode::encode(std::string & decoded) +{ + Q_UNUSED(decoded); + return true; +} + +bool DCTDecode::decode(std::string & encoded) +{ + Q_UNUSED(encoded); + return true; +} + +void DCTDecode::initialize(Object * objectWithStram) +{ + Q_UNUSED(objectWithStram); +} diff --git a/src/pdf-merger/DCTDecode.h b/src/pdf-merger/DCTDecode.h index 011b9520..3e22cdc8 100644 --- a/src/pdf-merger/DCTDecode.h +++ b/src/pdf-merger/DCTDecode.h @@ -16,7 +16,7 @@ #define DCTDecode_H #include - +#include "Decoder.h" namespace merge_lib { // this class provides method for FlateDecode encoding and decoding @@ -25,9 +25,9 @@ namespace merge_lib public: DCTDecode(){}; virtual ~DCTDecode(){}; - bool encode(std::string & decoded) {return true;}; - bool decode(std::string & encoded) {return true;}; - void initialize(Object * objectWithStram){}; + bool encode(std::string & decoded); + bool decode(std::string & encoded); + void initialize(Object * objectWithStram); }; } diff --git a/src/pdf-merger/Document.cpp b/src/pdf-merger/Document.cpp index ac3c0cb8..fad1ee2b 100644 --- a/src/pdf-merger/Document.cpp +++ b/src/pdf-merger/Document.cpp @@ -28,7 +28,8 @@ using namespace merge_lib; const std::string firstObj("%PDF-1.4\n1 0 obj\n<<\n/Title ()/Creator ()/Producer (Qt 4.5.0 (C) 1992-2009 Nokia Corporation and/or its subsidiary(-ies))/CreationDate (D:20090424120829)\n>>\nendobj\n"); const std::string zeroStr("0000000000"); -Document::Document(const char * fileName): _pages(), _maxObjectNumber(0),_root(0),_documentName(fileName) +Document::Document(const char * fileName): + _root(0), _pages(), _documentName(fileName), _maxObjectNumber(0) { } diff --git a/src/pdf-merger/FilterPredictor.cpp b/src/pdf-merger/FilterPredictor.cpp index 4be65d31..b828c515 100644 --- a/src/pdf-merger/FilterPredictor.cpp +++ b/src/pdf-merger/FilterPredictor.cpp @@ -15,6 +15,7 @@ #include "Config.h" #include #include +#include #include "FilterPredictor.h" #include "Utils.h" @@ -49,6 +50,12 @@ FilterPredictor::~FilterPredictor() { } + bool FilterPredictor::encode(std::string & decoded) + { + Q_UNUSED(decoded); + return false; + } + std::string FilterPredictor::getDictionaryContentStr(std::string & in, size_t &pos ) { size_t beg = in.find(DICT_START_TOKEN,pos); diff --git a/src/pdf-merger/FilterPredictor.h b/src/pdf-merger/FilterPredictor.h index 45897d9b..f201fc52 100644 --- a/src/pdf-merger/FilterPredictor.h +++ b/src/pdf-merger/FilterPredictor.h @@ -27,7 +27,7 @@ namespace merge_lib public: FilterPredictor(); virtual ~FilterPredictor(); - bool encode(std::string & decoded){return false;} + bool encode(std::string & decoded); bool decode(std::string & encoded); void initialize(Object * objectWithStream); diff --git a/src/pdf-merger/JBIG2Decode.cpp b/src/pdf-merger/JBIG2Decode.cpp new file mode 100644 index 00000000..6ef248d0 --- /dev/null +++ b/src/pdf-merger/JBIG2Decode.cpp @@ -0,0 +1,36 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include "JBIG2Decode.h" + +using namespace merge_lib; + +bool JBIG2Decode::encode(std::string & decoded) +{ + Q_UNUSED(decoded); + return true; +} + +bool JBIG2Decode::decode(std::string & encoded) +{ + Q_UNUSED(encoded); + return true; +} + +void JBIG2Decode::initialize(Object * objectWithStram) +{ + Q_UNUSED(objectWithStram); +} diff --git a/src/pdf-merger/JBIG2Decode.h b/src/pdf-merger/JBIG2Decode.h index f4ad9e17..4b7e7cbd 100644 --- a/src/pdf-merger/JBIG2Decode.h +++ b/src/pdf-merger/JBIG2Decode.h @@ -16,6 +16,7 @@ #define JBIG2Decode_H #include +#include "Decoder.h" namespace merge_lib { @@ -25,9 +26,9 @@ namespace merge_lib public: JBIG2Decode(){}; virtual ~JBIG2Decode(){}; - bool encode(std::string & decoded) {return true;}; - bool decode(std::string & encoded) {return true;}; - void initialize(Object * objectWithStram){}; + bool encode(std::string & decoded); + bool decode(std::string & encoded); + void initialize(Object * objectWithStram); }; } diff --git a/src/pdf-merger/LZWDecode.cpp b/src/pdf-merger/LZWDecode.cpp index fcc710df..c1b5a21a 100644 --- a/src/pdf-merger/LZWDecode.cpp +++ b/src/pdf-merger/LZWDecode.cpp @@ -44,6 +44,11 @@ LZWDecode::~LZWDecode() } } +bool LZWDecode::encode(std::string & decoded) +{ + return true; +} + void LZWDecode::initialize(Object * objectWithStream) { if( objectWithStream ) diff --git a/src/pdf-merger/LZWDecode.h b/src/pdf-merger/LZWDecode.h index 882276ab..e76d2b65 100644 --- a/src/pdf-merger/LZWDecode.h +++ b/src/pdf-merger/LZWDecode.h @@ -27,7 +27,7 @@ namespace merge_lib public: LZWDecode(); virtual ~LZWDecode(); - bool encode(std::string & decoded) {return true;}; + bool encode(std::string & decoded); bool decode(std::string & encoded); void initialize(Object * objectWithStram); private: diff --git a/src/pdf-merger/PageElementHandler.cpp b/src/pdf-merger/PageElementHandler.cpp index c29ada4a..462ea8b7 100644 --- a/src/pdf-merger/PageElementHandler.cpp +++ b/src/pdf-merger/PageElementHandler.cpp @@ -12,8 +12,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "PageElementHandler.h" +#include "PageElementHandler.h" +#include #include "core/memcheck.h" using namespace merge_lib; @@ -88,3 +89,8 @@ unsigned int PageElementHandler::_findEndOfElementContent(unsigned int startOfPa } return _pageContent.rfind(">>"); } + +void PageElementHandler::_processObjectContent(unsigned int startOfPageElement) +{ + Q_UNUSED(startOfPageElement); +} diff --git a/src/pdf-merger/PageElementHandler.h b/src/pdf-merger/PageElementHandler.h index 721476c0..c00cd93e 100644 --- a/src/pdf-merger/PageElementHandler.h +++ b/src/pdf-merger/PageElementHandler.h @@ -73,14 +73,14 @@ namespace merge_lib void _createAllPageFieldsSet(); //members - std::string & _pageContent; Object * _page; + std::string & _pageContent; std::string _handlerName; PageElementHandler * _nextHandler; private: //methods - virtual void _processObjectContent(unsigned int startOfPageElement){}; + virtual void _processObjectContent(unsigned int startOfPageElement); virtual void _changeObjectContent(unsigned int startOfPageElement) = 0; virtual void _pageElementNotFound() {}; unsigned int _findStartOfPageElement() diff --git a/src/pdf-merger/RunLengthDecode.cpp b/src/pdf-merger/RunLengthDecode.cpp index 33014041..cf5e64c0 100644 --- a/src/pdf-merger/RunLengthDecode.cpp +++ b/src/pdf-merger/RunLengthDecode.cpp @@ -12,12 +12,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "RunLengthDecode.h" +#include "RunLengthDecode.h" +#include #include "core/memcheck.h" using namespace merge_lib; +bool RunLengthDecode::encode(std::string & decoded) +{ + Q_UNUSED(decoded); + return false; +} + /* The encoded data is a sequence of runs, where each run consists of a length byte followed by 1 to 128 bytes of data. If the length byte is in the range 0 to 127, the following length + 1 (1 to 128) bytes @@ -57,3 +64,8 @@ bool RunLengthDecode::decode(std::string & encoded) } return true; } + +void RunLengthDecode::initialize(Object * objectWithStream) +{ + Q_UNUSED(objectWithStream); +}; diff --git a/src/pdf-merger/RunLengthDecode.h b/src/pdf-merger/RunLengthDecode.h index fd429eda..a6af064f 100644 --- a/src/pdf-merger/RunLengthDecode.h +++ b/src/pdf-merger/RunLengthDecode.h @@ -26,9 +26,9 @@ namespace merge_lib public: RunLengthDecode(){}; virtual ~RunLengthDecode(){}; - bool encode(std::string & decoded){return false;} + bool encode(std::string & decoded); bool decode(std::string & encoded); - void initialize(Object * objectWithStream){}; + void initialize(Object * objectWithStream); }; } diff --git a/src/pdf-merger/pdfMerger.pri b/src/pdf-merger/pdfMerger.pri index edc8d1fd..d94a2c7b 100644 --- a/src/pdf-merger/pdfMerger.pri +++ b/src/pdf-merger/pdfMerger.pri @@ -54,7 +54,10 @@ SOURCES += \ RemoveHimselfHandler.cpp \ RunLengthDecode.cpp \ Utils.cpp \ - OverlayDocumentParser.cpp + OverlayDocumentParser.cpp \ + src/pdf-merger/CCITTFaxDecode.cpp \ + src/pdf-merger/JBIG2Decode.cpp \ + src/pdf-merger/DCTDecode.cpp macx { @@ -83,3 +86,6 @@ linux-g++-64 { LIBS += -lz } + + +