Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "jni.h" |
| 18 | #include "JNIHelp.h" |
Andreas Gampe | f4e341d | 2014-11-13 16:07:13 -0800 | [diff] [blame] | 19 | |
| 20 | #pragma GCC diagnostic push |
| 21 | #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 22 | #include "fpdfview.h" |
Svet Ganov | fbd0288 | 2015-06-04 14:49:16 -0700 | [diff] [blame] | 23 | #include "fpdf_edit.h" |
| 24 | #include "fpdf_save.h" |
Svetoslav | bec22be | 2014-09-25 13:03:20 -0700 | [diff] [blame] | 25 | #include "fsdk_rendercontext.h" |
| 26 | #include "fpdf_transformpage.h" |
Andreas Gampe | f4e341d | 2014-11-13 16:07:13 -0800 | [diff] [blame] | 27 | #pragma GCC diagnostic pop |
| 28 | |
Svetoslav | bec22be | 2014-09-25 13:03:20 -0700 | [diff] [blame] | 29 | #include "SkMatrix.h" |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 30 | |
Andreas Gampe | ed6b9df | 2014-11-20 22:02:20 -0800 | [diff] [blame] | 31 | #include <core_jni_helpers.h> |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 32 | #include <vector> |
| 33 | #include <utils/Log.h> |
| 34 | #include <unistd.h> |
| 35 | #include <sys/types.h> |
| 36 | #include <unistd.h> |
| 37 | |
| 38 | namespace android { |
| 39 | |
Svetoslav | bec22be | 2014-09-25 13:03:20 -0700 | [diff] [blame] | 40 | enum PageBox {PAGE_BOX_MEDIA, PAGE_BOX_CROP}; |
| 41 | |
| 42 | static struct { |
| 43 | jfieldID x; |
| 44 | jfieldID y; |
| 45 | } gPointClassInfo; |
| 46 | |
| 47 | static struct { |
| 48 | jfieldID left; |
| 49 | jfieldID top; |
| 50 | jfieldID right; |
| 51 | jfieldID bottom; |
| 52 | } gRectClassInfo; |
| 53 | |
Philip P. Moltmann | be2e712 | 2016-04-27 09:46:48 -0700 | [diff] [blame] | 54 | // Also used in PdfRenderer.cpp |
Philip P. Moltmann | be2e712 | 2016-04-27 09:46:48 -0700 | [diff] [blame] | 55 | int sUnmatchedPdfiumInitRequestCount = 0; |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 56 | |
| 57 | static void initializeLibraryIfNeeded() { |
Philip P. Moltmann | be2e712 | 2016-04-27 09:46:48 -0700 | [diff] [blame] | 58 | if (sUnmatchedPdfiumInitRequestCount == 0) { |
Svet Ganov | fbd0288 | 2015-06-04 14:49:16 -0700 | [diff] [blame] | 59 | FPDF_InitLibrary(); |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 60 | } |
Philip P. Moltmann | be2e712 | 2016-04-27 09:46:48 -0700 | [diff] [blame] | 61 | sUnmatchedPdfiumInitRequestCount++; |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | static void destroyLibraryIfNeeded() { |
Philip P. Moltmann | be2e712 | 2016-04-27 09:46:48 -0700 | [diff] [blame] | 65 | sUnmatchedPdfiumInitRequestCount--; |
| 66 | if (sUnmatchedPdfiumInitRequestCount == 0) { |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 67 | FPDF_DestroyLibrary(); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | static int getBlock(void* param, unsigned long position, unsigned char* outBuffer, |
| 72 | unsigned long size) { |
| 73 | const int fd = reinterpret_cast<intptr_t>(param); |
| 74 | const int readCount = pread(fd, outBuffer, size, position); |
| 75 | if (readCount < 0) { |
| 76 | ALOGE("Cannot read from file descriptor. Error:%d", errno); |
| 77 | return 0; |
| 78 | } |
| 79 | return 1; |
| 80 | } |
| 81 | |
| 82 | static jlong nativeOpen(JNIEnv* env, jclass thiz, jint fd, jlong size) { |
| 83 | initializeLibraryIfNeeded(); |
| 84 | |
| 85 | FPDF_FILEACCESS loader; |
| 86 | loader.m_FileLen = size; |
| 87 | loader.m_Param = reinterpret_cast<void*>(intptr_t(fd)); |
| 88 | loader.m_GetBlock = &getBlock; |
| 89 | |
| 90 | FPDF_DOCUMENT document = FPDF_LoadCustomDocument(&loader, NULL); |
| 91 | |
| 92 | if (!document) { |
| 93 | const long error = FPDF_GetLastError(); |
Svet Ganov | fce84f0 | 2014-10-31 16:56:52 -0700 | [diff] [blame] | 94 | switch (error) { |
| 95 | case FPDF_ERR_PASSWORD: |
| 96 | case FPDF_ERR_SECURITY: { |
Dan Albert | 3a091b7 | 2014-11-20 15:41:25 -0800 | [diff] [blame] | 97 | jniThrowExceptionFmt(env, "java/lang/SecurityException", |
| 98 | "cannot create document. Error: %ld", error); |
Svet Ganov | fce84f0 | 2014-10-31 16:56:52 -0700 | [diff] [blame] | 99 | } break; |
| 100 | default: { |
Dan Albert | 3a091b7 | 2014-11-20 15:41:25 -0800 | [diff] [blame] | 101 | jniThrowExceptionFmt(env, "java/io/IOException", |
| 102 | "cannot create document. Error: %ld", error); |
Svet Ganov | fce84f0 | 2014-10-31 16:56:52 -0700 | [diff] [blame] | 103 | } break; |
| 104 | } |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 105 | destroyLibraryIfNeeded(); |
| 106 | return -1; |
| 107 | } |
| 108 | |
| 109 | return reinterpret_cast<jlong>(document); |
| 110 | } |
| 111 | |
| 112 | static void nativeClose(JNIEnv* env, jclass thiz, jlong documentPtr) { |
| 113 | FPDF_DOCUMENT document = reinterpret_cast<FPDF_DOCUMENT>(documentPtr); |
| 114 | FPDF_CloseDocument(document); |
| 115 | destroyLibraryIfNeeded(); |
| 116 | } |
| 117 | |
| 118 | static jint nativeGetPageCount(JNIEnv* env, jclass thiz, jlong documentPtr) { |
| 119 | FPDF_DOCUMENT document = reinterpret_cast<FPDF_DOCUMENT>(documentPtr); |
| 120 | return FPDF_GetPageCount(document); |
| 121 | } |
| 122 | |
| 123 | static jint nativeRemovePage(JNIEnv* env, jclass thiz, jlong documentPtr, jint pageIndex) { |
| 124 | FPDF_DOCUMENT document = reinterpret_cast<FPDF_DOCUMENT>(documentPtr); |
| 125 | FPDFPage_Delete(document, pageIndex); |
| 126 | return FPDF_GetPageCount(document); |
| 127 | } |
| 128 | |
| 129 | struct PdfToFdWriter : FPDF_FILEWRITE { |
| 130 | int dstFd; |
| 131 | }; |
| 132 | |
| 133 | static bool writeAllBytes(const int fd, const void* buffer, const size_t byteCount) { |
| 134 | char* writeBuffer = static_cast<char*>(const_cast<void*>(buffer)); |
| 135 | size_t remainingBytes = byteCount; |
| 136 | while (remainingBytes > 0) { |
| 137 | ssize_t writtenByteCount = write(fd, writeBuffer, remainingBytes); |
| 138 | if (writtenByteCount == -1) { |
| 139 | if (errno == EINTR) { |
| 140 | continue; |
| 141 | } |
| 142 | __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, |
| 143 | "Error writing to buffer: %d", errno); |
| 144 | return false; |
| 145 | } |
| 146 | remainingBytes -= writtenByteCount; |
| 147 | writeBuffer += writtenByteCount; |
| 148 | } |
| 149 | return true; |
| 150 | } |
| 151 | |
| 152 | static int writeBlock(FPDF_FILEWRITE* owner, const void* buffer, unsigned long size) { |
| 153 | const PdfToFdWriter* writer = reinterpret_cast<PdfToFdWriter*>(owner); |
| 154 | const bool success = writeAllBytes(writer->dstFd, buffer, size); |
Bernhard Rosenkränzer | 92ddfcf | 2014-11-17 22:01:27 +0100 | [diff] [blame] | 155 | if (!success) { |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 156 | ALOGE("Cannot write to file descriptor. Error:%d", errno); |
| 157 | return 0; |
| 158 | } |
| 159 | return 1; |
| 160 | } |
| 161 | |
| 162 | static void nativeWrite(JNIEnv* env, jclass thiz, jlong documentPtr, jint fd) { |
| 163 | FPDF_DOCUMENT document = reinterpret_cast<FPDF_DOCUMENT>(documentPtr); |
| 164 | PdfToFdWriter writer; |
| 165 | writer.dstFd = fd; |
| 166 | writer.WriteBlock = &writeBlock; |
| 167 | const bool success = FPDF_SaveAsCopy(document, &writer, FPDF_NO_INCREMENTAL); |
| 168 | if (!success) { |
Dan Albert | 46d8444 | 2014-11-18 16:07:51 -0800 | [diff] [blame] | 169 | jniThrowExceptionFmt(env, "java/io/IOException", |
| 170 | "cannot write to fd. Error: %d", errno); |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 171 | destroyLibraryIfNeeded(); |
| 172 | } |
| 173 | } |
| 174 | |
Svetoslav | bec22be | 2014-09-25 13:03:20 -0700 | [diff] [blame] | 175 | static void nativeSetTransformAndClip(JNIEnv* env, jclass thiz, jlong documentPtr, jint pageIndex, |
| 176 | jlong transformPtr, jint clipLeft, jint clipTop, jint clipRight, jint clipBottom) { |
| 177 | FPDF_DOCUMENT document = reinterpret_cast<FPDF_DOCUMENT>(documentPtr); |
| 178 | |
| 179 | CPDF_Page* page = (CPDF_Page*) FPDF_LoadPage(document, pageIndex); |
| 180 | if (!page) { |
| 181 | jniThrowException(env, "java/lang/IllegalStateException", |
| 182 | "cannot open page"); |
| 183 | return; |
| 184 | } |
| 185 | |
| 186 | double width = 0; |
| 187 | double height = 0; |
| 188 | |
| 189 | const int result = FPDF_GetPageSizeByIndex(document, pageIndex, &width, &height); |
| 190 | if (!result) { |
| 191 | jniThrowException(env, "java/lang/IllegalStateException", |
| 192 | "cannot get page size"); |
| 193 | return; |
| 194 | } |
| 195 | |
Philip P. Moltmann | 79bd8d4 | 2016-03-07 09:19:45 -0800 | [diff] [blame] | 196 | CFX_Matrix matrix; |
Svetoslav | bec22be | 2014-09-25 13:03:20 -0700 | [diff] [blame] | 197 | |
| 198 | SkMatrix* skTransform = reinterpret_cast<SkMatrix*>(transformPtr); |
| 199 | |
| 200 | SkScalar transformValues[6]; |
Mike Reed | 71487eb | 2014-11-19 16:13:20 -0500 | [diff] [blame] | 201 | if (!skTransform->asAffine(transformValues)) { |
| 202 | jniThrowException(env, "java/lang/IllegalArgumentException", |
| 203 | "transform matrix has perspective. Only affine matrices are allowed."); |
| 204 | return; |
| 205 | } |
Svetoslav | bec22be | 2014-09-25 13:03:20 -0700 | [diff] [blame] | 206 | |
| 207 | // PDF's coordinate system origin is left-bottom while in graphics it |
| 208 | // is the top-left. So, translate the PDF coordinates to ours. |
| 209 | matrix.Set(1, 0, 0, -1, 0, page->GetPageHeight()); |
| 210 | |
| 211 | // Apply the transformation what was created in our coordinates. |
| 212 | matrix.Concat(transformValues[SkMatrix::kAScaleX], transformValues[SkMatrix::kASkewY], |
| 213 | transformValues[SkMatrix::kASkewX], transformValues[SkMatrix::kAScaleY], |
| 214 | transformValues[SkMatrix::kATransX], transformValues[SkMatrix::kATransY]); |
| 215 | |
| 216 | // Translate the result back to PDF coordinates. |
| 217 | matrix.Concat(1, 0, 0, -1, 0, page->GetPageHeight()); |
| 218 | |
| 219 | FS_MATRIX transform = {matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f}; |
| 220 | FS_RECTF clip = {(float) clipLeft, (float) clipTop, (float) clipRight, (float) clipBottom}; |
| 221 | |
| 222 | FPDFPage_TransFormWithClip(page, &transform, &clip); |
| 223 | |
| 224 | FPDF_ClosePage(page); |
| 225 | } |
| 226 | |
| 227 | static void nativeGetPageSize(JNIEnv* env, jclass thiz, jlong documentPtr, |
| 228 | jint pageIndex, jobject outSize) { |
| 229 | FPDF_DOCUMENT document = reinterpret_cast<FPDF_DOCUMENT>(documentPtr); |
| 230 | |
| 231 | FPDF_PAGE page = FPDF_LoadPage(document, pageIndex); |
| 232 | if (!page) { |
| 233 | jniThrowException(env, "java/lang/IllegalStateException", |
| 234 | "cannot open page"); |
| 235 | return; |
| 236 | } |
| 237 | |
| 238 | double width = 0; |
| 239 | double height = 0; |
| 240 | |
| 241 | const int result = FPDF_GetPageSizeByIndex(document, pageIndex, &width, &height); |
| 242 | if (!result) { |
| 243 | jniThrowException(env, "java/lang/IllegalStateException", |
| 244 | "cannot get page size"); |
| 245 | return; |
| 246 | } |
| 247 | |
| 248 | env->SetIntField(outSize, gPointClassInfo.x, width); |
| 249 | env->SetIntField(outSize, gPointClassInfo.y, height); |
| 250 | |
| 251 | FPDF_ClosePage(page); |
| 252 | } |
| 253 | |
| 254 | static jboolean nativeScaleForPrinting(JNIEnv* env, jclass thiz, jlong documentPtr) { |
| 255 | FPDF_DOCUMENT document = reinterpret_cast<FPDF_DOCUMENT>(documentPtr); |
| 256 | FPDF_BOOL success = FPDF_VIEWERREF_GetPrintScaling(document); |
| 257 | return success ? JNI_TRUE : JNI_FALSE; |
| 258 | } |
| 259 | |
| 260 | static bool nativeGetPageBox(JNIEnv* env, jclass thiz, jlong documentPtr, jint pageIndex, |
| 261 | PageBox pageBox, jobject outBox) { |
| 262 | FPDF_DOCUMENT document = reinterpret_cast<FPDF_DOCUMENT>(documentPtr); |
| 263 | |
| 264 | FPDF_PAGE page = FPDF_LoadPage(document, pageIndex); |
| 265 | if (!page) { |
| 266 | jniThrowException(env, "java/lang/IllegalStateException", |
| 267 | "cannot open page"); |
| 268 | return false; |
| 269 | } |
| 270 | |
| 271 | float left; |
| 272 | float top; |
| 273 | float right; |
| 274 | float bottom; |
| 275 | |
| 276 | const FPDF_BOOL success = (pageBox == PAGE_BOX_MEDIA) |
| 277 | ? FPDFPage_GetMediaBox(page, &left, &top, &right, &bottom) |
| 278 | : FPDFPage_GetCropBox(page, &left, &top, &right, &bottom); |
| 279 | |
| 280 | FPDF_ClosePage(page); |
| 281 | |
| 282 | if (!success) { |
| 283 | return false; |
| 284 | } |
| 285 | |
| 286 | env->SetIntField(outBox, gRectClassInfo.left, (int) left); |
| 287 | env->SetIntField(outBox, gRectClassInfo.top, (int) top); |
| 288 | env->SetIntField(outBox, gRectClassInfo.right, (int) right); |
| 289 | env->SetIntField(outBox, gRectClassInfo.bottom, (int) bottom); |
| 290 | |
| 291 | return true; |
| 292 | } |
| 293 | |
| 294 | static jboolean nativeGetPageMediaBox(JNIEnv* env, jclass thiz, jlong documentPtr, jint pageIndex, |
| 295 | jobject outMediaBox) { |
| 296 | const bool success = nativeGetPageBox(env, thiz, documentPtr, pageIndex, PAGE_BOX_MEDIA, |
| 297 | outMediaBox); |
| 298 | return success ? JNI_TRUE : JNI_FALSE; |
| 299 | } |
| 300 | |
| 301 | static jboolean nativeGetPageCropBox(JNIEnv* env, jclass thiz, jlong documentPtr, jint pageIndex, |
| 302 | jobject outMediaBox) { |
| 303 | const bool success = nativeGetPageBox(env, thiz, documentPtr, pageIndex, PAGE_BOX_CROP, |
| 304 | outMediaBox); |
| 305 | return success ? JNI_TRUE : JNI_FALSE; |
| 306 | } |
| 307 | |
| 308 | static void nativeSetPageBox(JNIEnv* env, jclass thiz, jlong documentPtr, jint pageIndex, |
| 309 | PageBox pageBox, jobject box) { |
| 310 | FPDF_DOCUMENT document = reinterpret_cast<FPDF_DOCUMENT>(documentPtr); |
| 311 | |
| 312 | FPDF_PAGE page = FPDF_LoadPage(document, pageIndex); |
| 313 | if (!page) { |
| 314 | jniThrowException(env, "java/lang/IllegalStateException", |
| 315 | "cannot open page"); |
| 316 | return; |
| 317 | } |
| 318 | |
| 319 | const int left = env->GetIntField(box, gRectClassInfo.left); |
| 320 | const int top = env->GetIntField(box, gRectClassInfo.top); |
| 321 | const int right = env->GetIntField(box, gRectClassInfo.right); |
| 322 | const int bottom = env->GetIntField(box, gRectClassInfo.bottom); |
| 323 | |
| 324 | if (pageBox == PAGE_BOX_MEDIA) { |
| 325 | FPDFPage_SetMediaBox(page, left, top, right, bottom); |
| 326 | } else { |
| 327 | FPDFPage_SetCropBox(page, left, top, right, bottom); |
| 328 | } |
| 329 | |
| 330 | FPDF_ClosePage(page); |
| 331 | } |
| 332 | |
| 333 | static void nativeSetPageMediaBox(JNIEnv* env, jclass thiz, jlong documentPtr, jint pageIndex, |
| 334 | jobject mediaBox) { |
| 335 | nativeSetPageBox(env, thiz, documentPtr, pageIndex, PAGE_BOX_MEDIA, mediaBox); |
| 336 | } |
| 337 | |
| 338 | static void nativeSetPageCropBox(JNIEnv* env, jclass thiz, jlong documentPtr, jint pageIndex, |
| 339 | jobject mediaBox) { |
| 340 | nativeSetPageBox(env, thiz, documentPtr, pageIndex, PAGE_BOX_CROP, mediaBox); |
| 341 | } |
| 342 | |
Daniel Micay | 76f6a86 | 2015-09-19 17:31:01 -0400 | [diff] [blame] | 343 | static const JNINativeMethod gPdfEditor_Methods[] = { |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 344 | {"nativeOpen", "(IJ)J", (void*) nativeOpen}, |
| 345 | {"nativeClose", "(J)V", (void*) nativeClose}, |
| 346 | {"nativeGetPageCount", "(J)I", (void*) nativeGetPageCount}, |
| 347 | {"nativeRemovePage", "(JI)I", (void*) nativeRemovePage}, |
Svetoslav | bec22be | 2014-09-25 13:03:20 -0700 | [diff] [blame] | 348 | {"nativeWrite", "(JI)V", (void*) nativeWrite}, |
| 349 | {"nativeSetTransformAndClip", "(JIJIIII)V", (void*) nativeSetTransformAndClip}, |
| 350 | {"nativeGetPageSize", "(JILandroid/graphics/Point;)V", (void*) nativeGetPageSize}, |
| 351 | {"nativeScaleForPrinting", "(J)Z", (void*) nativeScaleForPrinting}, |
| 352 | {"nativeGetPageMediaBox", "(JILandroid/graphics/Rect;)Z", (void*) nativeGetPageMediaBox}, |
| 353 | {"nativeSetPageMediaBox", "(JILandroid/graphics/Rect;)V", (void*) nativeSetPageMediaBox}, |
| 354 | {"nativeGetPageCropBox", "(JILandroid/graphics/Rect;)Z", (void*) nativeGetPageCropBox}, |
| 355 | {"nativeSetPageCropBox", "(JILandroid/graphics/Rect;)V", (void*) nativeSetPageCropBox} |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 356 | }; |
| 357 | |
| 358 | int register_android_graphics_pdf_PdfEditor(JNIEnv* env) { |
Andreas Gampe | 7d13d9d | 2014-11-21 10:36:14 -0800 | [diff] [blame] | 359 | const int result = RegisterMethodsOrDie( |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 360 | env, "android/graphics/pdf/PdfEditor", gPdfEditor_Methods, |
| 361 | NELEM(gPdfEditor_Methods)); |
Svetoslav | bec22be | 2014-09-25 13:03:20 -0700 | [diff] [blame] | 362 | |
Andreas Gampe | 7d13d9d | 2014-11-21 10:36:14 -0800 | [diff] [blame] | 363 | jclass pointClass = FindClassOrDie(env, "android/graphics/Point"); |
| 364 | gPointClassInfo.x = GetFieldIDOrDie(env, pointClass, "x", "I"); |
| 365 | gPointClassInfo.y = GetFieldIDOrDie(env, pointClass, "y", "I"); |
Svetoslav | bec22be | 2014-09-25 13:03:20 -0700 | [diff] [blame] | 366 | |
Andreas Gampe | 7d13d9d | 2014-11-21 10:36:14 -0800 | [diff] [blame] | 367 | jclass rectClass = FindClassOrDie(env, "android/graphics/Rect"); |
| 368 | gRectClassInfo.left = GetFieldIDOrDie(env, rectClass, "left", "I"); |
| 369 | gRectClassInfo.top = GetFieldIDOrDie(env, rectClass, "top", "I"); |
| 370 | gRectClassInfo.right = GetFieldIDOrDie(env, rectClass, "right", "I"); |
| 371 | gRectClassInfo.bottom = GetFieldIDOrDie(env, rectClass, "bottom", "I"); |
Svetoslav | bec22be | 2014-09-25 13:03:20 -0700 | [diff] [blame] | 372 | |
| 373 | return result; |
Svetoslav | 62ce332 | 2014-09-04 21:17:17 -0700 | [diff] [blame] | 374 | }; |
| 375 | |
| 376 | }; |