Changeset View
Changeset View
Standalone View
Standalone View
layers/selections/kpSelectionFactory.cpp
Show All 19 Lines | 2 | /* | |||
---|---|---|---|---|---|
20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 20 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 21 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
25 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | 26 | */ | ||
27 | 27 | | |||
28 | | ||||
29 | #define DEBUG_KP_SELECTION 0 | | |||
30 | | ||||
31 | | ||||
32 | #include "kpSelectionFactory.h" | 28 | #include "kpSelectionFactory.h" | ||
33 | 29 | | |||
34 | #include <QDataStream> | 30 | #include <QDataStream> | ||
35 | 31 | | |||
36 | #include "layers/selections/image/kpRectangularImageSelection.h" | 32 | #include "layers/selections/image/kpRectangularImageSelection.h" | ||
37 | #include "layers/selections/image/kpEllipticalImageSelection.h" | 33 | #include "layers/selections/image/kpEllipticalImageSelection.h" | ||
38 | #include "layers/selections/image/kpFreeFormImageSelection.h" | 34 | #include "layers/selections/image/kpFreeFormImageSelection.h" | ||
39 | 35 | | |||
36 | #include "kpLogCategories.h" | ||||
37 | | ||||
40 | //--------------------------------------------------------------------- | 38 | //--------------------------------------------------------------------- | ||
41 | 39 | | |||
42 | // public static | 40 | // public static | ||
43 | // TODO: KolourPaint has not been tested against invalid or malicious | 41 | // TODO: KolourPaint has not been tested against invalid or malicious | ||
44 | // clipboard data [Bug #28]. | 42 | // clipboard data [Bug #28]. | ||
45 | kpAbstractImageSelection *kpSelectionFactory::FromStream (QDataStream &stream) | 43 | kpAbstractImageSelection *kpSelectionFactory::FromStream (QDataStream &stream) | ||
46 | { | 44 | { | ||
47 | #if DEBUG_KP_SELECTION && 1 | | |||
48 | qCDebug(kpLogLayers) << "kpSelectionFactory::FromStream()"; | 45 | qCDebug(kpLogLayers) << "kpSelectionFactory::FromStream()"; | ||
49 | #endif | | |||
50 | int serialID; | 46 | int serialID; | ||
51 | stream >> serialID; | 47 | stream >> serialID; | ||
52 | 48 | | |||
53 | #if DEBUG_KP_SELECTION && 1 | | |||
54 | qCDebug(kpLogLayers) << "\tserialID=" << serialID; | 49 | qCDebug(kpLogLayers) << "\tserialID=" << serialID; | ||
55 | #endif | | |||
56 | 50 | | |||
57 | // Only image selections are marshalled. | 51 | // Only image selections are marshalled. | ||
58 | // | 52 | // | ||
59 | // Text selections are only ever seen in the clipboard as ordinary text, | 53 | // Text selections are only ever seen in the clipboard as ordinary text, | ||
60 | // not selections, since copying text formatting over the clipboard doesn't | 54 | // not selections, since copying text formatting over the clipboard doesn't | ||
61 | // seem compelling. | 55 | // seem compelling. | ||
62 | kpAbstractImageSelection *imageSel = nullptr; | 56 | kpAbstractImageSelection *imageSel = nullptr; | ||
63 | switch (serialID) | 57 | switch (serialID) | ||
Show All 30 Lines |